Skip to content

Commit 4a06ffc

Browse files
author
Jamie Yang
committed
feat(s3-deployment): address PR review comments
- Rename feature flag from 'defaultMemoryLimit' to 'default512MemoryLimit' for clarity - Simplify README documentation to remove feature flag mention since it defaults to true - Simplify JSDoc comment to show '@default 512' without feature flag details - Update all references to use the new feature flag name
1 parent 4a99c01 commit 4a06ffc

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

packages/aws-cdk-lib/aws-s3-deployment/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ new s3deploy.BucketDeployment(this, 'DeployWithSignedPayloads', {
362362

363363
## Size Limits
364364

365-
The default memory limit for the deployment resource is 512MiB when the feature flag `@aws-cdk/aws-s3-deployment:defaultMemoryLimit` is enabled, otherwise 128MiB. If you need to
365+
The default memory limit for the deployment resource is 512MiB. If you need to
366366
copy larger files, you can use the `memoryLimit` configuration to increase the
367367
size of the AWS Lambda resource handler.
368368

packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export interface BucketDeploymentProps {
156156
* If you are deploying large files, you will need to increase this number
157157
* accordingly.
158158
*
159-
* @default 512 when feature flag `@aws-cdk/aws-s3-deployment:defaultMemoryLimit` is enabled, otherwise 128
159+
* @default 512
160160
*/
161161
readonly memoryLimit?: number;
162162

@@ -382,7 +382,7 @@ export class BucketDeployment extends Construct {
382382
lambdaPurpose: 'Custom::CDKBucketDeployment',
383383
timeout: cdk.Duration.minutes(15),
384384
role: props.role,
385-
memorySize: props.memoryLimit ?? (FeatureFlags.of(this).isEnabled(cxapi.S3_DEPLOYMENT_DEFAULT_MEMORY_LIMIT) ? 512 : 128),
385+
memorySize: props.memoryLimit ?? (FeatureFlags.of(this).isEnabled(cxapi.S3_DEPLOYMENT_DEFAULT_512_MEMORY_LIMIT) ? 512 : 128),
386386
ephemeralStorageSize: props.ephemeralStorageSize,
387387
vpc: props.vpc,
388388
vpcSubnets: props.vpcSubnets,

packages/aws-cdk-lib/aws-s3-deployment/test/bucket-deployment.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ test('default memory limit is 128MB when feature flag is disabled', () => {
813813
test('default memory limit is 512MB when feature flag is enabled', () => {
814814
// GIVEN
815815
const stack = new cdk.Stack();
816-
stack.node.setContext('@aws-cdk/aws-s3-deployment:defaultMemoryLimit', true);
816+
stack.node.setContext('@aws-cdk/aws-s3-deployment:default512MemoryLimit', true);
817817
const bucket = new s3.Bucket(stack, 'Dest');
818818

819819
// WHEN

packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Flags come in three types:
107107
| [@aws-cdk/core:explicitStackTags](#aws-cdkcoreexplicitstacktags) | When enabled, stack tags need to be assigned explicitly on a Stack. | 2.205.0 | new default |
108108
| [@aws-cdk/aws-signer:signingProfileNamePassedToCfn](#aws-cdkaws-signersigningprofilenamepassedtocfn) | Pass signingProfileName to CfnSigningProfile | 2.212.0 | fix |
109109
| [@aws-cdk/aws-ecs-patterns:secGroupsDisablesImplicitOpenListener](#aws-cdkaws-ecs-patternssecgroupsdisablesimplicitopenlistener) | Disable implicit openListener when custom security groups are provided | 2.214.0 | new default |
110-
| [@aws-cdk/aws-s3-deployment:defaultMemoryLimit](#aws-cdkaws-s3-deploymentdefaultmemorylimit) | Use 512MB memory for BucketDeployment Lambda function instead of 128MB | V2NEXT | new default |
110+
| [@aws-cdk/aws-s3-deployment:default512MemoryLimit](#aws-cdkaws-s3-deploymentdefault512memorylimit) | Use 512MB memory for BucketDeployment Lambda function instead of 128MB | V2NEXT | new default |
111111

112112
<!-- END table -->
113113

@@ -198,7 +198,7 @@ The following json shows the current recommended set of flags, as `cdk init` wou
198198
"@aws-cdk/s3-notifications:addS3TrustKeyPolicyForSnsSubscriptions": true,
199199
"@aws-cdk/aws-ec2:requirePrivateSubnetsForEgressOnlyInternetGateway": true,
200200
"@aws-cdk/aws-s3:publicAccessBlockedByDefault": true,
201-
"@aws-cdk/aws-s3-deployment:defaultMemoryLimit": true,
201+
"@aws-cdk/aws-s3-deployment:default512MemoryLimit": true,
202202
"@aws-cdk/aws-lambda:useCdkManagedLogGroup": true
203203
}
204204
}
@@ -2279,7 +2279,7 @@ override this behavior.
22792279
**Compatibility with old behavior:** You can pass `openListener: true` explicitly to maintain the old behavior.
22802280

22812281

2282-
### @aws-cdk/aws-s3-deployment:defaultMemoryLimit
2282+
### @aws-cdk/aws-s3-deployment:default512MemoryLimit
22832283

22842284
*Use 512MB memory for BucketDeployment Lambda function instead of 128MB*
22852285

packages/aws-cdk-lib/cx-api/lib/features.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export const EC2_REQUIRE_PRIVATE_SUBNETS_FOR_EGRESSONLYINTERNETGATEWAY = '@aws-c
145145
export const USE_RESOURCEID_FOR_VPCV2_MIGRATION = '@aws-cdk/aws-ec2-alpha:useResourceIdForVpcV2Migration';
146146
export const S3_PUBLIC_ACCESS_BLOCKED_BY_DEFAULT = '@aws-cdk/aws-s3:publicAccessBlockedByDefault';
147147
export const USE_CDK_MANAGED_LAMBDA_LOGGROUP = '@aws-cdk/aws-lambda:useCdkManagedLogGroup';
148-
export const S3_DEPLOYMENT_DEFAULT_MEMORY_LIMIT = '@aws-cdk/aws-s3-deployment:defaultMemoryLimit';
148+
export const S3_DEPLOYMENT_DEFAULT_512_MEMORY_LIMIT = '@aws-cdk/aws-s3-deployment:default512MemoryLimit';
149149

150150
export const FLAGS: Record<string, FlagInfo> = {
151151
//////////////////////////////////////////////////////////////////////
@@ -1696,7 +1696,7 @@ export const FLAGS: Record<string, FlagInfo> = {
16961696
},
16971697

16981698
//////////////////////////////////////////////////////////////////////
1699-
[S3_DEPLOYMENT_DEFAULT_MEMORY_LIMIT]: {
1699+
[S3_DEPLOYMENT_DEFAULT_512_MEMORY_LIMIT]: {
17001700
type: FlagType.ApiDefault,
17011701
summary: 'Use 512MB memory for BucketDeployment Lambda function instead of 128MB',
17021702
detailsMd: `

packages/aws-cdk-lib/cx-api/test/features.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ test('feature flag defaults may not be changed anymore', () => {
5151
[feats.USE_CDK_MANAGED_LAMBDA_LOGGROUP]: false,
5252
[feats.SIGNER_PROFILE_NAME_PASSED_TO_CFN]: false,
5353
[feats.ECS_PATTERNS_SEC_GROUPS_DISABLES_IMPLICIT_OPEN_LISTENER]: false,
54-
[feats.S3_DEPLOYMENT_DEFAULT_MEMORY_LIMIT]: false,
54+
[feats.S3_DEPLOYMENT_DEFAULT_512_MEMORY_LIMIT]: false,
5555

5656
});
5757
});

packages/aws-cdk-lib/recommended-feature-flags.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@
7878
"@aws-cdk/s3-notifications:addS3TrustKeyPolicyForSnsSubscriptions": true,
7979
"@aws-cdk/aws-ec2:requirePrivateSubnetsForEgressOnlyInternetGateway": true,
8080
"@aws-cdk/aws-s3:publicAccessBlockedByDefault": true,
81-
"@aws-cdk/aws-s3-deployment:defaultMemoryLimit": true,
81+
"@aws-cdk/aws-s3-deployment:default512MemoryLimit": true,
8282
"@aws-cdk/aws-lambda:useCdkManagedLogGroup": true
8383
}

0 commit comments

Comments
 (0)