It is not possible to be 100% certain of your problem but based upon the information supplied there are two top options I can think of
- Are you certain you have an IAM Profile linked to the Role? This field requires the name of a Profile and depending on how you created the Role it may not have a profile. You can check if a Profile exists by viewing the role in the IAM console and looking on the far right. It will show the ARN of the IAM profile if one exists
- Are you certain you have the name of the Profile? Depending on how you created the Role/Profile it is possible for the name of the Profile to be slightly different from the name of the Role. Use the IAM console to view the role and therefore the ARN of the Profile to check the name you are using.
Hopefully one of these resolves your problem.
Are you specifying the last part of the ARN of an IAM role? If so, have you ensured that this IAM role also has an InstanceProfile? They could be 2 different things.
Amazon EC2 uses an instance profile as a container for an IAM role. When you create an IAM role using the IAM console, the console creates an instance profile automatically and gives it the same name as the role to which it corresponds. If you use the Amazon EC2 console to launch an instance with an IAM role or to attach an IAM role to an instance, you choose the role based on a list of instance profile names. If you use the AWS CLI, API, or an AWS SDK to create a role, you create the role and instance profile as separate actions, with potentially different names. If you then use the AWS CLI, API, or an AWS SDK to launch an instance with an IAM role or to attach an IAM role to an instance, specify the instance profile nam
You can see your instance profiles by opening a CloudShell session and entering
aws iam list-instance-profiles
I don't see anything wrong with your CloudFormation template. It is working fine from my end. You can check if your template is valid using the CloudFormation designer. Also, ensure you are using a correct IAM Role in the IamInstanceProfile property. The role must be an instance profile and have EC2 in its trusted entities.
What are the AWS::EC2::AvailabilityZone::Name Values?asked 13 days ago
CloudFormation stack creation failing with "Value (IAM Name) for parameter iamInstanceProfile.name is invalid. "asked 12 days ago
How do I access CloudFormation stack name from the Macro Handler?asked 7 days ago
How to append timestamp to s3 bucket name in suffix using cloudformation template?asked a month ago
AWS::EC2::AvailabilityZone::Name Parameter Validation...
CloudFormation reference the userId that is running the Templateasked 3 months ago
CloudFormation stack template failing to receive 1 resource signal during creation of EC2 instanceasked 3 months ago
Did not have IAM permissions to process tags on AWS::EC2::Instance resourceasked a year ago
AWS::EC2::AvailabilityZone::Name parameter validation...
Cloudformation rule doesn't prevent stack creationasked 4 months ago