@gradientedge/cdk-utils 9.19.0 → 9.20.0
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.
|
@@ -16,11 +16,15 @@ class ResourceNameFormatter extends constructs_1.Construct {
|
|
|
16
16
|
*/
|
|
17
17
|
format(resourceName, options) {
|
|
18
18
|
const resourceNameElements = [];
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
if (!options?.exclude) {
|
|
20
|
+
resourceNameElements.push(options?.globalPrefix ? this.props.globalPrefix : undefined);
|
|
21
|
+
resourceNameElements.push(options?.prefix ?? this.props.resourcePrefix);
|
|
22
|
+
}
|
|
21
23
|
resourceNameElements.push(resourceName);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
if (!options?.exclude) {
|
|
25
|
+
resourceNameElements.push(options?.suffix ?? this.props.resourceSuffix);
|
|
26
|
+
resourceNameElements.push(options?.globalSuffix ? this.props.globalSuffix : undefined);
|
|
27
|
+
}
|
|
24
28
|
resourceNameElements.push(this.props.stage);
|
|
25
29
|
return resourceNameElements.filter(resourceNameElement => resourceNameElement != undefined).join('-');
|
|
26
30
|
}
|
package/package.json
CHANGED
|
@@ -17,11 +17,15 @@ export class ResourceNameFormatter extends Construct {
|
|
|
17
17
|
*/
|
|
18
18
|
public format(resourceName: string, options?: ResourceNameFormatterProps) {
|
|
19
19
|
const resourceNameElements = []
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
if (!options?.exclude) {
|
|
21
|
+
resourceNameElements.push(options?.globalPrefix ? this.props.globalPrefix : undefined)
|
|
22
|
+
resourceNameElements.push(options?.prefix ?? this.props.resourcePrefix)
|
|
23
|
+
}
|
|
22
24
|
resourceNameElements.push(resourceName)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
if (!options?.exclude) {
|
|
26
|
+
resourceNameElements.push(options?.suffix ?? this.props.resourceSuffix)
|
|
27
|
+
resourceNameElements.push(options?.globalSuffix ? this.props.globalSuffix : undefined)
|
|
28
|
+
}
|
|
25
29
|
resourceNameElements.push(this.props.stage)
|
|
26
30
|
return resourceNameElements.filter(resourceNameElement => resourceNameElement != undefined).join('-')
|
|
27
31
|
}
|