- Newest
- Most votes
- Most comments
The bot is confusing things. The template shown for the stack is the template you used to create your stack or, if you updated the stack subsequently, the template you used in the latest update that completed.
The template does NOT reflect any changes made to the resources without going through CloudFormation.
As the bot wrote in the latter part of its reply, you have to modify the template manually based on either your own understanding of the changes or the drift details shown by CloudFormation's drift detection, and then update the stack with the template you updated manually.
Edit: I updated the bot's reply to eliminate the confusion.
The template shown for the stack is the latest version of the template used to deploy or update the stack. It does not reflect any changes made directly to the underlying AWS resources, without updating the CloudFormation stack.
For drift detection, CloudFormation compares the actual current state of your resources with the expected state as defined in the currently deployed template for the stack. The drift you're seeing (resources marked as MODIFIED in Stack->Drifts) represents the differences between the original template plus any updates and the current state of your resources.
Regarding your suggestion for a "Update stack with current configuration" feature, AWS doesn't currently offer this as a one-click solution. To update your stack:
- Detect drift on your stack
- Review the drift results
- Manually update your template to incorporate the changes you want to keep
- Update the stack with your modified template
This process allows you to make conscious choices on which changes to keep and which to revert, giving you more control over your infrastructure configuration.
Remember, it's strongly advisable to make changes through CloudFormation rather than directly in the console to keep your infrastructure as code in sync with the actual state of your resources.
Sources
Detect unmanaged configuration changes to stacks and resources with drift detection - AWS CloudFormation
DetectStackDrift - AWS CloudFormation
Performing drift detection on CloudFormation StackSets - AWS CloudFormation
answered 2 years ago
Relevant content
asked 2 years ago

If I understand you correctly, I can execute the "Update stack with current configuration" by: