Skip to content

Commit

Permalink
issue hashicorp#4449 Fix the issue using Arn field instead of Name
Browse files Browse the repository at this point in the history
  • Loading branch information
saravanan30erd committed May 11, 2018
1 parent 7058b4a commit 38d79b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aws/resource_aws_spot_fleet_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func buildSpotFleetLaunchSpecification(d map[string]interface{}, meta interface{

if v, ok := d["iam_instance_profile"]; ok {
opts.IamInstanceProfile = &ec2.IamInstanceProfileSpecification{
Name: aws.String(v.(string)),
Arn: aws.String(v.(string)),
}
}

Expand Down Expand Up @@ -935,8 +935,8 @@ func launchSpecToMap(l *ec2.SpotFleetLaunchSpecification, rootDevName *string) m
m["monitoring"] = aws.BoolValue(l.Monitoring.Enabled)
}

if l.IamInstanceProfile != nil && l.IamInstanceProfile.Name != nil {
m["iam_instance_profile"] = aws.StringValue(l.IamInstanceProfile.Name)
if l.IamInstanceProfile != nil && l.IamInstanceProfile.Arn != nil {
m["iam_instance_profile"] = aws.StringValue(l.IamInstanceProfile.Arn)
}

if l.UserData != nil {
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/spot_fleet_request.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ resource "aws_spot_fleet_request" "cheap_compute" {
ami = "ami-1234"
spot_price = "2.793"
placement_tenancy = "dedicated"
iam_instance_profile = "arn:aws:iam::12345678:instance-profile/webserver-role"
}
launch_specification {
instance_type = "m4.4xlarge"
ami = "ami-5678"
key_name = "my-key"
spot_price = "1.117"
iam_instance_profile = "arn:aws:iam::12345678:instance-profile/webserver-role"
availability_zone = "us-west-1a"
subnet_id = "subnet-1234"
weighted_capacity = 35
Expand Down

0 comments on commit 38d79b8

Please sign in to comment.