@gradientedge/cdk-utils 8.124.0 → 8.126.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/app/api-destined-function/node_modules/.bin/rimraf +4 -4
- package/app/api-destined-function/package.json +2 -2
- package/dist/src/lib/aws/services/api-gateway/main.d.ts +2 -2
- package/dist/src/lib/aws/services/api-gateway/main.js +8 -28
- package/dist/src/lib/aws/services/appconfig/main.d.ts +1 -1
- package/dist/src/lib/aws/services/appconfig/main.js +6 -13
- package/dist/src/lib/aws/services/cloudfront/main.js +6 -18
- package/dist/src/lib/aws/services/cloudtrail/main.js +1 -4
- package/dist/src/lib/aws/services/cloudwatch/main.js +25 -66
- package/dist/src/lib/aws/services/dynamodb/main.js +1 -16
- package/dist/src/lib/aws/services/elastic-container-service/main.js +11 -38
- package/dist/src/lib/aws/services/elasticache/main.js +4 -34
- package/dist/src/lib/aws/services/eventbridge/main.js +9 -14
- package/dist/src/lib/aws/services/key-management-service/main.js +1 -9
- package/dist/src/lib/aws/services/lambda/main.d.ts +3 -2
- package/dist/src/lib/aws/services/lambda/main.js +48 -64
- package/dist/src/lib/aws/services/secrets-manager/main.js +1 -1
- package/dist/src/lib/aws/services/simple-notification-service/main.js +2 -2
- package/dist/src/lib/aws/services/simple-queue-service/main.js +1 -8
- package/dist/src/lib/aws/services/simple-storage-service/main.js +3 -22
- package/dist/src/lib/aws/services/step-function/main.js +33 -110
- package/dist/src/lib/aws/services/systems-manager/main.js +3 -3
- package/dist/src/lib/aws/services/virtual-private-cloud/main.js +1 -2
- package/dist/src/lib/aws/services/web-application-firewall/main.js +2 -7
- package/package.json +18 -18
- package/src/lib/aws/services/api-gateway/main.ts +8 -28
- package/src/lib/aws/services/appconfig/main.ts +6 -13
- package/src/lib/aws/services/cloudfront/main.ts +6 -18
- package/src/lib/aws/services/cloudtrail/main.ts +1 -4
- package/src/lib/aws/services/cloudwatch/main.ts +25 -66
- package/src/lib/aws/services/dynamodb/main.ts +1 -16
- package/src/lib/aws/services/elastic-container-service/main.ts +11 -38
- package/src/lib/aws/services/elasticache/main.ts +4 -34
- package/src/lib/aws/services/eventbridge/main.ts +9 -14
- package/src/lib/aws/services/key-management-service/main.ts +1 -9
- package/src/lib/aws/services/lambda/main.ts +57 -73
- package/src/lib/aws/services/secrets-manager/main.ts +1 -1
- package/src/lib/aws/services/simple-notification-service/main.ts +2 -2
- package/src/lib/aws/services/simple-queue-service/main.ts +1 -8
- package/src/lib/aws/services/simple-storage-service/main.ts +3 -22
- package/src/lib/aws/services/step-function/main.ts +33 -110
- package/src/lib/aws/services/systems-manager/main.ts +3 -3
- package/src/lib/aws/services/virtual-private-cloud/main.ts +1 -2
- package/src/lib/aws/services/web-application-firewall/main.ts +2 -7
|
@@ -6,12 +6,12 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/rimraf@5.0.
|
|
9
|
+
export NODE_PATH="/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/rimraf@5.0.4/node_modules/rimraf/dist/esm/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/rimraf@5.0.4/node_modules/rimraf/dist/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/rimraf@5.0.4/node_modules/rimraf/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/rimraf@5.0.4/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/rimraf@5.0.
|
|
11
|
+
export NODE_PATH="/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/rimraf@5.0.4/node_modules/rimraf/dist/esm/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/rimraf@5.0.4/node_modules/rimraf/dist/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/rimraf@5.0.4/node_modules/rimraf/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/rimraf@5.0.4/node_modules:/home/runner/work/cdk-utils/cdk-utils/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../rimraf/dist/
|
|
14
|
+
exec "$basedir/node" "$basedir/../rimraf/dist/esm/bin.mjs" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../rimraf/dist/
|
|
16
|
+
exec node "$basedir/../rimraf/dist/esm/bin.mjs" "$@"
|
|
17
17
|
fi
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"test": "npx jest --ci --runInBand --passWithNoTests"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@types/uuid": "^9.0.
|
|
19
|
+
"@types/uuid": "^9.0.4",
|
|
20
20
|
"uuid": "^9.0.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"mkdirp": "^3.0.1",
|
|
24
|
-
"rimraf": "^5.0.
|
|
24
|
+
"rimraf": "^5.0.4"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -59,7 +59,7 @@ export declare class ApiManager {
|
|
|
59
59
|
* @summary Method to create an api deployment
|
|
60
60
|
* @param id
|
|
61
61
|
* @param scope
|
|
62
|
-
* @param
|
|
62
|
+
* @param api
|
|
63
63
|
*/
|
|
64
|
-
createApiDeployment(id: string, scope: CommonConstruct,
|
|
64
|
+
createApiDeployment(id: string, scope: CommonConstruct, api: IRestApi): void;
|
|
65
65
|
}
|
|
@@ -37,42 +37,22 @@ class ApiManager {
|
|
|
37
37
|
if (!props)
|
|
38
38
|
throw `Api props undefined for ${id}`;
|
|
39
39
|
const api = new aws_apigateway_1.LambdaRestApi(scope, `${id}`, {
|
|
40
|
-
|
|
40
|
+
...props,
|
|
41
41
|
cloudWatchRole: props.cloudWatchRole || false,
|
|
42
|
-
defaultCorsPreflightOptions: props.defaultCorsPreflightOptions,
|
|
43
|
-
defaultMethodOptions: props.defaultMethodOptions,
|
|
44
42
|
deploy: props.deploy || true,
|
|
45
43
|
deployOptions: {
|
|
46
|
-
|
|
47
|
-
accessLogFormat: props.deployOptions?.accessLogFormat,
|
|
48
|
-
cacheClusterEnabled: props.deployOptions?.cacheClusterEnabled,
|
|
49
|
-
cacheClusterSize: props.deployOptions?.cacheClusterSize,
|
|
50
|
-
cachingEnabled: props.deployOptions?.cachingEnabled,
|
|
51
|
-
clientCertificateId: props.deployOptions?.clientCertificateId,
|
|
52
|
-
dataTraceEnabled: props.deployOptions?.dataTraceEnabled,
|
|
44
|
+
...props.deployOptions,
|
|
53
45
|
description: `${id} - ${scope.props.stage} stage`,
|
|
54
|
-
documentationVersion: props.deployOptions?.documentationVersion,
|
|
55
|
-
loggingLevel: props.deployOptions?.loggingLevel,
|
|
56
|
-
methodOptions: props.deployOptions?.methodOptions,
|
|
57
|
-
metricsEnabled: props.deployOptions?.metricsEnabled,
|
|
58
46
|
stageName: scope.props.stage,
|
|
59
|
-
tracingEnabled: props.deployOptions?.tracingEnabled,
|
|
60
|
-
variables: props.deployOptions?.variables,
|
|
61
47
|
},
|
|
62
|
-
domainName: props.domainName,
|
|
63
48
|
endpointConfiguration: {
|
|
49
|
+
...props.endpointConfiguration,
|
|
64
50
|
types: props.endpointConfiguration?.types || [aws_apigateway_1.EndpointType.REGIONAL],
|
|
65
|
-
vpcEndpoints: props.endpointConfiguration?.vpcEndpoints,
|
|
66
51
|
},
|
|
67
|
-
endpointTypes: props.endpointTypes,
|
|
68
52
|
failOnWarnings: props.failOnWarnings || false,
|
|
69
53
|
handler: lambdaFunction,
|
|
70
|
-
minCompressionSize: props.minCompressionSize,
|
|
71
|
-
parameters: props.parameters,
|
|
72
|
-
policy: props.policy,
|
|
73
54
|
proxy: props.proxy ?? true,
|
|
74
55
|
restApiName: `${props.restApiName}-${scope.props.stage}`,
|
|
75
|
-
retainDeployments: props.retainDeployments,
|
|
76
56
|
});
|
|
77
57
|
if (props.tags && !lodash_1.default.isEmpty(props.tags)) {
|
|
78
58
|
lodash_1.default.forEach(props.tags, tag => {
|
|
@@ -92,8 +72,8 @@ class ApiManager {
|
|
|
92
72
|
*/
|
|
93
73
|
createApiDomain(id, scope, domainName, certificate) {
|
|
94
74
|
const apiDomain = new aws_apigateway_1.DomainName(scope, `${id}`, {
|
|
95
|
-
certificate
|
|
96
|
-
domainName
|
|
75
|
+
certificate,
|
|
76
|
+
domainName,
|
|
97
77
|
endpointType: scope.isProductionStage() ? aws_apigateway_1.EndpointType.EDGE : aws_apigateway_1.EndpointType.REGIONAL,
|
|
98
78
|
securityPolicy: aws_apigateway_1.SecurityPolicy.TLS_1_2,
|
|
99
79
|
});
|
|
@@ -155,11 +135,11 @@ class ApiManager {
|
|
|
155
135
|
* @summary Method to create an api deployment
|
|
156
136
|
* @param id
|
|
157
137
|
* @param scope
|
|
158
|
-
* @param
|
|
138
|
+
* @param api
|
|
159
139
|
*/
|
|
160
|
-
createApiDeployment(id, scope,
|
|
140
|
+
createApiDeployment(id, scope, api) {
|
|
161
141
|
new aws_apigateway_1.Deployment(scope, `${id}`, {
|
|
162
|
-
api
|
|
142
|
+
api,
|
|
163
143
|
retainDeployments: false,
|
|
164
144
|
});
|
|
165
145
|
}
|
|
@@ -44,7 +44,7 @@ export declare class AppConfigManager {
|
|
|
44
44
|
createEnvironment(id: string, scope: CommonConstruct, applicationId: string, props: AppConfigProps): CfnEnvironment;
|
|
45
45
|
/**
|
|
46
46
|
* @summary Method to create an AppConfig Configuration Profile for a given application
|
|
47
|
-
* -
|
|
47
|
+
* - The <b>locationUri</b> is defaulted to <i>hosted</i> if undefined</p>
|
|
48
48
|
* @param id scoped id of the resource
|
|
49
49
|
* @param scope scope in which this resource is defined
|
|
50
50
|
* @param applicationId id of the application
|
|
@@ -49,9 +49,8 @@ class AppConfigManager {
|
|
|
49
49
|
if (!props)
|
|
50
50
|
throw `AppConfig props undefined for ${id}`;
|
|
51
51
|
const application = new aws_appconfig_1.CfnApplication(scope, `${id}`, {
|
|
52
|
-
|
|
52
|
+
...props.application,
|
|
53
53
|
name: `${props.application.name}-${scope.props.stage}`,
|
|
54
|
-
tags: props.application.tags,
|
|
55
54
|
});
|
|
56
55
|
(0, utils_1.createCfnOutput)(`${id}-ApplicationId`, scope, aws_cdk_lib_1.Fn.ref(application.logicalId));
|
|
57
56
|
(0, utils_1.createCfnOutput)(`${id}-ApplicationName`, scope, application.name);
|
|
@@ -69,11 +68,9 @@ class AppConfigManager {
|
|
|
69
68
|
if (!props)
|
|
70
69
|
throw `AppConfig props undefined for ${id}`;
|
|
71
70
|
const environment = new aws_appconfig_1.CfnEnvironment(scope, `${id}`, {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
monitors: props.environment.monitors,
|
|
71
|
+
...props.environment,
|
|
72
|
+
applicationId,
|
|
75
73
|
name: props.environment.name ?? scope.props.stage,
|
|
76
|
-
tags: props.environment.tags,
|
|
77
74
|
});
|
|
78
75
|
(0, utils_1.createCfnOutput)(`${id}-configurationEnvironmentId`, scope, aws_cdk_lib_1.Fn.ref(environment.logicalId));
|
|
79
76
|
(0, utils_1.createCfnOutput)(`${id}-configurationEnvironmentName`, scope, environment.name);
|
|
@@ -81,7 +78,7 @@ class AppConfigManager {
|
|
|
81
78
|
}
|
|
82
79
|
/**
|
|
83
80
|
* @summary Method to create an AppConfig Configuration Profile for a given application
|
|
84
|
-
* -
|
|
81
|
+
* - The <b>locationUri</b> is defaulted to <i>hosted</i> if undefined</p>
|
|
85
82
|
* @param id scoped id of the resource
|
|
86
83
|
* @param scope scope in which this resource is defined
|
|
87
84
|
* @param applicationId id of the application
|
|
@@ -92,14 +89,10 @@ class AppConfigManager {
|
|
|
92
89
|
if (!props)
|
|
93
90
|
throw `AppConfig props undefined for ${id}`;
|
|
94
91
|
const profile = new aws_appconfig_1.CfnConfigurationProfile(scope, `${id}`, {
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
...props.configurationProfile,
|
|
93
|
+
applicationId,
|
|
97
94
|
locationUri: props.configurationProfile.locationUri || 'hosted',
|
|
98
95
|
name: `${props.configurationProfile.name}-${scope.props.stage}`,
|
|
99
|
-
retrievalRoleArn: props.configurationProfile.retrievalRoleArn,
|
|
100
|
-
tags: props.configurationProfile.tags,
|
|
101
|
-
type: props.configurationProfile.type,
|
|
102
|
-
validators: props.configurationProfile.validators,
|
|
103
96
|
});
|
|
104
97
|
(0, utils_1.createCfnOutput)(`${id}-configurationProfileId`, scope, aws_cdk_lib_1.Fn.ref(profile.logicalId));
|
|
105
98
|
(0, utils_1.createCfnOutput)(`${id}-configurationProfileName`, scope, profile.name);
|
|
@@ -86,12 +86,9 @@ class CloudFrontManager {
|
|
|
86
86
|
if (!props)
|
|
87
87
|
throw `CloudFront props undefined for ${id}`;
|
|
88
88
|
const distribution = new aws_cloudfront_1.CloudFrontWebDistribution(scope, `${id}`, {
|
|
89
|
+
...props,
|
|
89
90
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
90
|
-
defaultRootObject: props.defaultRootObject,
|
|
91
|
-
enableIpV6: props.enableIpV6,
|
|
92
91
|
enabled: props.enabled ?? true,
|
|
93
|
-
errorConfigurations: props.errorConfigurations,
|
|
94
|
-
geoRestriction: props.geoRestriction,
|
|
95
92
|
httpVersion: props.httpVersion ?? aws_cloudfront_1.HttpVersion.HTTP2,
|
|
96
93
|
loggingConfig: {
|
|
97
94
|
bucket: logBucket,
|
|
@@ -112,7 +109,6 @@ class CloudFrontManager {
|
|
|
112
109
|
securityPolicy: aws_cloudfront_1.SecurityPolicyProtocol.TLS_V1_1_2016,
|
|
113
110
|
sslMethod: aws_cloudfront_1.SSLMethod.SNI,
|
|
114
111
|
}),
|
|
115
|
-
webACLId: props.webACLId,
|
|
116
112
|
});
|
|
117
113
|
if (props.tags && !lodash_1.default.isEmpty(props.tags)) {
|
|
118
114
|
lodash_1.default.forEach(props.tags, tag => {
|
|
@@ -138,31 +134,23 @@ class CloudFrontManager {
|
|
|
138
134
|
*/
|
|
139
135
|
createDistributionWithS3Origin(id, scope, props, origin, siteBucket, logBucket, oai, certificate, aliases, defaultFunctionAssociations) {
|
|
140
136
|
const distribution = new aws_cloudfront_1.Distribution(scope, `${id}`, {
|
|
141
|
-
|
|
142
|
-
certificate
|
|
137
|
+
...props,
|
|
138
|
+
certificate,
|
|
143
139
|
comment: `${id} - ${scope.props.stage} stage`,
|
|
144
140
|
defaultBehavior: {
|
|
145
|
-
|
|
146
|
-
edgeLambdas: props.defaultBehavior ? props.defaultBehavior.edgeLambdas : undefined,
|
|
141
|
+
...props.defaultBehavior,
|
|
147
142
|
functionAssociations: defaultFunctionAssociations ?? undefined,
|
|
148
|
-
origin
|
|
149
|
-
originRequestPolicy: props.defaultBehavior ? props.defaultBehavior.originRequestPolicy : undefined,
|
|
150
|
-
viewerProtocolPolicy: props.defaultBehavior ? props.defaultBehavior.viewerProtocolPolicy : undefined,
|
|
143
|
+
origin,
|
|
151
144
|
},
|
|
152
|
-
defaultRootObject: props.defaultRootObject,
|
|
153
145
|
domainNames: aliases,
|
|
154
|
-
enableIpv6: props.enableIpv6,
|
|
155
146
|
enableLogging: props.enableLogging ?? true,
|
|
156
147
|
enabled: props.enabled ?? true,
|
|
157
|
-
errorResponses: props.errorResponses,
|
|
158
|
-
geoRestriction: props.geoRestriction,
|
|
159
148
|
httpVersion: props.httpVersion ?? aws_cloudfront_1.HttpVersion.HTTP2,
|
|
160
|
-
logBucket
|
|
149
|
+
logBucket,
|
|
161
150
|
logFilePrefix: props.logFilePrefix ?? `edge/`,
|
|
162
151
|
logIncludesCookies: props.logIncludesCookies ?? true,
|
|
163
152
|
minimumProtocolVersion: props.minimumProtocolVersion ?? aws_cloudfront_1.SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
164
153
|
priceClass: props.priceClass ?? aws_cloudfront_1.PriceClass.PRICE_CLASS_ALL,
|
|
165
|
-
webAclId: props.webAclId,
|
|
166
154
|
});
|
|
167
155
|
if (props.tags && !lodash_1.default.isEmpty(props.tags)) {
|
|
168
156
|
lodash_1.default.forEach(props.tags, tag => {
|
|
@@ -42,9 +42,9 @@ class CloudTrailManager {
|
|
|
42
42
|
throw `CloudTrail props undefined for ${id}`;
|
|
43
43
|
const role = scope.iamManager.createRoleForCloudTrail(`${id}Role`, scope, logGroup);
|
|
44
44
|
const cloudTrail = new aws_cloudtrail_1.CfnTrail(scope, `${id}`, {
|
|
45
|
+
...props,
|
|
45
46
|
cloudWatchLogsLogGroupArn: logGroup.attrArn,
|
|
46
47
|
cloudWatchLogsRoleArn: role.attrArn,
|
|
47
|
-
enableLogFileValidation: props.enableLogFileValidation,
|
|
48
48
|
eventSelectors: [
|
|
49
49
|
{
|
|
50
50
|
dataResources: [
|
|
@@ -57,9 +57,6 @@ class CloudTrailManager {
|
|
|
57
57
|
readWriteType: 'WriteOnly',
|
|
58
58
|
},
|
|
59
59
|
],
|
|
60
|
-
includeGlobalServiceEvents: props.includeGlobalServiceEvents,
|
|
61
|
-
isLogging: props.isLogging,
|
|
62
|
-
isMultiRegionTrail: props.isMultiRegionTrail,
|
|
63
60
|
s3BucketName: logBucket.bucketName,
|
|
64
61
|
s3KeyPrefix: `logs-${props.trailName}`,
|
|
65
62
|
tags: [{ key: 'service', value: scope.props.name }],
|
|
@@ -77,18 +77,13 @@ class CloudWatchManager {
|
|
|
77
77
|
metrics[`m${index}`] = metric;
|
|
78
78
|
});
|
|
79
79
|
const expression = new watch.MathExpression({
|
|
80
|
+
...props,
|
|
80
81
|
expression: props.expression,
|
|
81
82
|
period: props.periodInSecs ? cdk.Duration.seconds(props.periodInSecs) : cdk.Duration.minutes(5),
|
|
82
83
|
usingMetrics: metrics,
|
|
83
84
|
});
|
|
84
85
|
const alarm = expression.createAlarm(scope, `${id}`, {
|
|
85
|
-
|
|
86
|
-
alarmName: props.alarmName,
|
|
87
|
-
comparisonOperator: props.comparisonOperator,
|
|
88
|
-
datapointsToAlarm: props.datapointsToAlarm,
|
|
89
|
-
evaluationPeriods: props.evaluationPeriods,
|
|
90
|
-
threshold: props.threshold,
|
|
91
|
-
treatMissingData: props.treatMissingData,
|
|
86
|
+
...props,
|
|
92
87
|
});
|
|
93
88
|
utils.createCfnOutput(`${id}-alarmArn`, scope, alarm.alarmArn);
|
|
94
89
|
utils.createCfnOutput(`${id}-alarmName`, scope, alarm.alarmName);
|
|
@@ -105,13 +100,7 @@ class CloudWatchManager {
|
|
|
105
100
|
if (!props)
|
|
106
101
|
throw `Alarm props undefined for ${id}`;
|
|
107
102
|
const alarm = metric.createAlarm(scope, `${id}`, {
|
|
108
|
-
|
|
109
|
-
alarmName: props.alarmName,
|
|
110
|
-
comparisonOperator: props.comparisonOperator,
|
|
111
|
-
datapointsToAlarm: props.datapointsToAlarm,
|
|
112
|
-
evaluationPeriods: props.evaluationPeriods,
|
|
113
|
-
threshold: props.threshold,
|
|
114
|
-
treatMissingData: props.treatMissingData,
|
|
103
|
+
...props,
|
|
115
104
|
});
|
|
116
105
|
utils.createCfnOutput(`${id}-alarmArn`, scope, alarm.alarmArn);
|
|
117
106
|
utils.createCfnOutput(`${id}-alarmName`, scope, alarm.alarmName);
|
|
@@ -128,11 +117,10 @@ class CloudWatchManager {
|
|
|
128
117
|
if (!props)
|
|
129
118
|
throw `Dashboard props undefined for ${id}`;
|
|
130
119
|
const dashboard = new watch.Dashboard(scope, `${id}`, {
|
|
131
|
-
|
|
120
|
+
...props,
|
|
132
121
|
end: CloudWatchManager.determineTimeRange(props.end),
|
|
133
|
-
periodOverride: props.periodOverride,
|
|
134
122
|
start: CloudWatchManager.determineTimeRange(props.start),
|
|
135
|
-
widgets
|
|
123
|
+
widgets,
|
|
136
124
|
});
|
|
137
125
|
utils.createCfnOutput(`${id}-dashboardName`, scope, props.dashboardName);
|
|
138
126
|
return dashboard;
|
|
@@ -194,7 +182,7 @@ class CloudWatchManager {
|
|
|
194
182
|
const metricProps = props.metricProps;
|
|
195
183
|
return this.createWidget(id, scope, {
|
|
196
184
|
...props,
|
|
197
|
-
metricProps:
|
|
185
|
+
metricProps: metricProps.map(metricProp => ({ ...metricProp, distributionId })),
|
|
198
186
|
});
|
|
199
187
|
}
|
|
200
188
|
/**
|
|
@@ -210,7 +198,7 @@ class CloudWatchManager {
|
|
|
210
198
|
const metricProps = props.metricProps;
|
|
211
199
|
return this.createWidget(id, scope, {
|
|
212
200
|
...props,
|
|
213
|
-
metricProps:
|
|
201
|
+
metricProps: metricProps.map(metricProp => ({ ...metricProp, stateMachineArn })),
|
|
214
202
|
});
|
|
215
203
|
}
|
|
216
204
|
/**
|
|
@@ -227,7 +215,7 @@ class CloudWatchManager {
|
|
|
227
215
|
const metricProps = props.metricProps;
|
|
228
216
|
return this.createWidget(id, scope, {
|
|
229
217
|
...props,
|
|
230
|
-
metricProps:
|
|
218
|
+
metricProps: metricProps.map(metricProp => ({ ...metricProp, eventBusName, ruleName })),
|
|
231
219
|
});
|
|
232
220
|
}
|
|
233
221
|
/**
|
|
@@ -243,7 +231,7 @@ class CloudWatchManager {
|
|
|
243
231
|
const metricProps = props.metricProps;
|
|
244
232
|
return this.createWidget(id, scope, {
|
|
245
233
|
...props,
|
|
246
|
-
metricProps:
|
|
234
|
+
metricProps: metricProps.map(metricProp => ({ ...metricProp, apiName })),
|
|
247
235
|
});
|
|
248
236
|
}
|
|
249
237
|
/**
|
|
@@ -259,7 +247,7 @@ class CloudWatchManager {
|
|
|
259
247
|
const metricProps = props.metricProps;
|
|
260
248
|
return this.createWidget(id, scope, {
|
|
261
249
|
...props,
|
|
262
|
-
metricProps:
|
|
250
|
+
metricProps: metricProps.map(metricProp => ({ ...metricProp, functionName })),
|
|
263
251
|
});
|
|
264
252
|
}
|
|
265
253
|
/**
|
|
@@ -275,7 +263,7 @@ class CloudWatchManager {
|
|
|
275
263
|
const metricProps = props.metricProps;
|
|
276
264
|
return this.createWidget(id, scope, {
|
|
277
265
|
...props,
|
|
278
|
-
metricProps:
|
|
266
|
+
metricProps: metricProps.map(metricProp => ({ ...metricProp, service })),
|
|
279
267
|
});
|
|
280
268
|
}
|
|
281
269
|
/**
|
|
@@ -291,7 +279,7 @@ class CloudWatchManager {
|
|
|
291
279
|
const metricProps = props.metricProps;
|
|
292
280
|
return this.createWidget(id, scope, {
|
|
293
281
|
...props,
|
|
294
|
-
metricProps:
|
|
282
|
+
metricProps: metricProps.map(metricProp => ({ ...metricProp, clusterName })),
|
|
295
283
|
});
|
|
296
284
|
}
|
|
297
285
|
/**
|
|
@@ -308,7 +296,7 @@ class CloudWatchManager {
|
|
|
308
296
|
const metricProps = props.metricProps;
|
|
309
297
|
return this.createWidget(id, scope, {
|
|
310
298
|
...props,
|
|
311
|
-
metricProps:
|
|
299
|
+
metricProps: metricProps.map(metricProp => ({ ...metricProp, clusterName, serviceName })),
|
|
312
300
|
});
|
|
313
301
|
}
|
|
314
302
|
/**
|
|
@@ -324,7 +312,7 @@ class CloudWatchManager {
|
|
|
324
312
|
const metricProps = props.metricProps;
|
|
325
313
|
return this.createWidget(id, scope, {
|
|
326
314
|
...props,
|
|
327
|
-
metricProps:
|
|
315
|
+
metricProps: metricProps.map(metricProp => ({ ...metricProp, loadBalancer })),
|
|
328
316
|
});
|
|
329
317
|
}
|
|
330
318
|
/**
|
|
@@ -340,7 +328,7 @@ class CloudWatchManager {
|
|
|
340
328
|
const metricProps = props.metricProps;
|
|
341
329
|
return this.createWidget(id, scope, {
|
|
342
330
|
...props,
|
|
343
|
-
metricProps:
|
|
331
|
+
metricProps: metricProps.map(metricProp => ({ ...metricProp, cacheClusterId })),
|
|
344
332
|
});
|
|
345
333
|
}
|
|
346
334
|
/**
|
|
@@ -353,9 +341,7 @@ class CloudWatchManager {
|
|
|
353
341
|
if (!props)
|
|
354
342
|
throw `Widget props undefined for ${id}`;
|
|
355
343
|
const widget = new watch.TextWidget({
|
|
356
|
-
|
|
357
|
-
markdown: props.markdown,
|
|
358
|
-
width: props.width,
|
|
344
|
+
...props,
|
|
359
345
|
});
|
|
360
346
|
if (props.positionX && props.positionY)
|
|
361
347
|
widget.position(props.positionX, props.positionY);
|
|
@@ -372,14 +358,9 @@ class CloudWatchManager {
|
|
|
372
358
|
if (!props)
|
|
373
359
|
throw `Widget props undefined for ${id}`;
|
|
374
360
|
const widget = new watch.SingleValueWidget({
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
metrics: metrics,
|
|
361
|
+
...props,
|
|
362
|
+
metrics,
|
|
378
363
|
region: props.region ?? scope.props.region,
|
|
379
|
-
setPeriodToTimeRange: props.setPeriodToTimeRange,
|
|
380
|
-
sparkline: props.sparkline,
|
|
381
|
-
title: props.title,
|
|
382
|
-
width: props.width,
|
|
383
364
|
});
|
|
384
365
|
if (props.positionX && props.positionY)
|
|
385
366
|
widget.position(props.positionX, props.positionY);
|
|
@@ -396,14 +377,9 @@ class CloudWatchManager {
|
|
|
396
377
|
if (!props)
|
|
397
378
|
throw `Widget props undefined for ${id}`;
|
|
398
379
|
const widget = new watch.GaugeWidget({
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
metrics: metrics,
|
|
380
|
+
...props,
|
|
381
|
+
metrics,
|
|
402
382
|
region: props.region ?? scope.props.region,
|
|
403
|
-
setPeriodToTimeRange: props.setPeriodToTimeRange,
|
|
404
|
-
statistic: props.statistic,
|
|
405
|
-
title: props.title,
|
|
406
|
-
width: props.width,
|
|
407
383
|
});
|
|
408
384
|
if (props.positionX && props.positionY)
|
|
409
385
|
widget.position(props.positionX, props.positionY);
|
|
@@ -421,20 +397,10 @@ class CloudWatchManager {
|
|
|
421
397
|
if (!props)
|
|
422
398
|
throw `Widget props undefined for ${id}`;
|
|
423
399
|
const widget = new watch.GraphWidget({
|
|
424
|
-
|
|
400
|
+
...props,
|
|
425
401
|
left: leftYMetrics,
|
|
426
|
-
leftAnnotations: props.leftAnnotations,
|
|
427
|
-
leftYAxis: props.leftYAxis,
|
|
428
|
-
legendPosition: props.legendPosition,
|
|
429
|
-
liveData: props.liveData,
|
|
430
402
|
region: props.region ?? scope.props.region,
|
|
431
403
|
right: rightYMetrics,
|
|
432
|
-
rightAnnotations: props.rightAnnotations,
|
|
433
|
-
rightYAxis: props.rightYAxis,
|
|
434
|
-
stacked: props.stacked,
|
|
435
|
-
title: props.title,
|
|
436
|
-
view: props.view,
|
|
437
|
-
width: props.width,
|
|
438
404
|
});
|
|
439
405
|
if (props.positionX && props.positionY)
|
|
440
406
|
widget.position(props.positionX, props.positionY);
|
|
@@ -451,10 +417,8 @@ class CloudWatchManager {
|
|
|
451
417
|
if (!props)
|
|
452
418
|
throw `Widget props undefined for ${id}`;
|
|
453
419
|
const widget = new watch.AlarmStatusWidget({
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
title: props.title,
|
|
457
|
-
width: props.width,
|
|
420
|
+
...props,
|
|
421
|
+
alarms,
|
|
458
422
|
});
|
|
459
423
|
if (props.positionX && props.positionY)
|
|
460
424
|
widget.position(props.positionX, props.positionY);
|
|
@@ -471,14 +435,9 @@ class CloudWatchManager {
|
|
|
471
435
|
if (!props)
|
|
472
436
|
throw `Widget props undefined for ${id}`;
|
|
473
437
|
const widget = new watch.LogQueryWidget({
|
|
474
|
-
|
|
475
|
-
logGroupNames
|
|
476
|
-
queryLines: props.queryLines,
|
|
477
|
-
queryString: props.queryString,
|
|
438
|
+
...props,
|
|
439
|
+
logGroupNames,
|
|
478
440
|
region: props.region ?? scope.props.region,
|
|
479
|
-
title: props.title,
|
|
480
|
-
view: props.view,
|
|
481
|
-
width: props.width,
|
|
482
441
|
});
|
|
483
442
|
if (props.positionX && props.positionY)
|
|
484
443
|
widget.position(props.positionX, props.positionY);
|
|
@@ -35,23 +35,8 @@ class DynamodbManager {
|
|
|
35
35
|
if (!props)
|
|
36
36
|
throw `Table props undefined for ${id}`;
|
|
37
37
|
const table = new aws_dynamodb_1.Table(scope, `${id}`, {
|
|
38
|
-
|
|
39
|
-
contributorInsightsEnabled: props.contributorInsightsEnabled,
|
|
40
|
-
encryption: props.encryption,
|
|
41
|
-
encryptionKey: props.encryptionKey,
|
|
42
|
-
kinesisStream: props.kinesisStream,
|
|
43
|
-
partitionKey: props.partitionKey,
|
|
44
|
-
pointInTimeRecovery: props.pointInTimeRecovery,
|
|
45
|
-
readCapacity: props.readCapacity,
|
|
46
|
-
removalPolicy: props.removalPolicy,
|
|
47
|
-
replicationRegions: props.replicationRegions,
|
|
48
|
-
replicationTimeout: props.replicationTimeout,
|
|
49
|
-
sortKey: props.sortKey,
|
|
50
|
-
stream: props.stream,
|
|
38
|
+
...props,
|
|
51
39
|
tableName: `${props.tableName}-${scope.props.stage}`,
|
|
52
|
-
timeToLiveAttribute: props.timeToLiveAttribute,
|
|
53
|
-
waitForReplicationToFinish: props.waitForReplicationToFinish,
|
|
54
|
-
writeCapacity: props.writeCapacity,
|
|
55
40
|
});
|
|
56
41
|
if (props.tags && !lodash_1.default.isEmpty(props.tags)) {
|
|
57
42
|
lodash_1.default.forEach(props.tags, tag => {
|
|
@@ -37,13 +37,9 @@ class EcsManager {
|
|
|
37
37
|
if (!props)
|
|
38
38
|
throw `Ecs Cluster props undefined for ${id}`;
|
|
39
39
|
const ecsCluster = new aws_ecs_1.Cluster(scope, `${id}`, {
|
|
40
|
-
|
|
40
|
+
...props,
|
|
41
41
|
clusterName: `${props.clusterName}-${scope.props.stage}`,
|
|
42
|
-
|
|
43
|
-
defaultCloudMapNamespace: props.defaultCloudMapNamespace,
|
|
44
|
-
enableFargateCapacityProviders: props.enableFargateCapacityProviders,
|
|
45
|
-
executeCommandConfiguration: props.executeCommandConfiguration,
|
|
46
|
-
vpc: vpc,
|
|
42
|
+
vpc,
|
|
47
43
|
});
|
|
48
44
|
if (props.tags && !lodash_1.default.isEmpty(props.tags)) {
|
|
49
45
|
lodash_1.default.forEach(props.tags, tag => {
|
|
@@ -71,40 +67,32 @@ class EcsManager {
|
|
|
71
67
|
if (!props)
|
|
72
68
|
throw `EcsTask props undefined for ${id}`;
|
|
73
69
|
const ecsTask = new aws_ecs_1.TaskDefinition(scope, `${id}`, {
|
|
70
|
+
...props,
|
|
74
71
|
compatibility: aws_ecs_1.Compatibility.FARGATE,
|
|
75
|
-
cpu: props.cpu,
|
|
76
|
-
ephemeralStorageGiB: props.ephemeralStorageGiB,
|
|
77
72
|
executionRole: role,
|
|
78
73
|
family: `${props.family}-${scope.props.stage}`,
|
|
79
|
-
inferenceAccelerators: props.inferenceAccelerators,
|
|
80
|
-
ipcMode: props.ipcMode,
|
|
81
|
-
memoryMiB: props.memoryMiB,
|
|
82
74
|
networkMode: aws_ecs_1.NetworkMode.AWS_VPC,
|
|
83
|
-
pidMode: props.pidMode,
|
|
84
|
-
placementConstraints: props.placementConstraints,
|
|
85
|
-
proxyConfiguration: props.proxyConfiguration,
|
|
86
75
|
runtimePlatform: {
|
|
87
76
|
cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? aws_ecs_1.CpuArchitecture.X86_64,
|
|
88
77
|
operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? aws_ecs_1.OperatingSystemFamily.LINUX,
|
|
89
78
|
},
|
|
90
79
|
taskRole: role,
|
|
91
|
-
volumes: props.volumes,
|
|
92
80
|
});
|
|
93
81
|
ecsTask.addContainer('EcsContainer', {
|
|
94
|
-
command
|
|
82
|
+
command,
|
|
95
83
|
cpu: props.cpu ? parseInt(props.cpu) : undefined,
|
|
96
84
|
disableNetworking: false,
|
|
97
|
-
environment
|
|
85
|
+
environment,
|
|
98
86
|
image: containerImage,
|
|
99
87
|
logging: aws_ecs_1.LogDriver.awsLogs({
|
|
100
|
-
logGroup
|
|
88
|
+
logGroup,
|
|
101
89
|
logRetention: props.logging?.logRetention,
|
|
102
90
|
multilinePattern: props.logging?.multilinePattern,
|
|
103
91
|
streamPrefix: `${id}`,
|
|
104
92
|
}),
|
|
105
93
|
memoryLimitMiB: props.memoryMiB ? parseInt(props.memoryMiB) : undefined,
|
|
106
94
|
privileged: false,
|
|
107
|
-
secrets
|
|
95
|
+
secrets,
|
|
108
96
|
});
|
|
109
97
|
if (props.tags && !lodash_1.default.isEmpty(props.tags)) {
|
|
110
98
|
lodash_1.default.forEach(props.tags, tag => {
|
|
@@ -128,29 +116,20 @@ class EcsManager {
|
|
|
128
116
|
if (!props.taskImageOptions)
|
|
129
117
|
throw `TaskImageOptions for Ecs Load balanced Fargate Service props undefined for ${id}`;
|
|
130
118
|
const fargateService = new aws_ecs_patterns_1.ApplicationLoadBalancedFargateService(scope, `${id}-ecs-service`, {
|
|
119
|
+
...props,
|
|
131
120
|
assignPublicIp: props.assignPublicIp ?? true,
|
|
132
|
-
|
|
133
|
-
cluster: cluster,
|
|
134
|
-
cpu: props.cpu,
|
|
135
|
-
desiredCount: props.desiredCount,
|
|
136
|
-
domainName: props.domainName,
|
|
137
|
-
domainZone: props.domainZone,
|
|
121
|
+
cluster,
|
|
138
122
|
enableECSManagedTags: true,
|
|
139
123
|
healthCheckGracePeriod: props.healthCheckGracePeriod ?? aws_cdk_lib_1.Duration.seconds(60),
|
|
140
|
-
listenerPort: props.listenerPort,
|
|
141
124
|
loadBalancerName: `${id}-${scope.props.stage}`,
|
|
142
|
-
memoryLimitMiB: props.memoryLimitMiB,
|
|
143
125
|
runtimePlatform: {
|
|
144
126
|
cpuArchitecture: props.runtimePlatform?.cpuArchitecture ?? aws_ecs_1.CpuArchitecture.X86_64,
|
|
145
127
|
operatingSystemFamily: props.runtimePlatform?.operatingSystemFamily ?? aws_ecs_1.OperatingSystemFamily.LINUX,
|
|
146
128
|
},
|
|
147
129
|
serviceName: `${id}-${scope.props.stage}`,
|
|
148
130
|
taskImageOptions: {
|
|
149
|
-
|
|
131
|
+
...props.taskImageOptions,
|
|
150
132
|
enableLogging: props.taskImageOptions?.enableLogging ?? true,
|
|
151
|
-
environment: props.taskImageOptions?.environment,
|
|
152
|
-
executionRole: props.taskImageOptions?.executionRole,
|
|
153
|
-
image: props.taskImageOptions.image,
|
|
154
133
|
logDriver: props.taskImageOptions?.logDriver ??
|
|
155
134
|
aws_ecs_1.LogDriver.awsLogs({
|
|
156
135
|
logGroup: logGroup,
|
|
@@ -158,20 +137,14 @@ class EcsManager {
|
|
|
158
137
|
multilinePattern: props.logging?.multilinePattern,
|
|
159
138
|
streamPrefix: `${id}-${scope.props.stage}/ecs`,
|
|
160
139
|
}),
|
|
161
|
-
secrets: props.taskImageOptions?.secrets,
|
|
162
|
-
taskRole: props.taskImageOptions?.taskRole,
|
|
163
140
|
},
|
|
164
141
|
});
|
|
165
142
|
if (props.healthCheck) {
|
|
166
143
|
fargateService.targetGroup.configureHealthCheck({
|
|
144
|
+
...props.healthCheck,
|
|
167
145
|
enabled: props.healthCheck.enabled ?? true,
|
|
168
|
-
healthyGrpcCodes: props.healthCheck.healthyGrpcCodes,
|
|
169
|
-
healthyHttpCodes: props.healthCheck.healthyHttpCodes,
|
|
170
|
-
healthyThresholdCount: props.healthCheck.healthyThresholdCount,
|
|
171
146
|
interval: props.healthCheck.interval ?? aws_cdk_lib_1.Duration.seconds(props.healthCheck.intervalInSecs),
|
|
172
147
|
path: props.healthCheck.path ?? '/',
|
|
173
|
-
port: props.healthCheck.port,
|
|
174
|
-
protocol: props.healthCheck.protocol,
|
|
175
148
|
timeout: props.healthCheck.timeout ?? aws_cdk_lib_1.Duration.seconds(props.healthCheck.timeoutInSecs),
|
|
176
149
|
unhealthyThresholdCount: props.healthCheck.unhealthyThresholdCount,
|
|
177
150
|
});
|