diff --git a/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts b/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts index fa7df6a1cbf51..a6e49babc03d7 100644 --- a/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts +++ b/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts @@ -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, @@ -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); -} \ No newline at end of file +} diff --git a/packages/aws-cdk-lib/aws-s3-deployment/test/bucket-deployment.test.ts b/packages/aws-cdk-lib/aws-s3-deployment/test/bucket-deployment.test.ts index 34801b97bb58b..40abe7b9d4e75 100644 --- a/packages/aws-cdk-lib/aws-s3-deployment/test/bucket-deployment.test.ts +++ b/packages/aws-cdk-lib/aws-s3-deployment/test/bucket-deployment.test.ts @@ -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();