Skip to content

Commit

Permalink
Fix #29996: Switch CDKBucketDeployment Lambda architecture to ARM_64
Browse files Browse the repository at this point in the history
  • Loading branch information
eruvanos committed May 2, 2024
1 parent fd3a5e3 commit 66e748e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ export class BucketDeployment extends Construct {
// This is necessary to make the CLI work in ADC regions.
AWS_CA_BUNDLE: '/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem',
},
architecture: lambda.Architecture.ARM_64,
lambdaPurpose: 'Custom::CDKBucketDeployment',
timeout: cdk.Duration.minutes(15),
role: props.role,
Expand Down Expand Up @@ -910,4 +911,4 @@ function sourceConfigEqual(stack: cdk.Stack, a: SourceConfig, b: SourceConfig) {
JSON.stringify(stack.resolve(a.bucket.bucketName)) === JSON.stringify(stack.resolve(b.bucket.bucketName))
&& a.zipObjectKey === b.zipObjectKey
&& a.markers === undefined && b.markers === undefined);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ test('deploy with configured log retention', () => {
Template.fromStack(stack).hasResourceProperties('Custom::LogRetention', { RetentionInDays: 7 });
});

test('deploy lambda with cheapest architecture', () => {
// GIVEN
const stack = new cdk.Stack();
const bucket = new s3.Bucket(stack, 'Dest');

// WHEN
new s3deploy.BucketDeployment(stack, 'Deploy', {
sources: [s3deploy.Source.asset(path.join(__dirname, 'my-website'))],
destinationBucket: bucket,
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { Architectures: ['arm64'] });
});

test('deploy with log group', () => {
// GIVEN
const stack = new cdk.Stack();
Expand Down

0 comments on commit 66e748e

Please sign in to comment.