Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(s3-deployment): switch CDKBucketDeployment Lambda architecture to ARM_64 #30042

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(aws-s3-deployment): switch CDKBucketDeployment Lambda architectu…
…re to ARM_64
  • Loading branch information
eruvanos committed May 2, 2024
commit 1cd858713df7cbe455ce533c21dff29193fae470
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
Loading