how do I attach an existing amazon policy (ie AmazonEC2FullAccess) to an aws_iam_role

787 views
Skip to first unread message

Gerald DeConto

unread,
Aug 27, 2015, 6:51:27 PM8/27/15
to Terraform
I am working with AWS instances and wanted to attach the AmazonEC2FullAccess policy to the role that will be used by the aws instances, so that I don't have to recreate a policy that already exists

the docs for aws_iam_role, for example, only indicate the use of inline json text (instead of an ARN or id or name) to add a policy. ditto for aws_iam_role_policy and am not clear on what aws_iam_policy_attachment does

any thoughts on how I can do that?

any help appreciated

Paul Hinze

unread,
Sep 8, 2015, 11:08:40 AM9/8/15
to terrafo...@googlegroups.com
Good question!

Terraform does not yet have any built-in facility for importing existing resources, so today you'd need to either lean on an external tool to get terraform to "adopt" that policy, or have Terraform create a second policy that it manages.

For links to strategies external to Terraform and to track the eventual development of a first class `terraform import` feature, see this thread:



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/18779001-f97d-4000-bdb2-ca94e3423a38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages