Describe the feature
I'd like the ability to specify usage of a bundling image for a particular CPU architecture. As an example, for a Java build, rather than saying:
builder_options = BundlingOptions(
command=packaging_instructions,
image=aws_lambda.Runtime.JAVA_11.bundling_image,
user="root",
output_type=BundlingOutput.ARCHIVED,
)
Which uses the architecture of the machine I'm building on, I'd like to be able to say something like:
builder_options = BundlingOptions(
command=packaging_instructions,
image=aws_lambda.Runtime.JAVA_11.bundling_image_for(aws_lambda.Architecture.X86_64),
user="root",
output_type=BundlingOutput.ARCHIVED,
)
Use Case
We use a Java library that doesn't work on ARM. We deploy to x86_64 Lambda, so this shouldn't be a problem. But in order to ensure builds on M1/M2 Mac work, we need to force the Docker image we use for Java to be an x86_64 image.
I'm currently using
builder_options = BundlingOptions(
command=packaging_instructions,
image=aws_lambda.Runtime('java11:latest-x86_64', aws_lambda.RuntimeFamily.JAVA).bundling_image,
user="root",
output_type=BundlingOutput.ARCHIVED,
)
As a workaround, but it'd be nice to be able to use the aws_lambda.Runtime and aws_lambda.Architecture constants.
I learned about this workaround from #18696 (comment)
Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
2.26.0, Python
Environment details (OS name and version, etc.)
Ubuntu 20.04 on WSL 2 within Windows 10.0.19044
Describe the feature
I'd like the ability to specify usage of a bundling image for a particular CPU architecture. As an example, for a Java build, rather than saying:
Which uses the architecture of the machine I'm building on, I'd like to be able to say something like:
Use Case
We use a Java library that doesn't work on ARM. We deploy to x86_64 Lambda, so this shouldn't be a problem. But in order to ensure builds on M1/M2 Mac work, we need to force the Docker image we use for Java to be an x86_64 image.
I'm currently using
As a workaround, but it'd be nice to be able to use the
aws_lambda.Runtimeandaws_lambda.Architectureconstants.I learned about this workaround from #18696 (comment)
Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
2.26.0, Python
Environment details (OS name and version, etc.)
Ubuntu 20.04 on WSL 2 within Windows 10.0.19044