`InsufficientCapabilitiesException: Requires capabilities : [CAPABILITY_NAMED_IAM]`.
BeginnerTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer
Likely causes → The template creates IAM resources with custom names (RoleName, PolicyName). CloudFormation makes you acknowledge that explicitly. Templates that use Transform macros (SAM) also need CAPABILITY_AUTO_EXPAND.
Diagnose →
grep -nE 'AWS::IAM::|RoleName|Transform' template.yaml
Fix →
aws cloudformation deploy --template-file template.yaml --stack-name app \
--capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND
Prevent → Avoid hard-coded IAM names (let CloudFormation generate them) so you only need CAPABILITY_IAM, and let only reviewed pipelines pass capabilities.
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.`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?AdvancedDeleting or updating a stack fails: `Export network-VpcId cannot be deleted as it is in use by app-stack`.Intermediate