-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iam_instance_profile behavior when creating aws_instance #1976
Comments
The instance profile you pass to the Shots in the dark here:
|
Thank you! |
I created #2207 to update the aws_instance resource iam_instance_profile documentation. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This issue was originally opened by @schmidlop as hashicorp/terraform#16374. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform v0.10.7
Terraform Configuration Files
Expected Behavior
I was expecting the IAM role corresponding to the
iam_instance_profile
to be assigned to the instance.Actual Behavior
terraform apply
failed with message:Error launching source instance: UnauthorizedOperation: You are not authorized to perform this operation. Encoded authorization failure message:...
Steps to Reproduce
terraform init
terraform apply
Important Factoids
My credentials are in ~/.aws/credentials
The IAM Role does not have permissions to create EC2 instances.
The IAM role grants permissions to read and write a specific s3 bucket to be used as storage for docker registry.
Seems the role is being used to create the instance, rather than my AWS credentials. If I remove the iam_instance_profile attribute - everything is fine except the resulting ec2 instance is not assigned a IAM Role.
Seems like there should be a way to assign an IAM Role to an instance that doesn't have full permissions to EC2...
The text was updated successfully, but these errors were encountered: