From 9f91c4e8c3712ca0a36cae624e55c4535aa0797a Mon Sep 17 00:00:00 2001 From: Ian Delahorne Date: Tue, 23 Sep 2014 13:06:30 -0500 Subject: [PATCH] Add IAM Instance profile support to AWS instance provider --- builtin/providers/aws/resource_aws_instance.go | 6 ++++++ website/source/docs/providers/aws/r/instance.html.markdown | 2 ++ 2 files changed, 8 insertions(+) diff --git a/builtin/providers/aws/resource_aws_instance.go b/builtin/providers/aws/resource_aws_instance.go index a8d502af9..84918d225 100644 --- a/builtin/providers/aws/resource_aws_instance.go +++ b/builtin/providers/aws/resource_aws_instance.go @@ -117,6 +117,11 @@ func resourceAwsInstance() *schema.Resource { Type: schema.TypeBool, Optional: true, }, + "iam_instance_profile": &schema.Schema{ + Type: schema.TypeString, + ForceNew: true, + Optional: true, + }, }, } } @@ -147,6 +152,7 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error { AssociatePublicIpAddress: associatePublicIPAddress, UserData: []byte(userData), EbsOptimized: d.Get("ebs_optimized").(bool), + IamInstanceProfile: d.Get("iam_instance_profile").(string), } if v := d.Get("security_groups"); v != nil { diff --git a/website/source/docs/providers/aws/r/instance.html.markdown b/website/source/docs/providers/aws/r/instance.html.markdown index bc67d790d..169c0eef6 100644 --- a/website/source/docs/providers/aws/r/instance.html.markdown +++ b/website/source/docs/providers/aws/r/instance.html.markdown @@ -39,6 +39,8 @@ The following arguments are supported: * `source_dest_check` - (Optional) Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true. * `user_data` - (Optional) The user data to provide when launching the instance. +* `iam_instance_profile` - (Optional) The IAM Instance Profile to + launch the instance with. ## Attributes Reference