Open avakil3 opened 3 months ago
@avakil3 I have made this work properly using OIDC flow. I just add a step in my actions before running any build
command
- name: Configure AWS Credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: [INSERT ROLE HERE]
And I dont specify any AWS credentials for the nx-aws-cache
package. I only specify the following on my workflows
NXCACHE_AWS_BUCKET
NXCACHE_AWS_ENCRYPTION_KEY (if you want to encrypt)
It then picks up the AWS credentials and runs properly. It uses the AWS sdk under the hood that works with cached credentials
Github recommends using GitHub's OIDC provider (AssumeRoleWithWebIdentity) to set up AWS credentials: see here.
When setting up AWS credentials this way in Github Actions, I am successfully able to upload a dummy test file to my S3 bucket using a
aws s3 sync
command. However, thenx affected test
command doesn't upload any cache to the designated bucket and I get the errorError checking cache file existence - 403: UnknownError
. However, I was successfully able to get it to work when I added the AWS access key and secret to my Github account as an ENV variable.I was wondering if this package supports this method of AWS credentials setup in Github Actions.
Here is part of the github actions workflow yml that sets the AWS access key and secret:
`
`