When do I need to have CAPABILITY_NAMED_IAM

Question:

I was editing my CloudFormation templates and suddenly AWS tells me I need CAPABILITY_NAMED_IAM. I am curious as to which change triggers this?

What is a named IAM resource?

Before I already “name” my resources like

I am not asked to add this capability, I think until I add

To my SAM application template. But arent they the “same” except one uses !Ref? Or maybe some other change triggered this?

For reference, my CodePipeline stack

The part of SAM stack (sam.yml) changed recently

Answer:

When are CAPABILITY_IAM/CAPABILITY_NAMED_IAM Required

According to CloudFormation CreateStack Parameters, one of these is required when your Template includes any of the following resource types:

When to use CAPABILITY_NAMED_IAM instead of CAPABILITY_IAM

When any of your IAM resources have a custom name, such as a RoleName then CAPABILITY_NAMED_IAM is required.

Why are these required?

The Capabilities are there to ensure you realize that you’re creating IAM resources, that these will modify the permissions on your account, and that you have reviewed these resources and their permissions as necessary.

Leave a Reply