How to name a custom managed policy created using cloudformation template

Solution 1:

Currently is not possible to set a custom name for a IAM managed policy when creating it via CloudFormation. The same applies to IAM roles.

The name pattern will be aways generated like this:

StackName-ResourceName-RandomString

Also, you can check the IAM Managed Policy Guide for the available properties.

Solution 2:

To create a static name that does not append the stack name and stack randomstring, add this to your properties:

"ManagedPolicyName": "myManagedPolicyRocks"