I am running a very simple github action script (see below). It has always worked perfectly well (it worked yesterday) but now all of a sudden it fails with:
This API will be removed in the next major release.
Warning: aws-cdk-lib.aws_stepfunctions.StateMachineProps#definition is deprecated.
use definitionBody: DefinitionBody.fromChainable()
This API will be removed in the next major release.
⏳ Bootstrapping environment aws://***/us-east-1...
❌ Environment aws://***/us-east-1 failed bootstrapping: Error: Need to perform AWS calls for account ***, but no credentials have been configured
at SdkProvider.forEnvironment (/home/runner/work/tester/tester/node_modules/aws-cdk/lib/index.js:593:5639101)
at async _BootstrapStack.lookup (/home/runner/work/tester/tester/node_modules/aws-cdk/lib/index.js:592:8579)
at async Bootstrapper.modernBootstrap (/home/runner/work/tester/tester/node_modules/aws-cdk/lib/index.js:593:1084)
at async /home/runner/work/tester/tester/node_modules/aws-cdk/lib/index.js:650:1671
Need to perform AWS calls for account ***, but no credentials have been configured
Error: Process completed with exit code 1.
Here is the yml being run:
name: CI/CD
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3 # Updated to the latest version
- name: Set up Node.js
uses: actions/setup-node@v3 # Updated to the latest version
with:
node-version: "20"
- name: Install dependencies
run: |
npm install -g yarn
yarn
- name: Deploy to AWS (prod)
run: |
cd infrastructure
yarn
npx cdk bootstrap --all -c env=prod aws://$PROD_ACCOUNT_ID/us-east-1
npx cdk deploy -c env=prod --require-approval never --all
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
PROD_ACCOUNT_ID: ${{ secrets.PROD_ACCOUNT_ID }}
I checked my github secrets and they look fine, they weren’t changed in the last 4 months, I also checked my aws credentials, they are still active and working. No changes there either.
2
Answers
Thank you Scott Munro for your insight. I added the following to my script and now it works:
We were seeing something very similar on Azure DevOps. We found an issue on GitHub which covers it and saw that the latest version of the aws-cdk NPM package has been deprecated.
Our builds started succeeding again with the previous version.