I'm deploying an AWS lambda using CloudFormation.
In the template I use the flag AutoPublishAlias: v1 which should create a version, add the necessary permissions, and update the alias "v1" to point to the latest version.
When I deploy this change, I get the following error:
A version for this Lambda function exists ( 8 ). Modify the function to create a new version.
I am using CICD. Sometimes I redeploy the same lambda having modified another part of the CloudFormation template (e.g adding the AutoPublishAlias flag).
I thought CloudFormation was supposed to be able to handle this correctly - only updating resources which have changed?
So why am I seeing this error, and is there a workaround other than introducing a dummy code change?