-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS CodeBuild Task Role Auth Failure #16278
Comments
I'm having the exact same problem with CodeBuild and Terraform 0.10.7, using an S3 back-end.
I can provide any other details if they're needed. |
I am also facing this issue using Terraform with CodeBuild. I would love to remove my workaround:
Any idea when this will be solved for s3 backend? Thanks |
facing the same issue. i'd love to get a proper fix for this |
Seeing the same issue on terraform v0.11.1. |
gonna go ahead and report that I also am seeing this issue on v0.11.1 |
I can confirm this is now working in CodeBuild WITHOUT the pre_build phase I posted above. Terraform 0.11.7 and Terraform AWS provider 1.14.1. Brilliant work 👍 |
Same here, confirmed working with terraform-aws 1.14.1! |
@jch254 @barryoneill I'm still seeing this behavior on CodeBuild with Terraform 0.11.7. Have you seen consistently good behavior since April? As I understand it the error occurs in Terraform core while configuring the S3 backend, before the AWS provider gets installed, so I'm not sure why hashicorp/terraform-provider-aws#1425 would be expected to fix it. |
Yeah, these has been working fine since then. In case it's relevant, in my use case, we ran terraform inside a docker image run from the buildspec, so we still needed to propagate the
|
@barryoneill I'm also running Terraform inside a container, so that's likely my problem. I'll give your solution a try. Thanks for the tip! |
Hi all! The AWS SDK (along with some code shared between the AWS provider and the S3 backend) handles the authentication details here, and we recall that there was a release of it some time ago which added support for automatic authentication in ECS using the As @barryoneill noted, it's important to make sure the |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
0.10.7
Terraform Configuration Files
Debug Output
Crash Output
n/a
Expected Behavior
Everything should run and the
terraform validate
should be successful. The Task Role should be grabbed from theAWS_CONTAINER_CREDENTIALS_RELATIVE_URI
environment variable, like the documentation says.Actual Behavior
Terraform fails to setup the s3 backend.
Steps to Reproduce
Please list the full steps required to reproduce the issue, for example:
setup codebuild
terraform apply
Important Factoids
I am running this in AWS CodeBuild, which means it is using a Task Role since CodeBuild uses ECS under the hood (from my understanding).
Here is my CodeBuild config that produces a failed build, assuming the s3 backend will load from the Task Role environment variable. There is nothing special about it.
Here is my CodeBuild config that produces a successful build using the environment variables workaround. The CodeBuild output is linked in the Debug Output section.
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
The text was updated successfully, but these errors were encountered: