Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provider/aws: Only call replace Iam Instance Profile on existing (#12922
) machines Fixes: #12898 The way aws_instance works is that we call the Create func then the Update func then the Read func. The way the work to implement the change to iam_instance_profile was added meant that when a machine was created with an iam_instance_profile, it would then try and update that iam_instance_profile because the state hadn't been updated at that point We have changed the Update func to only check for the change to iam_instance_profile when it *is an existing machine* - this will solve the problem of those bringing up new machines and getting hit with the permissions error As requested, added a test that adds an IAM Instance Profile from creation ``` % make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSInstance_withIamInstanceProfile' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/03/21 17:51:32 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSInstance_withIamInstanceProfile -timeout 120m === RUN TestAccAWSInstance_withIamInstanceProfile --- PASS: TestAccAWSInstance_withIamInstanceProfile (154.29s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 154.325s ```
- Loading branch information