AWS Lambda currently offers a choice of two CPU architectures: x86_64 and arm64. In some cases, the deployment package may not need to be changed in order to work with one architecture instead of another (it may work with either one). Also, the package might be specifically for the other architecture, and switching the architecture may not require a new package to be uploaded.
However, in the management console, the new settings for a Lambda function cannot be saved after the architecture is switched if a new zip file is not also uploaded or an S3 location is provided (this occurs only if the Lambda code was previously uploaded as a zip file).
Steps to reproduce
First, either upload a zip file by clicking "Upload" under "Source code" in the management console or using the AWS CLI:
aws lambda update-function-code --function-name <function-name> --zip-file fileb://<path-to-zip-file>
Then:
- View the Lambda function in the management console
- Under "Runtime settings", click "Edit"
- Change "Architecture"
New fields appear: "Source code location" and "Code source"
The field "Code source" is highlighted in red: "This field is required."
- Click "Upload" under "Code source" and select a zip file on the local file system or select "S3 location" and provide an S3 URL to the source code package under "Amazon S3 link URL"
- Click "Save"
The file will be uploaded and the new architecture setting with take effect.
(If an S3 URL was provided, then the architecture can simply be switched on the next attempt.)
Expected behavior
The "Save" button should always work when simply selecting a different CPU architecture.
I completely understand this angle. I would like to observe, however: