Search code examples
aws-lambdaboto3

publish a version of unchanged lambda function


I am trying to publish a version even if code or config has not changed. As per documentation this is not possible...

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.publish_version

Lambda doesn't publish a version if the function's configuration and code haven't changed since the last version. Use UpdateFunctionCode or UpdateFunctionConfiguration to update the function before publishing a version.

I will like to know if there is any other (unofficial) way to publish a version of unchanged lambda function.


Solution

  • A Lambda alias is the standard way to get a durable additional reference to a function version. A function alias, which has its own ARN, points to a specific version.

    Pass the target version's ARN to the boto3 create_alias method.