@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.
Files changed (44) hide show
  1. package/app/api-destined-function/node_modules/.bin/rimraf +4 -4
  2. package/app/api-destined-function/package.json +2 -2
  3. package/dist/src/lib/aws/services/api-gateway/main.d.ts +2 -2
  4. package/dist/src/lib/aws/services/api-gateway/main.js +8 -28
  5. package/dist/src/lib/aws/services/appconfig/main.d.ts +1 -1
  6. package/dist/src/lib/aws/services/appconfig/main.js +6 -13
  7. package/dist/src/lib/aws/services/cloudfront/main.js +6 -18
  8. package/dist/src/lib/aws/services/cloudtrail/main.js +1 -4
  9. package/dist/src/lib/aws/services/cloudwatch/main.js +25 -66
  10. package/dist/src/lib/aws/services/dynamodb/main.js +1 -16
  11. package/dist/src/lib/aws/services/elastic-container-service/main.js +11 -38
  12. package/dist/src/lib/aws/services/elasticache/main.js +4 -34
  13. package/dist/src/lib/aws/services/eventbridge/main.js +9 -14
  14. package/dist/src/lib/aws/services/key-management-service/main.js +1 -9
  15. package/dist/src/lib/aws/services/lambda/main.d.ts +3 -2
  16. package/dist/src/lib/aws/services/lambda/main.js +48 -64
  17. package/dist/src/lib/aws/services/secrets-manager/main.js +1 -1
  18. package/dist/src/lib/aws/services/simple-notification-service/main.js +2 -2
  19. package/dist/src/lib/aws/services/simple-queue-service/main.js +1 -8
  20. package/dist/src/lib/aws/services/simple-storage-service/main.js +3 -22
  21. package/dist/src/lib/aws/services/step-function/main.js +33 -110
  22. package/dist/src/lib/aws/services/systems-manager/main.js +3 -3
  23. package/dist/src/lib/aws/services/virtual-private-cloud/main.js +1 -2
  24. package/dist/src/lib/aws/services/web-application-firewall/main.js +2 -7
  25. package/package.json +18 -18
  26. package/src/lib/aws/services/api-gateway/main.ts +8 -28
  27. package/src/lib/aws/services/appconfig/main.ts +6 -13
  28. package/src/lib/aws/services/cloudfront/main.ts +6 -18
  29. package/src/lib/aws/services/cloudtrail/main.ts +1 -4
  30. package/src/lib/aws/services/cloudwatch/main.ts +25 -66
  31. package/src/lib/aws/services/dynamodb/main.ts +1 -16
  32. package/src/lib/aws/services/elastic-container-service/main.ts +11 -38
  33. package/src/lib/aws/services/elasticache/main.ts +4 -34
  34. package/src/lib/aws/services/eventbridge/main.ts +9 -14
  35. package/src/lib/aws/services/key-management-service/main.ts +1 -9
  36. package/src/lib/aws/services/lambda/main.ts +57 -73
  37. package/src/lib/aws/services/secrets-manager/main.ts +1 -1
  38. package/src/lib/aws/services/simple-notification-service/main.ts +2 -2
  39. package/src/lib/aws/services/simple-queue-service/main.ts +1 -8
  40. package/src/lib/aws/services/simple-storage-service/main.ts +3 -22
  41. package/src/lib/aws/services/step-function/main.ts +33 -110
  42. package/src/lib/aws/services/systems-manager/main.ts +3 -3
  43. package/src/lib/aws/services/virtual-private-cloud/main.ts +1 -2
  44. package/src/lib/aws/services/web-application-firewall/main.ts +2 -7
@@ -52,24 +52,10 @@ class ElastiCacheManager {
52
52
  throw `ElastiCache props undefined for ${id}`;
53
53
  const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds);
