1

So I've created an AWS Lambda using a the AWS CLI. I did this by running the command:

aws lambda create-function 

with the argument

--zip-file fileb://file-path/zipFile.zip 

So then I want to make a change to the source code, so I made a new zip file but the lambda still executes with the old zip file's source code. Thus I tried to run the same command again but got the following error:

Function already exist: FunctionName 

So either I just have to abandon that function and create a new one with the new zip file or there's some way for me to update the existing function to use the new zip file's code.

Is there a way for me to do this update, and if so, how?

1 Answer 1

2

create-function, as the name implies, creates functions. It does not update them with new code. For that you need update-function-code. This also takes a --zip-file argument.

While this updates the code, you may also need to publish a new version of the function for the changes to take effect. This can be done by adding the --publish argument to update-function-code, or as a separate step with the publish-version command.

Sign up to request clarification or add additional context in comments.

1 Comment

For someone like me. Make sure you are using: update-function-code not update-function-configuration.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.