Re-creating a secret fails: `InvalidRequestException: You can't create this secret because a secret with this name is already scheduled for deletion.`
BeginnerTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer
Likely causes → A secret with that name was deleted with a recovery window (7–30 days) and is still recoverable. This often happens in IaC teardown and re-create cycles.
Diagnose →
aws secretsmanager describe-secret --secret-id dev/api-key --query '[Name,DeletedDate]'
Fix →
- To reuse it, restore it:
aws secretsmanager restore-secret --secret-id dev/api-key - For dev only, force deletion now:
aws secretsmanager delete-secret --secret-id dev/api-key --force-delete-without-recovery
Prevent → For ephemeral environments, set recovery_window_in_days = 0 in Terraform, and keep a 30-day window in production.
More on CloudFormation, CloudWatch, KMS, Secrets and Cost
Updating a stack fails: `Stack:arn:aws:cloudformation:...:stack/app/... is in ROLLBACK_COMPLETE state and can not be updated.`BeginnerA stack is stuck in `UPDATE_ROLLBACK_FAILED`.AdvancedA pipeline fails with `An error occurred (ValidationError) when calling the UpdateStack operation: No updates are to be performed.`Beginner`InsufficientCapabilitiesException: Requires capabilities : [CAPABILITY_NAMED_IAM]`.BeginnerStack deletion ends in `DELETE_FAILED` with `The bucket you tried to delete is not empty` on an S3 bucket resource.IntermediateDrift detection shows `MODIFIED` on a security group and an RDS instance that someone changed in the console. How do you reconcile?Advanced