54
54
  const elasticacheCluster = new aws_elasticache_1.CfnCacheCluster(scope, `${id}`, {
55
- autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
56
- azMode: props.azMode,
57
- cacheNodeType: props.cacheNodeType,
58
- cacheParameterGroupName: props.cacheParameterGroupName,
59
- cacheSecurityGroupNames: props.cacheSecurityGroupNames,
55
+ ...props,
60
56
  cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
61
57
  clusterName: `${id}-${scope.props.stage}`,
62
- engine: props.engine,
63
- engineVersion: props.engineVersion,
64
- logDeliveryConfigurations: logDeliveryConfigurations,
65
- numCacheNodes: props.numCacheNodes,
66
- port: props.port,
67
- preferredAvailabilityZones: props.preferredAvailabilityZones,
68
- preferredMaintenanceWindow: props.preferredMaintenanceWindow,
69
- snapshotArns: props.snapshotArns,
70
- snapshotName: props.snapshotName,
71
- snapshotRetentionLimit: props.snapshotRetentionLimit,
72
- snapshotWindow: props.snapshotWindow,
58
+ logDeliveryConfigurations,
73
59
  vpcSecurityGroupIds: securityGroupIds,
74
60
  });
75
61
  elasticacheCluster.addDependency(subnetGroup);
