IamInstanceRole and CloudFormation

So i hit this small roadbump the other day. I am pretty much discovering CloudFormation, what an awesome tool, but somethings are inconsistent here and there depending on your approach.

The error

So i had this error

... for parameter iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterValue; Request ID: ####)

I was a little stumped at first because well my name is fine:

IamInstanceProfile: "IamInstanceProfile: arn:aws:iam::000000000:instance-profile/ApplicationServerRole"

But what i didn’t know is that the AutoScalingConfiguration does take an ARN while the Instance configuration takes only the name of the IamInstanceProfile like so:

IamInstanceProfile: "ApplicationServerRole"

Thats all folks, hope this saves you a few hours!

One thought on “IamInstanceRole and CloudFormation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.