Bug: Cannot change Lambda architecture without providing a new zip file (in the management console)

1

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"

  • Click "Save"

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.

profile picture
asked a year ago1078 views
1 Answer
0

The challenge here is that while selecting a new architecture may not require a new package it also might require a new package and there's no way for Lambda to determine which way to go. By forcing a new package to upload it highlights that there might be a breaking change. The alternative is to let the code break (if a new package for the architecture is required) which isn't a great experience either.

profile pictureAWS
EXPERT
answered a year ago
  • I completely understand this angle. I would like to observe, however:

    • If the code was previously provided through an S3 URL, the architecture can just be switched (current behavior)
    • The behavior I'm proposing would give the user more control

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions