2 Answers
- Newest
- Most votes
- Most comments
0
CloudFormation does not "watch" S3 locations by default. Do you have some automation or Event Bridge Rule that is watching that S3 location? Have you checked the metrics for that rule to see whether it triggered or not?
answered 7 months ago
0
I had the exact same problem.
- Upload a CloudFormation template to S3
- Use it to deploy a CloudFormation stack
- Later on, modify and update the template in S3
- Attempt to use the same S3 URL to deploy a CloudFormation stack
- CloudFormation shows the old template
I added the uploaded template to S3 under a different name and used that S3 URL to create the CloudFormation stack. This time it displays the correct template.
I can only assume that CloudFormation or S3 is caching something. Highly annoying.
answered 4 months ago
Relevant content
- Accepted Answerasked 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated a month ago
Hey danjhd, I do not have Event Bridge configured.
I had a problem with lambda version and changed this, started the script with new version listed in template and run it for the first time in the new account.
After some time I saw that the applied changes were there in S3 bucket (cfn-templates-bucket) but the template is the same as one from before in the cloudformation stack with old version of lambda and it was even deleted because the stack failed because old lambda python version.
I have part in bash script which copies the template to the s3 mentioned before and created template url variable that was used as input for aws cloudformation create-stack.
It may be something to do with timing. Perhaps the S3 copy operation has not completely finished at the time you do the create-stack so it might be using the old file in S3. Using a different file name each time would help you identify this or the "true error". However, i would suggest taking a look at an Event Bridge rule that triggers from S3 object event and have that rule do the create-stack for you. Then you would remove that part from your bash script and just do the upload.