Credential problem for usecase of Github Actions OIDC federated IAM Role
See original GitHub issueThis article AWS federation comes to GitHub Actions explains we can use OIDC federated IAM Role in github actions workflow.
But now I got this error with aws-actions/aws-codebuild-run-build@v1.
Error: No credentials. Try adding @aws-actions/configure-aws-credentials earlier in your job to set up AWS credentials.
Simply comment out this assert, it works well. https://github.com/aws-actions/aws-codebuild-run-build/blob/8945a85e94fd346070a0d8a28da303dbdd80b4bf/code-build.js#L228_L230
assert(
codeBuild.config.credentials && cloudWatchLogs.config.credentials,
"No credentials. Try adding @aws-actions/configure-aws-credentials earlier in your job to set up AWS credentials."
);
so for the moment I suggest just log this not assert but warning.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
OIDC Token claims issue in AWS if we have ... - GitHub
If we want to create an IAM role for main branch and one role for all other branches. The way to do this...
Read more >Same Github Action works on push but not on ...
The problem I'm seeing is that configure-aws-credentials works on push events but fails when triggered by pull_request_review with the message ...
Read more >Cannot match actor tag when using OIDC #306 - GitHub
I'm trying to match the GITHUB_ACTOR in my IAM trust relationship policy and cannot make it work. Is this supposed to work?
Read more >Using aws-role-to-assume causes start to fail #10 - GitHub
Hi, When I use aws-role-to-assume I get: "Error: Credentials could not be loaded, please check your action inputs: Could not load ...
Read more >Configuring OpenID Connect in Amazon Web Services
OpenID Connect (OIDC) allows your GitHub Actions workflows to access resources in Amazon Web Services (AWS), without needing to store the AWS credentials...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@takaaki-inada I’m glad to help. I spent a little more time today and found a much cleaner way to use oidc to get sts aws creds. This has been tested with
aws-actions/aws-codebuild-run-build@v1.0.4
Here is a workaround until this issue is addressed. Not super clean but it does get sts creds with
assume-role-with-web-identity
and works withaws-codebuild-run-build
. I followed the same post AWS federation comes to GitHub Actions for setting up my OIDC provider and IAM role with federated trust policy. Although, I used Terraform instead of CloudFormation.