Question:121:- A Terraform change spans multiple AWS accounts. How do you reduce risk?
When a Terraform change spans multiple AWS accounts, we reduce risk by using a controlled, phased deployment strategy rather than applying changes to all accounts simultaneously.
1. Maintain separate Terraform state files for Dev, QA, and Production accounts.
2. Use an S3 backend with DynamoDB-based state locking (or the supported S3 lockfile mechanism).
3. Never share the same state file across independent AWS accounts or environments.
4. Enable S3 versioning to recover previous state versions.
5. Configure cross-account role assumption using AWS STS.
6. Avoid using AWS root credentials or long-lived access keys.
7. If something goes wrong, I stop further deployments, analyze the changes, revert the configuration, generate a new plan, and apply corrective changes after approval.
To learn aws&Devops from scratch ping me 9154078579
29 нояб., 06:01
