Hey guys, After successfully deploying the stack I...
# help
a
Hey guys, After successfully deploying the stack I updated on of the functions that creates a version when deployed and set
reservedConcurrentExecutions
on it. When I try to redeploy it throws an error like this
edge-sst-mindful-messaging-stack | CREATE_FAILED | AWS::Lambda::Version | MessagePullerCurrentVersionF74C4E4D82a6baf6afb38c37b61b1594580ea007 A version for this Lambda function exists ( 34 ). Modify the function to create a new version.
Do I have to remove the whole stack and redeploy for this change or there is a better way to do that?
I was able to deploy after manually removing the current version of the function, wondering if that would be something sst can handle instead?
f
Oh that’s weird. I think CDK should’ve handled this.
Can you try adding this to ur cdk.context.json?
Copy code
"@aws-cdk/aws-lambda:recognizeVersionProps": true
If you don’t have a cdk.context.json in ur app root, you can add one with the following content:
Copy code
{
  "@aws-cdk/aws-lambda:recognizeVersionProps": true
}
Give it a try and see if the error happens again the next time you deploy.
a
@Frank thanks, I'll give it a try. I have
cdk.context.json
but that's being automatically created every time the project is built because of the vpc configuration. So I guess if I put something in it it shouldn't persist. I'll give it a try later though, that's not something too urgent since we are not setting reserved concurrency on any versioned lambdas. I was just playing around when I noticed that.
f
You should commit
cdk.context.json
. The file should persist, not meant to be regenerated every time.
For example it saves the VPC config, so if AWS were to add a new AZ in ur region, u don’t automatically get a new subnet all of a sudden.
a
Thanks @Frank, I've committed that already