link2aws 1.0.12 → 1.0.14
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.
- package/link2aws.js +30 -6
- package/package.json +1 -1
package/link2aws.js
CHANGED
|
@@ -17,12 +17,21 @@ class ARN {
|
|
|
17
17
|
this.service = tokens[2];
|
|
18
18
|
this.region = tokens[3];
|
|
19
19
|
this.account = tokens[4];
|
|
20
|
+
this.resource_revision = '';
|
|
20
21
|
|
|
21
22
|
// ...:resource-type:resource-id (resource-id can contain colons!)
|
|
22
23
|
if (typeof (tokens[6]) != 'undefined') {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
if (tokens[5].indexOf('/') > 0) {
|
|
25
|
+
this.resource_type = tokens[5].slice(0, tokens[5].indexOf('/'));
|
|
26
|
+
this.resource = tokens[5].slice(tokens[5].indexOf('/') + 1, tokens[5].length);
|
|
27
|
+
this.resource_revision = tokens[6]
|
|
28
|
+
this.hasPath = true;
|
|
29
|
+
}
|
|
30
|
+
else{
|
|
31
|
+
this.resource_type = tokens[5];
|
|
32
|
+
this.resource = tokens[6];
|
|
33
|
+
this.hasPath = false;
|
|
34
|
+
}
|
|
26
35
|
}
|
|
27
36
|
|
|
28
37
|
// ...:resource-type/resource-id (resource-id can contain slashes!)
|
|
@@ -51,7 +60,12 @@ class ARN {
|
|
|
51
60
|
if (!this.resource_type) {
|
|
52
61
|
return `${this.prefix}:${this.partition}:${this.service}:${this.region}:${this.account}:${this.resource}`;
|
|
53
62
|
} else if (this.hasPath) {
|
|
54
|
-
|
|
63
|
+
if (this.resource_revision != '') {
|
|
64
|
+
return `${this.prefix}:${this.partition}:${this.service}:${this.region}:${this.account}:${this.resource_type}/${this.resource}:${this.resource_revision}`
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return `${this.prefix}:${this.partition}:${this.service}:${this.region}:${this.account}:${this.resource_type}/${this.resource}`
|
|
68
|
+
}
|
|
55
69
|
} else {
|
|
56
70
|
return `${this.prefix}:${this.partition}:${this.service}:${this.region}:${this.account}:${this.resource_type}:${this.resource}`
|
|
57
71
|
}
|
|
@@ -126,7 +140,16 @@ class ARN {
|
|
|
126
140
|
"certificate-authority": null,
|
|
127
141
|
},
|
|
128
142
|
"amplify": { // AWS Amplify
|
|
129
|
-
"apps":
|
|
143
|
+
"apps": () => {
|
|
144
|
+
if(this.resource.includes('/jobs/')) {
|
|
145
|
+
const resourceSplit = this.resource.split('/');
|
|
146
|
+
const appID = resourceSplit[0];
|
|
147
|
+
const branch = resourceSplit[2];
|
|
148
|
+
const job = resourceSplit[resourceSplit.length - 1].replace(/^0+/, '');
|
|
149
|
+
return `https://${this.region}.${this.console}/amplify/home?region=${this.region}#/${appID}/${branch}/${job}`;
|
|
150
|
+
}
|
|
151
|
+
return null;
|
|
152
|
+
},
|
|
130
153
|
},
|
|
131
154
|
"apigateway": { // Manage Amazon API Gateway
|
|
132
155
|
"": null,
|
|
@@ -251,6 +274,7 @@ class ARN {
|
|
|
251
274
|
"association": null,
|
|
252
275
|
},
|
|
253
276
|
"codepipeline": { // AWS CodePipeline
|
|
277
|
+
"": () => `https://${this.region}.${this.console}/codesuite/codepipeline/pipelines/${this.resource}/view?region=${this.region}`,
|
|
254
278
|
"actiontype": null,
|
|
255
279
|
"webhook": null,
|
|
256
280
|
},
|
|
@@ -421,7 +445,7 @@ class ARN {
|
|
|
421
445
|
"container-instance": null,
|
|
422
446
|
"service": () => `https://${this.region}.${this.console}/ecs/home?region=${this.region}#/clusters/${this.pathAllButLast}/services/${this.pathLast}/details`,
|
|
423
447
|
"task": () => `https://${this.region}.${this.console}/ecs/home?region=${this.region}#/clusters/${this.pathAllButLast}/tasks/${this.pathLast}`,
|
|
424
|
-
"task-definition":
|
|
448
|
+
"task-definition": () => `https://${this.region}.${this.console}/ecs/v2/task-definitions/${this.resource}/${this.resource_revision}?region=${this.region}`,
|
|
425
449
|
"task-set": null,
|
|
426
450
|
},
|
|
427
451
|
"eks": { // Amazon Elastic Container Service for Kubernetes
|