nx-aws
nx-aws copied to clipboard
Does this package support Github's recommended method of Configuring AWS Credentials (OIDC)?
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, the nx affected test
command doesn't upload any cache to the designated bucket and I get the error Error 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:
`
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- 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]
output-credentials: true
- name: get caller identity 1
run: aws sts get-caller-identity
- name: Set AWS credentials as environment variables
run: |
echo "NXCACHE_AWS_ACCESS_KEY_ID=${{ steps.creds.outputs.aws-access-key-id }}" >> "$GITHUB_ENV"
echo "NXCACHE_AWS_SECRET_ACCESS_KEY=${{ steps.creds.outputs.aws-secret-access-key }}" >> "$GITHUB_ENV"
`