@gradientedge/cdk-utils 9.12.0 → 9.14.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.
- package/dist/src/lib/aws/common/resource-name-formatter.js +2 -0
- package/dist/src/lib/aws/common/stack.d.ts +3 -0
- package/dist/src/lib/aws/common/stack.js +3 -0
- package/dist/src/lib/aws/common/types.d.ts +7 -0
- package/dist/src/lib/aws/construct/api-to-any-target/main.js +2 -2
- package/dist/src/lib/aws/construct/api-to-eventbridge-target/main.js +3 -3
- package/dist/src/lib/aws/construct/api-to-eventbridge-target-with-sns/main.js +4 -4
- package/dist/src/lib/aws/construct/api-to-lambda-target/main.js +1 -1
- package/dist/src/lib/aws/construct/rest-api-lambda-with-cache/main.js +1 -1
- package/dist/src/lib/aws/construct/site-with-ecs-backend/main.js +2 -2
- package/dist/src/lib/aws/services/api-gateway/main.js +1 -1
- package/dist/src/lib/aws/services/api-gateway/types.d.ts +0 -3
- package/dist/src/lib/aws/services/appconfig/main.js +2 -2
- package/dist/src/lib/aws/services/appconfig/types.d.ts +0 -2
- package/dist/src/lib/aws/services/cloudfront/main.js +2 -2
- package/dist/src/lib/aws/services/cloudfront/types.d.ts +0 -2
- package/dist/src/lib/aws/services/cloudtrail/main.js +1 -1
- package/dist/src/lib/aws/services/cloudtrail/types.d.ts +0 -2
- package/dist/src/lib/aws/services/cloudwatch/logs.js +6 -2
- package/dist/src/lib/aws/services/cloudwatch/main.js +3 -0
- package/dist/src/lib/aws/services/codebuild/main.js +1 -1
- package/dist/src/lib/aws/services/dynamodb/main.js +9 -2
- package/dist/src/lib/aws/services/dynamodb/types.d.ts +1 -2
- package/dist/src/lib/aws/services/elastic-container-service/main.js +2 -2
- package/dist/src/lib/aws/services/elastic-container-service/types.d.ts +0 -2
- package/dist/src/lib/aws/services/elastic-file-system/main.js +1 -1
- package/dist/src/lib/aws/services/elastic-file-system/types.d.ts +0 -2
- package/dist/src/lib/aws/services/elastic-kubernetes-service/main.js +1 -1
- package/dist/src/lib/aws/services/elastic-kubernetes-service/types.d.ts +0 -2
- package/dist/src/lib/aws/services/elasticache/main.js +1 -1
- package/dist/src/lib/aws/services/elasticache/types.d.ts +0 -2
- package/dist/src/lib/aws/services/eventbridge/main.js +9 -9
- package/dist/src/lib/aws/services/eventbridge/types.d.ts +0 -7
- package/dist/src/lib/aws/services/evidently/main.js +4 -4
- package/dist/src/lib/aws/services/evidently/types.d.ts +0 -5
- package/dist/src/lib/aws/services/identity-access-management/main.d.ts +20 -20
- package/dist/src/lib/aws/services/identity-access-management/main.js +71 -70
- package/dist/src/lib/aws/services/key-management-service/main.js +3 -1
- package/dist/src/lib/aws/services/lambda/main.js +7 -8
- package/dist/src/lib/aws/services/lambda/types.d.ts +0 -3
- package/dist/src/lib/aws/services/secrets-manager/main.js +1 -1
- package/dist/src/lib/aws/services/secrets-manager/types.d.ts +0 -2
- package/dist/src/lib/aws/services/simple-notification-service/main.js +4 -4
- package/dist/src/lib/aws/services/simple-notification-service/types.d.ts +0 -2
- package/dist/src/lib/aws/services/simple-queue-service/main.js +1 -1
- package/dist/src/lib/aws/services/simple-queue-service/types.d.ts +0 -2
- package/dist/src/lib/aws/services/simple-storage-service/main.js +2 -3
- package/dist/src/lib/aws/services/simple-storage-service/types.d.ts +0 -2
- package/dist/src/lib/aws/services/step-function/main.js +1 -1
- package/dist/src/lib/aws/services/step-function/types.d.ts +0 -2
- package/dist/src/lib/aws/services/systems-manager/main.d.ts +3 -3
- package/dist/src/lib/aws/services/systems-manager/main.js +3 -1
- package/dist/src/lib/aws/services/systems-manager/types.d.ts +3 -0
- package/dist/src/lib/aws/services/virtual-private-cloud/main.d.ts +2 -1
- package/dist/src/lib/aws/services/virtual-private-cloud/main.js +9 -6
- package/dist/src/lib/aws/services/virtual-private-cloud/types.d.ts +0 -2
- package/dist/src/lib/aws/services/web-application-firewall/main.js +2 -2
- package/dist/src/lib/aws/services/web-application-firewall/types.d.ts +0 -3
- package/package.json +6 -6
- package/src/lib/aws/common/resource-name-formatter.ts +2 -0
- package/src/lib/aws/common/stack.ts +3 -0
- package/src/lib/aws/common/types.ts +5 -0
- package/src/lib/aws/construct/api-to-any-target/main.ts +2 -2
- package/src/lib/aws/construct/api-to-eventbridge-target/main.ts +3 -3
- package/src/lib/aws/construct/api-to-eventbridge-target-with-sns/main.ts +4 -4
- package/src/lib/aws/construct/api-to-lambda-target/main.ts +1 -1
- package/src/lib/aws/construct/rest-api-lambda-with-cache/main.ts +6 -1
- package/src/lib/aws/construct/site-with-ecs-backend/main.ts +7 -2
- package/src/lib/aws/services/api-gateway/main.ts +1 -1
- package/src/lib/aws/services/api-gateway/types.ts +1 -4
- package/src/lib/aws/services/appconfig/main.ts +5 -2
- package/src/lib/aws/services/appconfig/types.ts +0 -1
- package/src/lib/aws/services/cloudfront/main.ts +2 -2
- package/src/lib/aws/services/cloudfront/types.ts +0 -1
- package/src/lib/aws/services/cloudtrail/main.ts +1 -1
- package/src/lib/aws/services/cloudtrail/types.ts +1 -3
- package/src/lib/aws/services/cloudwatch/logs.ts +4 -2
- package/src/lib/aws/services/cloudwatch/main.ts +5 -0
- package/src/lib/aws/services/codebuild/main.ts +1 -1
- package/src/lib/aws/services/dynamodb/main.ts +9 -2
- package/src/lib/aws/services/dynamodb/types.ts +1 -1
- package/src/lib/aws/services/elastic-container-service/main.ts +5 -2
- package/src/lib/aws/services/elastic-container-service/types.ts +0 -1
- package/src/lib/aws/services/elastic-file-system/main.ts +1 -1
- package/src/lib/aws/services/elastic-file-system/types.ts +0 -1
- package/src/lib/aws/services/elastic-kubernetes-service/main.ts +1 -1
- package/src/lib/aws/services/elastic-kubernetes-service/types.ts +0 -1
- package/src/lib/aws/services/elasticache/main.ts +1 -1
- package/src/lib/aws/services/elasticache/types.ts +1 -3
- package/src/lib/aws/services/eventbridge/main.ts +12 -9
- package/src/lib/aws/services/eventbridge/types.ts +1 -8
- package/src/lib/aws/services/evidently/main.ts +4 -4
- package/src/lib/aws/services/evidently/types.ts +4 -12
- package/src/lib/aws/services/identity-access-management/main.ts +80 -79
- package/src/lib/aws/services/key-management-service/main.ts +2 -1
- package/src/lib/aws/services/key-management-service/types.ts +1 -0
- package/src/lib/aws/services/lambda/main.ts +13 -7
- package/src/lib/aws/services/lambda/types.ts +0 -2
- package/src/lib/aws/services/secrets-manager/main.ts +1 -1
- package/src/lib/aws/services/secrets-manager/types.ts +1 -3
- package/src/lib/aws/services/simple-notification-service/main.ts +4 -4
- package/src/lib/aws/services/simple-notification-service/types.ts +1 -3
- package/src/lib/aws/services/simple-queue-service/main.ts +1 -1
- package/src/lib/aws/services/simple-queue-service/types.ts +0 -1
- package/src/lib/aws/services/simple-storage-service/main.ts +6 -3
- package/src/lib/aws/services/simple-storage-service/types.ts +0 -1
- package/src/lib/aws/services/step-function/main.ts +4 -1
- package/src/lib/aws/services/step-function/types.ts +1 -3
- package/src/lib/aws/services/systems-manager/main.ts +5 -4
- package/src/lib/aws/services/systems-manager/types.ts +5 -0
- package/src/lib/aws/services/virtual-private-cloud/main.ts +12 -6
- package/src/lib/aws/services/virtual-private-cloud/types.ts +0 -1
- package/src/lib/aws/services/web-application-firewall/main.ts +2 -2
- package/src/lib/aws/services/web-application-firewall/types.ts +2 -6
|
@@ -16,9 +16,11 @@ class ResourceNameFormatter extends constructs_1.Construct {
|
|
|
16
16
|
*/
|
|
17
17
|
format(resourceName, options) {
|
|
18
18
|
const resourceNameElements = [];
|
|
19
|
+
resourceNameElements.push(options?.globalPrefix ? this.props.globalPrefix : undefined);
|
|
19
20
|
resourceNameElements.push(options?.prefix ?? this.props.resourcePrefix);
|
|
20
21
|
resourceNameElements.push(resourceName);
|
|
21
22
|
resourceNameElements.push(options?.suffix ?? this.props.resourceSuffix);
|
|
23
|
+
resourceNameElements.push(options?.globalSuffix ? this.props.globalSuffix : undefined);
|
|
22
24
|
resourceNameElements.push(this.props.stage);
|
|
23
25
|
return resourceNameElements.filter(resourceNameElement => resourceNameElement != undefined).join('-');
|
|
24
26
|
}
|
|
@@ -53,6 +53,9 @@ class CommonStack extends aws_cdk_lib_1.Stack {
|
|
|
53
53
|
name: props.stackName || 'cdk-utils',
|
|
54
54
|
nodejsRuntime: this.node.tryGetContext('nodejsRuntime') ?? CommonStack.NODEJS_RUNTIME,
|
|
55
55
|
region: this.node.tryGetContext('region'),
|
|
56
|
+
globalPrefix: this.node.tryGetContext('globalPrefix'),
|
|
57
|
+
globalSuffix: this.node.tryGetContext('globalSuffix'),
|
|
58
|
+
resourceNameOptions: this.node.tryGetContext('resourceNameOptions'),
|
|
56
59
|
resourcePrefix: this.node.tryGetContext('resourcePrefix'),
|
|
57
60
|
resourceSuffix: this.node.tryGetContext('resourceSuffix'),
|
|
58
61
|
skipStageForARecords: this.node.tryGetContext('skipStageForARecords'),
|
|
@@ -7,6 +7,8 @@ import { BaseProps } from '../../common';
|
|
|
7
7
|
export interface CommonStackProps extends BaseProps, StackProps {
|
|
8
8
|
region: string;
|
|
9
9
|
resourceProjectIdentifier?: string;
|
|
10
|
+
globalPrefix?: string;
|
|
11
|
+
globalSuffix?: string;
|
|
10
12
|
resourcePrefix?: string;
|
|
11
13
|
resourceSuffix?: string;
|
|
12
14
|
logRetention?: RetentionDays;
|
|
@@ -15,8 +17,13 @@ export interface CommonStackProps extends BaseProps, StackProps {
|
|
|
15
17
|
excludeDomainNameForBuckets?: boolean;
|
|
16
18
|
excludeAccountNumberForBuckets?: boolean;
|
|
17
19
|
nodejsRuntime?: Runtime;
|
|
20
|
+
resourceNameOptions?: {
|
|
21
|
+
[key: string]: ResourceNameFormatterProps;
|
|
22
|
+
};
|
|
18
23
|
}
|
|
19
24
|
export interface ResourceNameFormatterProps {
|
|
25
|
+
globalPrefix?: boolean;
|
|
26
|
+
globalSuffix?: boolean;
|
|
20
27
|
prefix?: string;
|
|
21
28
|
suffix?: string;
|
|
22
29
|
}
|
|
@@ -75,7 +75,7 @@ class ApiToAnyTarget extends common_1.CommonConstruct {
|
|
|
75
75
|
}
|
|
76
76
|
createApiToAnyTargetRestApiLogGroup() {
|
|
77
77
|
this.apiToAnyTargetRestApi.accessLogGroup = this.logManager.createLogGroup(`${this.id}-rest-api-access-log`, this, {
|
|
78
|
-
logGroupName:
|
|
78
|
+
logGroupName: `${this.id}-access`,
|
|
79
79
|
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -112,7 +112,7 @@ class ApiToAnyTarget extends common_1.CommonConstruct {
|
|
|
112
112
|
types: [this.isProductionStage() ? aws_apigateway_1.EndpointType.EDGE : aws_apigateway_1.EndpointType.REGIONAL],
|
|
113
113
|
},
|
|
114
114
|
...this.props.api.restApi,
|
|
115
|
-
restApiName: this.resourceNameFormatter.format(this.props.api.restApi?.restApiName, this.props.
|
|
115
|
+
restApiName: this.resourceNameFormatter.format(this.props.api.restApi?.restApiName, this.props.resourceNameOptions?.apigateway),
|
|
116
116
|
});
|
|
117
117
|
this.addCfnOutput(`${this.id}-restApiId`, this.apiToAnyTargetRestApi.api.restApiId);
|
|
118
118
|
this.addCfnOutput(`${this.id}-restApiRootResourceId`, this.apiToAnyTargetRestApi.api.root.resourceId);
|
|
@@ -121,7 +121,7 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
121
121
|
return;
|
|
122
122
|
this.apiEvent.logGroup = this.logManager.createLogGroup(`${this.id}-log`, this, {
|
|
123
123
|
...{
|
|
124
|
-
logGroupName:
|
|
124
|
+
logGroupName: `${this.id}-api-to-event-bridge-target`,
|
|
125
125
|
},
|
|
126
126
|
...this.props.event.logGroup,
|
|
127
127
|
});
|
|
@@ -290,7 +290,7 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
290
290
|
}
|
|
291
291
|
createApiToEventBridgeTargetRestApiLogGroup() {
|
|
292
292
|
this.apiToEventBridgeTargetRestApi.accessLogGroup = this.logManager.createLogGroup(`${this.id}-rest-api-access-log`, this, {
|
|
293
|
-
logGroupName:
|
|
293
|
+
logGroupName: `${this.id}-access`,
|
|
294
294
|
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
295
295
|
});
|
|
296
296
|
}
|
|
@@ -333,7 +333,7 @@ class ApiToEventBridgeTarget extends common_1.CommonConstruct {
|
|
|
333
333
|
types: [aws_apigateway_1.EndpointType.REGIONAL],
|
|
334
334
|
},
|
|
335
335
|
...this.props.api.restApi,
|
|
336
|
-
restApiName: this.resourceNameFormatter.format(this.props.api.restApi?.restApiName, this.props.
|
|
336
|
+
restApiName: this.resourceNameFormatter.format(this.props.api.restApi?.restApiName, this.props.resourceNameOptions?.apigateway),
|
|
337
337
|
});
|
|
338
338
|
this.addCfnOutput(`${this.id}-restApiId`, this.apiToEventBridgeTargetRestApi.api.restApiId);
|
|
339
339
|
this.addCfnOutput(`${this.id}-restApiRootResourceId`, this.apiToEventBridgeTargetRestApi.api.root.resourceId);
|
|
@@ -199,7 +199,7 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
199
199
|
if (this.props.api.useExisting)
|
|
200
200
|
return;
|
|
201
201
|
this.apiEvent.logGroupSuccess = this.logManager.createLogGroup(`${this.id}-destination-success-log`, this, {
|
|
202
|
-
logGroupName:
|
|
202
|
+
logGroupName: `${this.id}-destination`,
|
|
203
203
|
...this.props.event.logGroupSuccess,
|
|
204
204
|
});
|
|
205
205
|
}
|
|
@@ -233,7 +233,7 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
233
233
|
if (this.props.api.useExisting)
|
|
234
234
|
return;
|
|
235
235
|
this.apiEvent.logGroupFailure = this.logManager.createLogGroup(`${this.id}-destination-failure-log`, this, {
|
|
236
|
-
logGroupName:
|
|
236
|
+
logGroupName: `${this.id}-destination-failure`,
|
|
237
237
|
...this.props.event.logGroupFailure,
|
|
238
238
|
});
|
|
239
239
|
}
|
|
@@ -410,7 +410,7 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
412
412
|
const accessLogGroup = this.logManager.createLogGroup(`${this.id}-sns-rest-api-access-log`, this, {
|
|
413
|
-
logGroupName:
|
|
413
|
+
logGroupName: `${this.id}-access`,
|
|
414
414
|
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
415
415
|
});
|
|
416
416
|
if (!this.props.api.restApi?.restApiName)
|
|
@@ -438,7 +438,7 @@ class ApiToEventBridgeTargetWithSns extends common_1.CommonConstruct {
|
|
|
438
438
|
types: [aws_apigateway_1.EndpointType.REGIONAL],
|
|
439
439
|
},
|
|
440
440
|
...this.props.api,
|
|
441
|
-
restApiName: this.resourceNameFormatter.format(this.props.api.restApi?.restApiName, this.props.
|
|
441
|
+
restApiName: this.resourceNameFormatter.format(this.props.api.restApi?.restApiName, this.props.resourceNameOptions?.apigateway),
|
|
442
442
|
});
|
|
443
443
|
this.addCfnOutput(`${this.id}-restApiId`, this.apiDestinedRestApi.api.restApiId);
|
|
444
444
|
this.addCfnOutput(`${this.id}-restApiRootResourceId`, this.apiDestinedRestApi.api.root.resourceId);
|
|
@@ -114,7 +114,7 @@ class ApiToLambdaTarget extends common_1.CommonConstruct {
|
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
const accessLogGroup = this.logManager.createLogGroup(`${this.id}-rest-api-access-log`, this, {
|
|
117
|
-
logGroupName:
|
|
117
|
+
logGroupName: `${this.id}-access`,
|
|
118
118
|
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
119
119
|
});
|
|
120
120
|
this.props.api.restApi = {
|
|
@@ -55,7 +55,7 @@ class RestApiLambdaWithCache extends __1.RestApiLambda {
|
|
|
55
55
|
this.restApivpc = this.vpcManager.retrieveCommonVpc(`${this.id}-vpc`, this, this.props.vpcName);
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
|
-
this.restApivpc = this.vpcManager.createCommonVpc(this, this.props.restApiVpc, this.props.restApiVpc.vpcName);
|
|
58
|
+
this.restApivpc = this.vpcManager.createCommonVpc(`${this.id}-vpc`, this, this.props.restApiVpc, this.props.restApiVpc.vpcName);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
@@ -149,10 +149,10 @@ class SiteWithEcsBackend extends common_1.CommonConstruct {
|
|
|
149
149
|
*/
|
|
150
150
|
createVpc() {
|
|
151
151
|
if (this.props.useExistingVpc) {
|
|
152
|
-
this.siteVpc = this.vpcManager.retrieveCommonVpc(`${this.id}`, this, this.props.siteVpc.vpcName);
|
|
152
|
+
this.siteVpc = this.vpcManager.retrieveCommonVpc(`${this.id}-vpc`, this, this.props.siteVpc.vpcName);
|
|
153
153
|
}
|
|
154
154
|
else {
|
|
155
|
-
this.siteVpc = this.vpcManager.createCommonVpc(this, this.props.siteVpc, this.props.siteVpc.vpcName);
|
|
155
|
+
this.siteVpc = this.vpcManager.createCommonVpc(`${this.id}-vpc`, this, this.props.siteVpc, this.props.siteVpc.vpcName);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
/**
|
|
@@ -55,7 +55,7 @@ class ApiManager {
|
|
|
55
55
|
handler: lambdaFunction,
|
|
56
56
|
minCompressionSize: props.minCompressionSizeInBytes ? aws_cdk_lib_1.Size.bytes(props.minCompressionSizeInBytes) : undefined,
|
|
57
57
|
proxy: props.proxy ?? true,
|
|
58
|
-
restApiName: scope.resourceNameFormatter.format(props.restApiName, props.resourceNameOptions),
|
|
58
|
+
restApiName: scope.resourceNameFormatter.format(props.restApiName, scope.props.resourceNameOptions?.apigateway),
|
|
59
59
|
});
|
|
60
60
|
if (props.tags && !lodash_1.default.isEmpty(props.tags)) {
|
|
61
61
|
lodash_1.default.forEach(props.tags, tag => {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { LambdaRestApiProps as LambdaRestApigProps, RestApiProps } from 'aws-cdk-lib/aws-apigateway';
|
|
2
|
-
import { ResourceNameFormatterProps } from '../../common';
|
|
3
2
|
import { TagProps } from '../../types';
|
|
4
3
|
/**
|
|
5
4
|
*/
|
|
6
5
|
export interface LambdaRestApiProps extends LambdaRestApigProps {
|
|
7
6
|
tags?: TagProps[];
|
|
8
7
|
minCompressionSizeInBytes?: number;
|
|
9
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
10
8
|
}
|
|
11
9
|
export interface RestApigProps extends RestApiProps {
|
|
12
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
13
10
|
}
|
|
@@ -50,7 +50,7 @@ class AppConfigManager {
|
|
|
50
50
|
throw `AppConfig props undefined for ${id}`;
|
|
51
51
|
const application = new aws_appconfig_1.CfnApplication(scope, `${id}`, {
|
|
52
52
|
...props.application,
|
|
53
|
-
name: scope.resourceNameFormatter.format(props.application.name, props.resourceNameOptions),
|
|
53
|
+
name: scope.resourceNameFormatter.format(props.application.name, scope.props.resourceNameOptions?.appconfig),
|
|
54
54
|
});
|
|
55
55
|
(0, utils_1.createCfnOutput)(`${id}-ApplicationId`, scope, aws_cdk_lib_1.Fn.ref(application.logicalId));
|
|
56
56
|
(0, utils_1.createCfnOutput)(`${id}-ApplicationName`, scope, application.name);
|
|
@@ -92,7 +92,7 @@ class AppConfigManager {
|
|
|
92
92
|
...props.configurationProfile,
|
|
93
93
|
applicationId,
|
|
94
94
|
locationUri: props.configurationProfile.locationUri || 'hosted',
|
|
95
|
-
name: scope.resourceNameFormatter.format(props.configurationProfile.name, props.resourceNameOptions),
|
|
95
|
+
name: scope.resourceNameFormatter.format(props.configurationProfile.name, scope.props.resourceNameOptions?.appconfig),
|
|
96
96
|
});
|
|
97
97
|
(0, utils_1.createCfnOutput)(`${id}-configurationProfileId`, scope, aws_cdk_lib_1.Fn.ref(profile.logicalId));
|
|
98
98
|
(0, utils_1.createCfnOutput)(`${id}-configurationProfileName`, scope, profile.name);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CfnApplicationProps, CfnConfigurationProfileProps, CfnDeploymentProps, CfnDeploymentStrategyProps, CfnEnvironmentProps } from 'aws-cdk-lib/aws-appconfig';
|
|
2
|
-
import { ResourceNameFormatterProps } from '../../common';
|
|
3
2
|
/**
|
|
4
3
|
*/
|
|
5
4
|
export interface AppConfigProps {
|
|
@@ -9,5 +8,4 @@ export interface AppConfigProps {
|
|
|
9
8
|
deploymentStrategy: CfnDeploymentStrategyProps;
|
|
10
9
|
environment: CfnEnvironmentProps;
|
|
11
10
|
id: string;
|
|
12
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
13
11
|
}
|
|
@@ -237,7 +237,7 @@ class CloudFrontManager {
|
|
|
237
237
|
...environment,
|
|
238
238
|
},
|
|
239
239
|
filesystem: accessPoint ? aws_lambda_1.FileSystem.fromEfsAccessPoint(accessPoint, mountPath ?? '/mnt/msg') : undefined,
|
|
240
|
-
functionName: scope.resourceNameFormatter.format(props.functionName, props.resourceNameOptions),
|
|
240
|
+
functionName: scope.resourceNameFormatter.format(props.functionName, scope.props.resourceNameOptions?.cloudfront),
|
|
241
241
|
handler: props.handler ?? 'index.handler',
|
|
242
242
|
layers: layers,
|
|
243
243
|
logRetention: props.logRetention,
|
|
@@ -297,7 +297,7 @@ class CloudFrontManager {
|
|
|
297
297
|
filePath: props.functionFilePath,
|
|
298
298
|
}),
|
|
299
299
|
comment: props.comment,
|
|
300
|
-
functionName: scope.resourceNameFormatter.format(props.functionName, props.resourceNameOptions),
|
|
300
|
+
functionName: scope.resourceNameFormatter.format(props.functionName, scope.props.resourceNameOptions?.cloudfront),
|
|
301
301
|
});
|
|
302
302
|
(0, utils_1.createCfnOutput)(`${id}-functionArn`, scope, cloudfrontFunction.functionArn);
|
|
303
303
|
(0, utils_1.createCfnOutput)(`${id}-functionName`, scope, cloudfrontFunction.functionName);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DistributionProps as CfDistributionProps, CloudFrontWebDistributionProps, FunctionProps } from 'aws-cdk-lib/aws-cloudfront';
|
|
2
|
-
import { ResourceNameFormatterProps } from '../../common';
|
|
3
2
|
import { TagProps } from '../../types';
|
|
4
3
|
/**
|
|
5
4
|
*/
|
|
@@ -16,5 +15,4 @@ export interface DistributionProps extends CfDistributionProps {
|
|
|
16
15
|
export interface CloudfrontFunctionProps extends FunctionProps {
|
|
17
16
|
eventType: string;
|
|
18
17
|
functionFilePath: string;
|
|
19
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
20
18
|
}
|
|
@@ -62,7 +62,7 @@ class CloudTrailManager {
|
|
|
62
62
|
s3BucketName: logBucket.bucketName,
|
|
63
63
|
s3KeyPrefix: `logs-${props.trailName}`,
|
|
64
64
|
tags: [{ key: 'service', value: scope.props.name }],
|
|
65
|
-
trailName: scope.resourceNameFormatter.format(props.trailName, props.resourceNameOptions),
|
|
65
|
+
trailName: scope.resourceNameFormatter.format(props.trailName, scope.props.resourceNameOptions?.cloudtrail),
|
|
66
66
|
});
|
|
67
67
|
cloudTrail.addDependency(logBucketPolicy);
|
|
68
68
|
cloudTrail.addDependency(logGroup);
|
|
@@ -84,9 +84,11 @@ class LogManager {
|
|
|
84
84
|
createCfnLogGroup(id, scope, props) {
|
|
85
85
|
if (!props)
|
|
86
86
|
throw `Logs props undefined for ${id}`;
|
|
87
|
+
if (!props.logGroupName)
|
|
88
|
+
throw `Logs logGroupName undefined for ${id}`;
|
|
87
89
|
const logGroup = new logs.CfnLogGroup(scope, `${id}`, {
|
|
88
90
|
...props,
|
|
89
|
-
logGroupName:
|
|
91
|
+
logGroupName: `/${scope.resourceNameFormatter.format(props.logGroupName, scope.props.resourceNameOptions?.logs)}`,
|
|
90
92
|
retentionInDays: props.retention,
|
|
91
93
|
});
|
|
92
94
|
if (props.tags && !lodash_1.default.isEmpty(props.tags)) {
|
|
@@ -106,9 +108,11 @@ class LogManager {
|
|
|
106
108
|
createLogGroup(id, scope, props) {
|
|
107
109
|
if (!props)
|
|
108
110
|
throw `Logs props undefined for ${id}`;
|
|
111
|
+
if (!props.logGroupName)
|
|
112
|
+
throw `Logs logGroupName undefined for ${id}`;
|
|
109
113
|
const logGroup = new logs.LogGroup(scope, `${id}`, {
|
|
110
114
|
...props,
|
|
111
|
-
logGroupName:
|
|
115
|
+
logGroupName: `/${scope.resourceNameFormatter.format(props.logGroupName, scope.props.resourceNameOptions?.logs)}`,
|
|
112
116
|
removalPolicy: props.removalPolicy ?? cdk.RemovalPolicy.DESTROY,
|
|
113
117
|
retention: props.retention,
|
|
114
118
|
});
|
|
@@ -116,8 +116,11 @@ class CloudWatchManager {
|
|
|
116
116
|
createDashboard(id, scope, props, widgets) {
|
|
117
117
|
if (!props)
|
|
118
118
|
throw `Dashboard props undefined for ${id}`;
|
|
119
|
+
if (!props.dashboardName)
|
|
120
|
+
throw `Dashboard dashboardName undefined for ${id}`;
|
|
119
121
|
const dashboard = new watch.Dashboard(scope, `${id}`, {
|
|
120
122
|
...props,
|
|
123
|
+
dashboardName: scope.resourceNameFormatter.format(props.dashboardName, scope.props.resourceNameOptions?.cloudwatch),
|
|
121
124
|
end: CloudWatchManager.determineTimeRange(props.end),
|
|
122
125
|
start: CloudWatchManager.determineTimeRange(props.start),
|
|
123
126
|
widgets,
|
|
@@ -34,9 +34,11 @@ class DynamodbManager {
|
|
|
34
34
|
createTable(id, scope, props) {
|
|
35
35
|
if (!props)
|
|
36
36
|
throw `Table props undefined for ${id}`;
|
|
37
|
+
if (!props.tableName)
|
|
38
|
+
throw `Table tableName undefined for ${id}`;
|
|
37
39
|
const table = new aws_dynamodb_1.Table(scope, `${id}`, {
|
|
38
40
|
...props,
|
|
39
|
-
tableName:
|
|
41
|
+
tableName: scope.resourceNameFormatter.format(props.tableName, scope.props.resourceNameOptions?.table),
|
|
40
42
|
});
|
|
41
43
|
if (props.tags && !lodash_1.default.isEmpty(props.tags)) {
|
|
42
44
|
lodash_1.default.forEach(props.tags, tag => {
|
|
@@ -60,8 +62,13 @@ class DynamodbManager {
|
|
|
60
62
|
throw `Table tableName undefined for ${id}`;
|
|
61
63
|
const table = new aws_dynamodb_1.TableV2(scope, `${id}`, {
|
|
62
64
|
...props,
|
|
63
|
-
tableName: scope.resourceNameFormatter.format(props.tableName, props.resourceNameOptions),
|
|
65
|
+
tableName: scope.resourceNameFormatter.format(props.tableName, scope.props.resourceNameOptions?.table),
|
|
64
66
|
});
|
|
67
|
+
if (props.tags && !lodash_1.default.isEmpty(props.tags)) {
|
|
68
|
+
lodash_1.default.forEach(props.tags, tag => {
|
|
69
|
+
aws_cdk_lib_1.Tags.of(table).add(tag.key, tag.value);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
65
72
|
(0, utils_1.createCfnOutput)(`${id}-tableName`, scope, table.tableName);
|
|
66
73
|
(0, utils_1.createCfnOutput)(`${id}-tableArn`, scope, table.tableArn);
|
|
67
74
|
return table;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
|
|
2
|
-
import { ResourceNameFormatterProps } from '../../common';
|
|
3
2
|
import { TagProps } from '../../types';
|
|
4
3
|
/**
|
|
5
4
|
*/
|
|
@@ -7,5 +6,5 @@ export interface TableProps extends dynamodb.TableProps {
|
|
|
7
6
|
tags?: TagProps[];
|
|
8
7
|
}
|
|
9
8
|
export interface TablePropsV2 extends dynamodb.TablePropsV2 {
|
|
10
|
-
|
|
9
|
+
tags?: TagProps[];
|
|
11
10
|
}
|
|
@@ -125,12 +125,12 @@ class EcsManager {
|
|
|
125
125
|
cluster,
|
|
126
126
|
enableECSManagedTags: true,
|
|
127
127
|
healthCheckGracePeriod: props.healthCheckGracePeriod ?? aws_cdk_lib_1.Duration.seconds(60),
|
|
128
|
-
loadBalancerName: scope.resourceNameFormatter.format(props.loadBalancerName, props.resourceNameOptions),
|
|
128
|
+
loadBalancerName: scope.resourceNameFormatter.format(props.loadBalancerName, scope.props.resourceNameOptions?.ecs),
|
|
129
129
|
runtimePlatform: {
|
|
130
130
|
cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? aws_ecs_1.CpuArchitecture.X86_64,
|
|
131
131
|
operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? aws_ecs_1.OperatingSystemFamily.LINUX,
|
|
132
132
|
},
|
|
133
|
-
serviceName: scope.resourceNameFormatter.format(props.serviceName, props.resourceNameOptions),
|
|
133
|
+
serviceName: scope.resourceNameFormatter.format(props.serviceName, scope.props.resourceNameOptions?.ecs),
|
|
134
134
|
taskImageOptions: {
|
|
135
135
|
...props.taskImageOptions,
|
|
136
136
|
enableLogging: props.taskImageOptions?.enableLogging ?? true,
|
|
@@ -2,7 +2,6 @@ import { ScalingSchedule } from 'aws-cdk-lib/aws-applicationautoscaling';
|
|
|
2
2
|
import { AwsLogDriverProps, ClusterProps, HealthCheck as FargateHealthCheck, MountPoint, TaskDefinitionProps } from 'aws-cdk-lib/aws-ecs';
|
|
3
3
|
import { ApplicationLoadBalancedFargateServiceProps } from 'aws-cdk-lib/aws-ecs-patterns';
|
|
4
4
|
import { HealthCheck as ElbHealthCheck } from 'aws-cdk-lib/aws-elasticloadbalancingv2';
|
|
5
|
-
import { ResourceNameFormatterProps } from '../../common';
|
|
6
5
|
import { TagProps } from '../../types';
|
|
7
6
|
/**
|
|
8
7
|
*/
|
|
@@ -43,5 +42,4 @@ export interface EcsApplicationLoadBalancedFargateServiceProps extends Applicati
|
|
|
43
42
|
logging?: AwsLogDriverProps;
|
|
44
43
|
mountPoints?: MountPoint[];
|
|
45
44
|
siteScaling?: EcsScalingProps;
|
|
46
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
47
45
|
}
|
|
@@ -52,7 +52,7 @@ class EfsManager {
|
|
|
52
52
|
const fileSystemId = props.provisionNewOnDeployment ? `${id}-${new Date().getMilliseconds()}` : `${id}`;
|
|
53
53
|
const fileSystem = new aws_efs_1.FileSystem(scope, `${fileSystemId}`, {
|
|
54
54
|
...props,
|
|
55
|
-
fileSystemName: scope.resourceNameFormatter.format(props.fileSystemName, props.resourceNameOptions),
|
|
55
|
+
fileSystemName: scope.resourceNameFormatter.format(props.fileSystemName, scope.props.resourceNameOptions?.efs),
|
|
56
56
|
lifecyclePolicy: props.lifecyclePolicy ?? aws_efs_1.LifecyclePolicy.AFTER_7_DAYS,
|
|
57
57
|
outOfInfrequentAccessPolicy: props.outOfInfrequentAccessPolicy ?? aws_efs_1.OutOfInfrequentAccessPolicy.AFTER_1_ACCESS,
|
|
58
58
|
performanceMode: props.performanceMode ?? aws_efs_1.PerformanceMode.GENERAL_PURPOSE,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AuthorizationConfig } from 'aws-cdk-lib/aws-ecs';
|
|
2
2
|
import { AccessPointOptions, FileSystemProps } from 'aws-cdk-lib/aws-efs';
|
|
3
|
-
import { ResourceNameFormatterProps } from '../../common';
|
|
4
3
|
/**
|
|
5
4
|
*/
|
|
6
5
|
export interface EfsFileSystemProps extends FileSystemProps {
|
|
@@ -9,7 +8,6 @@ export interface EfsFileSystemProps extends FileSystemProps {
|
|
|
9
8
|
rootDirectory?: string;
|
|
10
9
|
transitEncryption?: string;
|
|
11
10
|
transitEncryptionPort?: number;
|
|
12
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
13
11
|
}
|
|
14
12
|
/**
|
|
15
13
|
*/
|
|
@@ -73,7 +73,7 @@ class EksManager {
|
|
|
73
73
|
},
|
|
74
74
|
};
|
|
75
75
|
const cluster = new aws_eks_1.Cluster(scope, `${id}Cluster`, {
|
|
76
|
-
clusterName: scope.resourceNameFormatter.format(props.clusterName, props.resourceNameOptions),
|
|
76
|
+
clusterName: scope.resourceNameFormatter.format(props.clusterName, scope.props.resourceNameOptions?.eks),
|
|
77
77
|
defaultCapacity: props.appCapacity,
|
|
78
78
|
defaultCapacityInstance: aws_ec2_1.InstanceType.of(aws_ec2_1.InstanceClass.T3, aws_ec2_1.InstanceSize.LARGE),
|
|
79
79
|
version: aws_eks_1.KubernetesVersion.V1_27,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ClusterProps } from 'aws-cdk-lib/aws-eks';
|
|
2
|
-
import { ResourceNameFormatterProps } from '../../common';
|
|
3
2
|
/**
|
|
4
3
|
*/
|
|
5
4
|
export interface EksClusterProps extends ClusterProps {
|
|
6
5
|
appCapacity: number;
|
|
7
6
|
appContainerPort: number;
|
|
8
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
9
7
|
}
|
|
@@ -56,7 +56,7 @@ class ElastiCacheManager {
|
|
|
56
56
|
const elasticacheCluster = new aws_elasticache_1.CfnCacheCluster(scope, `${id}`, {
|
|
57
57
|
...props,
|
|
58
58
|
cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
|
|
59
|
-
clusterName: scope.resourceNameFormatter.format(props.clusterName, props.resourceNameOptions),
|
|
59
|
+
clusterName: scope.resourceNameFormatter.format(props.clusterName, scope.props.resourceNameOptions?.elasticache),
|
|
60
60
|
logDeliveryConfigurations,
|
|
61
61
|
vpcSecurityGroupIds: securityGroupIds,
|
|
62
62
|
});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { CfnCacheClusterProps, CfnReplicationGroupProps } from 'aws-cdk-lib/aws-elasticache';
|
|
2
|
-
import { ResourceNameFormatterProps } from '../../common';
|
|
3
2
|
/**
|
|
4
3
|
*/
|
|
5
4
|
export interface ElastiCacheProps extends CfnCacheClusterProps {
|
|
6
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
7
5
|
}
|
|
8
6
|
/**
|
|
9
7
|
*/
|
|
@@ -41,7 +41,7 @@ class EventManager {
|
|
|
41
41
|
throw `EventBus eventBusName undefined for ${id}`;
|
|
42
42
|
let eventBusName = props.eventBusName;
|
|
43
43
|
if (eventBusName && eventBusName != 'default') {
|
|
44
|
-
eventBusName = scope.resourceNameFormatter.format(props.eventBusName, props.resourceNameOptions);
|
|
44
|
+
eventBusName = scope.resourceNameFormatter.format(props.eventBusName, scope.props.resourceNameOptions?.eventbridgeBus);
|
|
45
45
|
}
|
|
46
46
|
const eventBus = new aws_events_1.EventBus(scope, `${id}`, {
|
|
47
47
|
...props,
|
|
@@ -67,7 +67,7 @@ class EventManager {
|
|
|
67
67
|
const rule = new aws_events_1.Rule(scope, `${id}`, {
|
|
68
68
|
...props,
|
|
69
69
|
eventBus,
|
|
70
|
-
ruleName: scope.resourceNameFormatter.format(props.ruleName, props.resourceNameOptions),
|
|
70
|
+
ruleName: scope.resourceNameFormatter.format(props.ruleName, scope.props.resourceNameOptions?.eventbridgeRule),
|
|
71
71
|
});
|
|
72
72
|
if (targets && !lodash_1.default.isEmpty(targets)) {
|
|
73
73
|
lodash_1.default.forEach(targets, target => {
|
|
@@ -103,12 +103,12 @@ class EventManager {
|
|
|
103
103
|
description: 'Rule to send notification to lambda function target',
|
|
104
104
|
eventBusName,
|
|
105
105
|
eventPattern,
|
|
106
|
-
name: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
106
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventbridgeRule),
|
|
107
107
|
scheduleExpression,
|
|
108
108
|
targets: [
|
|
109
109
|
{
|
|
110
110
|
arn: lambdaFunction.functionArn,
|
|
111
|
-
id: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
111
|
+
id: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventbridgeRule),
|
|
112
112
|
input: props.input ?? undefined,
|
|
113
113
|
},
|
|
114
114
|
],
|
|
@@ -148,7 +148,7 @@ class EventManager {
|
|
|
148
148
|
...props,
|
|
149
149
|
description: 'Rule to send notification on new objects in data bucket to ecs task target',
|
|
150
150
|
eventPattern,
|
|
151
|
-
name: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
151
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventbridgeRule),
|
|
152
152
|
targets: [
|
|
153
153
|
{
|
|
154
154
|
arn: cluster.clusterArn,
|
|
@@ -160,7 +160,7 @@ class EventManager {
|
|
|
160
160
|
taskCount: 1,
|
|
161
161
|
taskDefinitionArn: task.taskDefinitionArn,
|
|
162
162
|
},
|
|
163
|
-
id: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
163
|
+
id: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventbridgeRule),
|
|
164
164
|
roleArn: role instanceof aws_iam_1.Role ? role.roleArn : role.attrArn,
|
|
165
165
|
},
|
|
166
166
|
],
|
|
@@ -185,7 +185,7 @@ class EventManager {
|
|
|
185
185
|
const pipeRole = scope.iamManager.createRoleForSqsToSfnPipe(`${id}-role`, scope, sourceQueue.queueArn, targetStepFunction.stateMachineArn);
|
|
186
186
|
const pipe = new aws_pipes_1.CfnPipe(scope, `${id}`, {
|
|
187
187
|
...props,
|
|
188
|
-
name: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
188
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventbridgePipe),
|
|
189
189
|
roleArn: pipeRole.roleArn,
|
|
190
190
|
source: sourceQueue.queueArn,
|
|
191
191
|
sourceParameters: {
|
|
@@ -231,7 +231,7 @@ class EventManager {
|
|
|
231
231
|
const pipeRole = scope.iamManager.createRoleForSqsToLambdaPipe(`${id}-role`, scope, sourceQueue.queueArn, targetLambdaFunction.functionArn);
|
|
232
232
|
const pipe = new aws_pipes_1.CfnPipe(scope, `${id}`, {
|
|
233
233
|
...props,
|
|
234
|
-
name: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
234
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventbridgePipe),
|
|
235
235
|
roleArn: pipeRole.roleArn,
|
|
236
236
|
source: sourceQueue.queueArn,
|
|
237
237
|
sourceParameters: {
|
|
@@ -274,7 +274,7 @@ class EventManager {
|
|
|
274
274
|
const pipeRole = scope.iamManager.createRoleForDynamoDbToLambdaPipe(`${id}-role`, scope, sourceDynamoDbStreamArn, targetLambdaFunction.functionArn);
|
|
275
275
|
const pipe = new aws_pipes_1.CfnPipe(scope, `${id}`, {
|
|
276
276
|
...props,
|
|
277
|
-
name: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
277
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventbridgePipe),
|
|
278
278
|
roleArn: pipeRole.roleArn,
|
|
279
279
|
source: sourceDynamoDbStreamArn,
|
|
280
280
|
sourceParameters: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CfnRuleProps, EventBusProps as EBProps, RuleProps as EBRuleProps } from 'aws-cdk-lib/aws-events';
|
|
2
2
|
import { CfnPipeProps } from 'aws-cdk-lib/aws-pipes';
|
|
3
|
-
import { ResourceNameFormatterProps } from '../../common';
|
|
4
3
|
import { TagProps } from '../../types';
|
|
5
4
|
/**
|
|
6
5
|
*/
|
|
@@ -10,7 +9,6 @@ export interface SqsToSfnPipeProps extends CfnPipeProps {
|
|
|
10
9
|
sfnInvocationType?: string;
|
|
11
10
|
sqsBatchSize?: number;
|
|
12
11
|
sqsMaximumBatchingWindowInSeconds?: number;
|
|
13
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
14
12
|
}
|
|
15
13
|
/**
|
|
16
14
|
*/
|
|
@@ -19,25 +17,21 @@ export interface SqsToLambdaPipeProps extends CfnPipeProps {
|
|
|
19
17
|
sqsBatchSize?: number;
|
|
20
18
|
lambdaInputTemplate?: string;
|
|
21
19
|
sqsMaximumBatchingWindowInSeconds?: number;
|
|
22
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
23
20
|
}
|
|
24
21
|
/**
|
|
25
22
|
*/
|
|
26
23
|
export interface EventRuleProps extends EBRuleProps {
|
|
27
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
28
24
|
tags?: TagProps[];
|
|
29
25
|
}
|
|
30
26
|
/**
|
|
31
27
|
*/
|
|
32
28
|
export interface RuleProps extends CfnRuleProps {
|
|
33
29
|
input?: string;
|
|
34
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
35
30
|
tags?: TagProps[];
|
|
36
31
|
}
|
|
37
32
|
/**
|
|
38
33
|
*/
|
|
39
34
|
export interface EventBusProps extends EBProps {
|
|
40
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
41
35
|
}
|
|
42
36
|
/**
|
|
43
37
|
}
|
|
@@ -46,5 +40,4 @@ export interface DynamoDbToLambdaPipeProps extends CfnPipeProps {
|
|
|
46
40
|
pipeFilterPattern?: any;
|
|
47
41
|
dynamoDbBatchSize?: number;
|
|
48
42
|
dynamoDbStartingPosition: string;
|
|
49
|
-
resourceNameOptions?: ResourceNameFormatterProps;
|
|
50
43
|
}
|
|
@@ -34,7 +34,7 @@ class EvidentlyManager {
|
|
|
34
34
|
const project = new aws_evidently_1.CfnProject(scope, `${id}`, {
|
|
35
35
|
...props,
|
|
36
36
|
description: `${props.description} ${scope.props.stage}`,
|
|
37
|
-
name: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
37
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.evidentlyProject),
|
|
38
38
|
});
|
|
39
39
|
(0, utils_1.createCfnOutput)(`${id}-projectArn`, scope, project.attrArn);
|
|
40
40
|
(0, utils_1.createCfnOutput)(`${id}-projectName`, scope, project.name);
|
|
@@ -68,7 +68,7 @@ class EvidentlyManager {
|
|
|
68
68
|
const launch = new aws_evidently_1.CfnLaunch(scope, `${id}`, {
|
|
69
69
|
...props,
|
|
70
70
|
description: `${props.description} ${scope.props.stage}`,
|
|
71
|
-
name: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
71
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.evidentlyLaunch),
|
|
72
72
|
});
|
|
73
73
|
(0, utils_1.createCfnOutput)(`${id}-launchArn`, scope, launch.attrArn);
|
|
74
74
|
(0, utils_1.createCfnOutput)(`${id}-launchName`, scope, launch.name);
|
|
@@ -88,7 +88,7 @@ class EvidentlyManager {
|
|
|
88
88
|
const experiment = new aws_evidently_1.CfnExperiment(scope, `${id}`, {
|
|
89
89
|
...props,
|
|
90
90
|
description: `${props.description} ${scope.props.stage}`,
|
|
91
|
-
name: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
91
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.evidentlyExperiment),
|
|
92
92
|
});
|
|
93
93
|
(0, utils_1.createCfnOutput)(`${id}-experimentArn`, scope, experiment.attrArn);
|
|
94
94
|
(0, utils_1.createCfnOutput)(`${id}-experimentName`, scope, experiment.name);
|
|
@@ -108,7 +108,7 @@ class EvidentlyManager {
|
|
|
108
108
|
const segment = new aws_evidently_1.CfnSegment(scope, `${id}`, {
|
|
109
109
|
...props,
|
|
110
110
|
description: `${props.description} ${scope.props.stage}`,
|
|
111
|
-
name: scope.resourceNameFormatter.format(props.name, props.resourceNameOptions),
|
|
111
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.evidentlySegment),
|
|
112
112
|
});
|
|
113
113
|
(0, utils_1.createCfnOutput)(`${id}-segmentArn`, scope, segment.attrArn);
|
|
114
114
|
(0, utils_1.createCfnOutput)(`${id}-segmentName`, scope, segment.name);
|