@@ -96,27 +82,11 @@ class ElastiCacheManager {
96
82
  throw `ElastiCache props undefined for ${id}`;
97
83
  const subnetGroup = this.createElastiCacheSubnetGroup(`${id}-subnetGroup`, scope, subnetIds);
98
84
  const elasticacheCluster = new aws_elasticache_1.CfnReplicationGroup(scope, `${id}`, {
99
- autoMinorVersionUpgrade: props.autoMinorVersionUpgrade,
100
- automaticFailoverEnabled: props.automaticFailoverEnabled,
101
- cacheNodeType: props.cacheNodeType,
102
- cacheParameterGroupName: props.cacheParameterGroupName,
103
- cacheSecurityGroupNames: props.cacheSecurityGroupNames,
85
+ ...props,
104
86
  cacheSubnetGroupName: subnetGroup.cacheSubnetGroupName,
105
- engine: props.engine,
106
- engineVersion: props.engineVersion,
107
- globalReplicationGroupId: props.globalReplicationGroupId,
108
- logDeliveryConfigurations: props.logDeliveryConfigurations,
109
- multiAzEnabled: props.multiAzEnabled,
110
- numCacheClusters: props.numCacheClusters,
111
- numNodeGroups: props.numNodeGroups,
112
- port: props.port,
113
- preferredCacheClusterAZs: props.preferredCacheClusterAZs,
114
- preferredMaintenanceWindow: props.preferredMaintenanceWindow,
115
- primaryClusterId: props.primaryClusterId,
116
- replicasPerNodeGroup: props.replicasPerNodeGroup,
117
87
  replicationGroupDescription: `${id} Redis Replication Cluster`,
118
88
  replicationGroupId: `${id}-${scope.props.stage}`,
119
- securityGroupIds: securityGroupIds,
89
+ securityGroupIds,
120
90
  });
121
91
  elasticacheCluster.addDependency(subnetGroup);
122
92
  return elasticacheCluster;
@@ -38,6 +38,7 @@ class EventManager {
38
38
  if (!props)
39
39
  throw `EventBus props undefined for ${id}`;
40
40
  const eventBus = new aws_events_1.EventBus(scope, `${id}`, {
41
+ ...props,
41
42
  eventBusName: `${props.eventBusName}-${scope.props.stage}`,
42
43
  });
43
44
  (0, utils_1.createCfnOutput)(`${id}-eventBusName`, scope, `${props.eventBusName}-${scope.props.stage}`);
@@ -56,12 +57,9 @@ class EventManager {
56
57
  if (!props)
57
58
  throw `EventRule props undefined for ${id}`;
58
59
  const rule = new aws_events_1.Rule(scope, `${id}`, {
59
- description: props.description,
60
- enabled: props.enabled,
61
- eventBus: eventBus,
62
- eventPattern: props.eventPattern,
60
+ ...props,
61
+ eventBus,
63
62
  ruleName: `${props.ruleName}-${scope.props.stage}`,
64
- schedule: props.schedule,
65
63
  });
66
64
  if (targets && !lodash_1.default.isEmpty(targets)) {
67
65
  lodash_1.default.forEach(targets, target => {
@@ -91,12 +89,12 @@ class EventManager {
91
89
  if (!props)
92
90
  throw `EventRule props undefined for ${id}`;
93
91
  const eventRule = new aws_events_1.CfnRule(scope, `${id}`, {
92
+ ...props,
94
93
  description: 'Rule to send notification to lambda function target',
95
- eventBusName: eventBusName,
96
- eventPattern: eventPattern,
94
+ eventBusName,
95
+ eventPattern,
97
96
  name: `${props.name}-${scope.props.stage}`,
98
- scheduleExpression: scheduleExpression,
99
- state: props.state,
97
+ scheduleExpression,
100
98
  targets: [
101
99
  {
102
100
  arn: lambdaFunction.functionArn,
@@ -130,10 +128,10 @@ class EventManager {
130
128
  if (!props)
131
129
  throw `EventRule props undefined for ${id}`;
132
130
  const eventRule = new aws_events_1.CfnRule(scope, `${id}`, {
131
+ ...props,
133
132
  description: 'Rule to send notification on new objects in data bucket to ecs task target',
134
- eventPattern: eventPattern,
133
+ eventPattern,
135
134
  name: `${props.name}-${scope.props.stage}`,
136
- state: props.state,
137
135
  targets: [
138
136
  {
139
137
  arn: cluster.clusterArn,
@@ -166,9 +164,6 @@ class EventManager {
166
164
  const pipeRole = scope.iamManager.createRoleForSqsToSfnPipe(`${id}-role`, scope, sourceQueue.queueArn, targetStepFunction.stateMachineArn);
167
165
  const pipe = new aws_pipes_1.CfnPipe(scope, `${id}`, {
168
166
  ...props,
169
- description: props.description,
170
- enrichment: props.enrichment,
171
- enrichmentParameters: props.enrichmentParameters,
172
167
  name: `${props.name}-${scope.props.stage}`,
173
168
  roleArn: pipeRole.roleArn,
174
169
  source: sourceQueue.queueArn,
@@ -30,16 +30,8 @@ class KmsManager {
30
30
  if (!props)
31
31
  throw `KMS Key props undefined for ${id}`;
32
32
  const key = new aws_kms_1.Key(scope, `${id}`, {
33
- admins: props.admins,
33
+ ...props,
34
34
  alias: `${props.alias}-${scope.props.stage}`,
35
- description: props.description,
36
- enableKeyRotation: props.enableKeyRotation,
37
- enabled: props.enabled,
38
- keySpec: props.keySpec,
39
- keyUsage: props.keyUsage,
40
- pendingWindow: props.pendingWindow,
41
- policy: props.policy,
42
- removalPolicy: props.removalPolicy,
43
35
  });
44
36
  (0, utils_1.createCfnOutput)(`${id}-keyId`, scope, key.keyId);
45
37
  (0, utils_1.createCfnOutput)(`${id}-keyArn`, scope, key.keyArn);
@@ -1,7 +1,7 @@
1
1
  import { ISecurityGroup, IVpc, SubnetSelection } from 'aws-cdk-lib/aws-ec2';
2
2
  import { IAccessPoint } from 'aws-cdk-lib/aws-efs';
3
3
  import { CfnRole, Role } from 'aws-cdk-lib/aws-iam';
4
- import { Alias, AssetCode, DockerImageCode, DockerImageFunction, Function, ILayerVersion, IVersion, LayerVersion } from 'aws-cdk-lib/aws-lambda';
4
+ import { Alias, Architecture, AssetCode, DockerImageCode, DockerImageFunction, Function, ILayerVersion, IVersion, LayerVersion } from 'aws-cdk-lib/aws-lambda';
5
5
  import { CommonConstruct } from '../../common';
6
6
  import { LambdaAliasProps, LambdaEdgeProps, LambdaProps } from './types';
7
7
  /**
@@ -26,8 +26,9 @@ export declare class LambdaManager {
26
26
  * @param id scoped id of the resource
27
27
  * @param scope scope in which this resource is defined
28
28
  * @param code
29
+ * @param architectures
29
30
  */
30
- createLambdaLayer(id: string, scope: CommonConstruct, code: AssetCode): LayerVersion;
31
+ createLambdaLayer(id: string, scope: CommonConstruct, code: AssetCode, architectures?: Architecture[]): LayerVersion;
31
32
  /**
32
33
  * @summary Method to create a lambda function (nodejs)
33
34
  * @param id scoped id of the resource
@@ -35,10 +35,12 @@ class LambdaManager {
35
35
  * @param id scoped id of the resource
36
36
  * @param scope scope in which this resource is defined
37
37
  * @param code
38
+ * @param architectures
38
39
  */
39
- createLambdaLayer(id, scope, code) {
40
+ createLambdaLayer(id, scope, code, architectures) {
40
41
  const lambdaLayer = new aws_lambda_1.LayerVersion(scope, `${id}`, {
41
42
  code: code,
43
+ compatibleArchitectures: architectures ?? [aws_lambda_1.Architecture.ARM_64],
42
44
  compatibleRuntimes: [scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME],
43
45
  description: `${id}`,
44
46
  layerVersionName: `${id}-${scope.props.stage}`,
@@ -73,34 +75,31 @@ class LambdaManager {
73
75
  }
74
76
  const lambdaFunction = new aws_lambda_1.Function(scope, `${id}`, {
75
77
  ...props,
76
- ...{
77
- allowPublicSubnet: !!vpc,
78
- architecture: props.architecture ?? aws_lambda_1.Architecture.ARM_64,
79
- code: code,
80
- deadLetterQueue: deadLetterQueue,
81
- environment: {
82
- LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
83
- ? ''
84
- : scope.ssmManager.readStringParameter(`${id}-sm-ts`, scope, `${systems_manager_1.SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`),
85
- REGION: scope.props.region,
86
- STAGE: scope.props.stage,
87
- ...environment,
88
- },
89
- filesystem: accessPoint ? aws_lambda_1.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
90
- functionName: functionName,
91
- handler: handler || 'index.lambda_handler',
92
- insightsVersion: props.insightsVersion,
93
- layers: layers,
94
- logRetention: scope.props.logRetention ?? props.logRetention,
95
- reservedConcurrentExecutions: props.reservedConcurrentExecutions ?? scope.props.defaultReservedLambdaConcurrentExecutions,
96
- role: role instanceof aws_iam_1.Role ? role : undefined,
97
- runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
98
- securityGroups: securityGroups,
99
- timeout: props.timeoutInSecs ? aws_cdk_lib_1.Duration.seconds(props.timeoutInSecs) : aws_cdk_lib_1.Duration.minutes(15),
100
- tracing: scope.props.defaultTracing ?? props.tracing,
101
- vpc,
102
- vpcSubnets,
78
+ allowPublicSubnet: !!vpc,
79
+ architecture: props.architecture ?? aws_lambda_1.Architecture.ARM_64,
80
+ code,
81
+ deadLetterQueue,
82
+ environment: {
83
+ LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
84
+ ? ''
85
+ : scope.ssmManager.readStringParameter(`${id}-sm-ts`, scope, `${systems_manager_1.SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`),
86
+ REGION: scope.props.region,
87
+ STAGE: scope.props.stage,
88
+ ...environment,
103
89
  },
90
+ filesystem: accessPoint ? aws_lambda_1.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
91
+ functionName,
92
+ handler: handler || 'index.lambda_handler',
93
+ layers,
94
+ logRetention: scope.props.logRetention ?? props.logRetention,
95
+ reservedConcurrentExecutions: props.reservedConcurrentExecutions ?? scope.props.defaultReservedLambdaConcurrentExecutions,
96
+ role: role instanceof aws_iam_1.Role ? role : undefined,
97
+ runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
98
+ securityGroups,
99
+ timeout: props.timeoutInSecs ? aws_cdk_lib_1.Duration.seconds(props.timeoutInSecs) : aws_cdk_lib_1.Duration.minutes(15),
100
+ tracing: scope.props.defaultTracing ?? props.tracing,
101
+ vpc,
102
+ vpcSubnets,
104
103
  });
105
104
  if (lambdaFunction.deadLetterQueue && props.dlq?.retriesEnabled) {
106
105
  lambdaFunction.addEventSource(new aws_lambda_event_sources_1.SqsEventSource(lambdaFunction.deadLetterQueue, {
@@ -173,32 +172,27 @@ class LambdaManager {
173
172
  }
174
173
  const lambdaFunction = new aws_lambda_1.DockerImageFunction(scope, `${id}`, {
175
174
  ...props,
176
- ...{
177
- allowPublicSubnet: !!vpc,
178
- architecture: props.architecture ?? aws_lambda_1.Architecture.ARM_64,
179
- code: code,
180
- deadLetterQueue: deadLetterQueue,
181
- environment: {
182
- LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
183
- ? ''
184
- : scope.ssmManager.readStringParameter(`${id}-sm-ts`, scope, `${systems_manager_1.SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`),
185
- REGION: scope.props.region,
186
- STAGE: scope.props.stage,
187
- ...environment,
188
- },
189
- filesystem: accessPoint ? aws_lambda_1.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
190
- functionName: functionName,
191
- insightsVersion: props.insightsVersion,
192
- logRetention: scope.props.logRetention ?? props.logRetention,
193
- reservedConcurrentExecutions: props.reservedConcurrentExecutions,
194
- role: role instanceof aws_iam_1.Role ? role : undefined,
195
- runtime: props.runtime ?? scope.props.nodejsRuntime ?? common_1.CommonStack.NODEJS_RUNTIME,
196
- securityGroups: securityGroups,
197
- timeout: props.timeoutInSecs ? aws_cdk_lib_1.Duration.seconds(props.timeoutInSecs) : aws_cdk_lib_1.Duration.minutes(1),
198
- tracing: props.tracing,
199
- vpc,
200
- vpcSubnets,
175
+ allowPublicSubnet: !!vpc,
176
+ architecture: props.architecture ?? aws_lambda_1.Architecture.ARM_64,
177
+ code,
178
+ deadLetterQueue,
179
+ environment: {
180
+ LAST_MODIFIED_TS: props.excludeLastModifiedTimestamp
181
+ ? ''
182
+ : scope.ssmManager.readStringParameter(`${id}-sm-ts`, scope, `${systems_manager_1.SsmManager.SECRETS_MODIFIED_TIMESTAMP_PARAM}-${scope.props.stage}`),
183
+ REGION: scope.props.region,
184
+ STAGE: scope.props.stage,
185
+ ...environment,
201
186
  },
187
+ filesystem: accessPoint ? aws_lambda_1.FileSystem.fromEfsAccessPoint(accessPoint, mountPath || '/mnt/msg') : undefined,
188
+ functionName,
189
+ logRetention: scope.props.logRetention ?? props.logRetention,
190
+ role: role instanceof aws_iam_1.Role ? role : undefined,
191
+ securityGroups: securityGroups,
192
+ timeout: props.timeoutInSecs ? aws_cdk_lib_1.Duration.seconds(props.timeoutInSecs) : aws_cdk_lib_1.Duration.minutes(1),
193
+ tracing: props.tracing,
194
+ vpc,
195
+ vpcSubnets,
202
196
  });
203
197
  if (lambdaFunction.deadLetterQueue && props.dlq?.retriesEnabled) {
204
198
  lambdaFunction.addEventSource(new aws_lambda_event_sources_1.SqsEventSource(lambdaFunction.deadLetterQueue, {
@@ -222,17 +216,7 @@ class LambdaManager {
222
216
  throw `Lambda Alias props undefined for ${id}`;
223
217
  const lambdaFunctionAlias = new aws_lambda_1.Alias(scope, `${id}`, {
224
218
  ...props,
225
- ...{
226
- additionalVersions: props.additionalVersions,
227
- aliasName: props.aliasName,
228
- description: props.description,
229
- maxEventAge: props.maxEventAge,
230
- onFailure: props.onFailure,
231
- onSuccess: props.onSuccess,
232
- provisionedConcurrentExecutions: props.provisionedConcurrentExecutions,
233
- retryAttempts: props.retryAttempts,
234
- version: lambdaVersion,
235
- },
219
+ version: lambdaVersion,
236
220
  });
237
221
  (0, utils_1.createCfnOutput)(`${id}-lambdaAliasName`, scope, lambdaFunctionAlias.functionArn);
238
222
  (0, utils_1.createCfnOutput)(`${id}-lambdaAliasArn`, scope, lambdaFunctionAlias.functionName);
@@ -56,7 +56,7 @@ class SecretsManager {
56
56
  async resolveSecretValue(region, secretId, secretKey) {
57
57
  const client = new client_secrets_manager_1.SecretsManagerClient({
58
58
  credentials: (0, utils_1.determineCredentials)(),
59
- region: region,
59
+ region,
60
60
  });
61
61
  const command = new client_secrets_manager_1.GetSecretValueCommand({
62
62
  SecretId: secretId,
@@ -36,8 +36,8 @@ class SnsManager {
36
36
  if (!props)
37
37
  throw `Subscription props undefined for ${id}`;
38
38
  const topic = new aws_sns_1.Topic(scope, id, {
39
+ ...props,
39
40
  displayName: `${props.topicName}-${scope.props.stage}`,
40
- fifo: props.fifo,
41
41
  topicName: `${props.topicName}-${scope.props.stage}`,
42
42
  });
43
43
  if (emails && !lodash_1.default.isEmpty(emails)) {
@@ -58,8 +58,8 @@ class SnsManager {
58
58
  if (!props)
59
59
  throw `Subscription props undefined for ${id}`;
60
60
  const topic = new aws_sns_1.Topic(scope, id, {
61
+ ...props,
61
62
  displayName: `${props.topicName}-${scope.props.stage}`,
62
- fifo: props.fifo,
63
63
  topicName: `${props.topicName}-${scope.props.stage}`,
64
64
  });
65
65
  topic.addSubscription(new aws_sns_subscriptions_1.LambdaSubscription(lambdaFunction));
@@ -36,7 +36,7 @@ class SqsManager {
36
36
  if (!props)
37
37
  throw `Queue props undefined for ${id}`;
38
38
  const queue = new aws_sqs_1.Queue(scope, id, {
39
- contentBasedDeduplication: props.contentBasedDeduplication,
39
+ ...props,
40
40
  dataKeyReuse: props.dataKeyReuseInSecs ? aws_cdk_lib_1.Duration.seconds(props.dataKeyReuseInSecs) : props.dataKeyReuse,
41
41
  deadLetterQueue: !deadLetterQueue
42
42
  ? undefined
@@ -44,14 +44,7 @@ class SqsManager {
44
44
  maxReceiveCount: props.maxReceiveCount ?? 5,
45
45
  queue: deadLetterQueue,
46
46
  },
47
- deduplicationScope: props.deduplicationScope,
48
47
  deliveryDelay: props.deliveryDelayInSecs ? aws_cdk_lib_1.Duration.seconds(props.deliveryDelayInSecs) : undefined,
49
- encryption: props.encryption,
50
- encryptionMasterKey: props.encryptionMasterKey,
51
- fifo: props.fifo,
52
- fifoThroughputLimit: props.fifoThroughputLimit,
53
- maxMessageSizeBytes: props.maxMessageSizeBytes,
54
- queueName: props.queueName,
55
48
  receiveMessageWaitTime: props.receiveMessageWaitTimeInSecs
56
49
  ? aws_cdk_lib_1.Duration.seconds(props.receiveMessageWaitTimeInSecs)
57
50
  : props.receiveMessageWaitTime,
@@ -37,19 +37,11 @@ class S3Manager {
37
37
  const bucketLifecycleRules = [];
38
38
  lodash_1.default.forEach(props.lifecycleRules, lifecycleRule => {
39
39
  bucketLifecycleRules.push({
40
- abortIncompleteMultipartUploadAfter: lifecycleRule.abortIncompleteMultipartUploadAfter,
41
- enabled: lifecycleRule.enabled,
40
+ ...lifecycleRule,
42
41
  expiration: lifecycleRule.expirationInDays ? aws_cdk_lib_1.Duration.days(lifecycleRule.expirationInDays) : undefined,
43
- expirationDate: lifecycleRule.expirationDate,
44
- expiredObjectDeleteMarker: lifecycleRule.expiredObjectDeleteMarker,
45
- id: lifecycleRule.id,
46
42
  noncurrentVersionExpiration: lifecycleRule.noncurrentVersionExpirationInDays
47
43
  ? aws_cdk_lib_1.Duration.days(lifecycleRule.noncurrentVersionExpirationInDays)
48
44
  : undefined,
49
- noncurrentVersionTransitions: lifecycleRule.noncurrentVersionTransitions,
50
- prefix: lifecycleRule.prefix,
51
- tagFilters: lifecycleRule.tagFilters,
52
- transitions: lifecycleRule.transitions,
53
45
  });
54
46
  });
55
47
  return bucketLifecycleRules;
@@ -103,24 +95,13 @@ class S3Manager {
103
95
  logBucket = aws_s3_1.Bucket.fromBucketName(scope, `${id}-logs`, logBucketName);
104
96
  }
105
97
  bucket = new aws_s3_1.Bucket(scope, `${id}-bucket`, {
106
- accessControl: props.accessControl,
107
- autoDeleteObjects: props.autoDeleteObjects,
98
+ ...props,
108
99
  blockPublicAccess: props.blockPublicAccess || aws_s3_1.BlockPublicAccess.BLOCK_ALL,
109
- bucketName: bucketName,
110
- cors: props.cors,
100
+ bucketName,
111
101
  encryption: props.encryption || aws_s3_1.BucketEncryption.S3_MANAGED,
112
- encryptionKey: props.encryptionKey,
113
102
  lifecycleRules: this.determineBucketLifecycleRules(props),
114
- metrics: props.metrics,
115
- objectOwnership: props.objectOwnership,
116
- publicReadAccess: props.publicReadAccess,
117
103
  removalPolicy: props.removalPolicy || aws_cdk_lib_1.RemovalPolicy.RETAIN,
118
104
  serverAccessLogsBucket: logBucket,
119
- serverAccessLogsPrefix: props.serverAccessLogsPrefix,
120
- versioned: props.versioned,
121
- websiteErrorDocument: props.websiteErrorDocument,
122
- websiteIndexDocument: props.websiteIndexDocument,
123
- websiteRoutingRules: props.websiteRoutingRules,
124
105
  });
125
106
  const cfnBucket = bucket.node.defaultChild;
126
107
  cfnBucket.notificationConfiguration = {