You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:AutoPublishAlias will lead to SAM creating a Lambda::Version with SHA computed based on Function Code configuration. This behaviour is not aligned with Lambda PublishVersion check that can lead into API call failing with error message
409 - Conflict
A version for this Lambda function exists.
This becomes problematic if you deploy the same code into S3 as new object key, SAM will attempt to create new CloudFormation Lambda version, while Lambda will reject that at runtime.
It becomes even more problematic if you use a single CloudFormation template to deploy more then one Lambda function at a time.
Copy the S3 object as new key and update it in the template.
Repeat this step.
Observed result:
The execution fails with stack being rollback due to A version for this Lambda function exists.
Expected result:
The end result that we would like to be able to achieve is to associated with SAM Function the SHA of the deployed code that would grant that the CloudFormation deployment will not be attempting to create new version of Lambda function each time.
i.e. this could be achieved by introducing new attribute like AutoPublishAliasCodeSha256 (or just CodeSha256 for short, though I did not want to confuse it with the existing Lambda::Version CodeSha256).
The text was updated successfully, but these errors were encountered:
Description:
AutoPublishAlias
will lead to SAM creating a Lambda::Version with SHA computed based on FunctionCode
configuration. This behaviour is not aligned with Lambda PublishVersion check that can lead into API call failing with error messageThis becomes problematic if you deploy the same code into S3 as new object key, SAM will attempt to create new CloudFormation Lambda version, while Lambda will reject that at runtime.
It becomes even more problematic if you use a single CloudFormation template to deploy more then one Lambda function at a time.
Steps to reproduce the issue:
sam init && sam deploy
Observed result:
The execution fails with stack being rollback due to
A version for this Lambda function exists.
Expected result:
The end result that we would like to be able to achieve is to associated with SAM Function the SHA of the deployed code that would grant that the CloudFormation deployment will not be attempting to create new version of Lambda function each time.
i.e. this could be achieved by introducing new attribute like
AutoPublishAliasCodeSha256
(or justCodeSha256
for short, though I did not want to confuse it with the existing Lambda::VersionCodeSha256
).The text was updated successfully, but these errors were encountered: