Stop AMI Image from Destroying EC2 #20478
-
In my code, I get the latest Amazon Linux AMI and then create an EC2, 2 months later I then go to edit the code, for example, to change the IAM on the EC2 but this time it destroys the old instance and creates the new one with no warning. I believe it's doing exactly what I say which is to get the latest AMI which triggers a rebuild.
I have now seen that it says in the documentation to be aware of this but I still wonder why it doesn't show up when you do cdk diff? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This should be stored in your
Once this is first looked up and then stored in your cdk.context.json, there won't be any updates made to it unless you manage your context |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
This should be stored in your
cdk.context.json
if you havecachedInContext
enabled:Once this is first looked up and then stored in your cdk.context.json, there won't be any updates made to it unless you manage your context