Support for ECS credentials provider #1033
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses issue #259
Adds the ECS credentials provider to the credentials chain before the EC2RoleProvider when AWS_CREDENTIALS_RELATIVE_UR environment variable is defined.
The code introduced merely mimics aws' defaults: https://github.com/aws/aws-sdk-go/blob/master/aws/defaults/defaults.go#L114
Added 1 new unit test.
I did not find acceptance tests for functions in auth_helpers.go so I believe I don't need to write any for this change...
Instructions to build a fully working terraform binary with this plugin would be appreciated.
I do not know how to point my local terraform checkout to use my locally built terraform-provider-aws. Everything is in my ~/go dir and my GOPATH is configured to point ~/go/bin as instructed. govendor faq didn't help. So far, I've tested the new terraform binary by manually copying auth_helpers.go to the terraform project. I ran the new binary in a container on ECS and it did work:
and got me through making calls to dynamodb and run most of terraform plan (which failed before this change because the instance-profile hasn't enough permissions). But later in the execution, terraform seems to using an older version of the plugin and therefore falls back to the instance-profile role:
Feel free to take over this change.