link2aws 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/link2aws.js +7 -2
  2. package/package.json +1 -1
package/link2aws.js CHANGED
@@ -74,6 +74,11 @@ class ARN {
74
74
  return this.resource.split(':');
75
75
  }
76
76
 
77
+ get pathAllButLast() {
78
+ // Example: "aws-service-role/support.amazonaws.com/AWSServiceRoleForSupport" -> "aws-service-role/support.amazonaws.com"
79
+ return this.resource.substr(0, this.resource.lastIndexOf('/'));
80
+ }
81
+
77
82
  get pathLast() {
78
83
  // Example: "aws-service-role/support.amazonaws.com/AWSServiceRoleForSupport" -> "AWSServiceRoleForSupport"
79
84
  return this.resource.substr(this.resource.lastIndexOf('/') + 1, this.resource.length);
@@ -412,10 +417,10 @@ class ARN {
412
417
  "repository": null,
413
418
  },
414
419
  "ecs": { // Amazon Elastic Container Service
415
- "cluster": null,
420
+ "cluster": () => `https://${this.region}.${this.console}/ecs/home?region=${this.region}#/clusters/${this.resource}`,
416
421
  "container-instance": null,
417
422
  "service": null,
418
- "task": null,
423
+ "task": () => `https://${this.region}.${this.console}/ecs/home?region=${this.region}#/clusters/${this.pathAllButLast}/tasks/${this.pathLast}`,
419
424
  "task-definition": null,
420
425
  "task-set": null,
421
426
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "link2aws",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Convert ARN (Amazon Resource Name) to AWS Console link",
5
5
  "main": "link2aws.js",
6
6
  "directories": {