需要对账户***执行AWS调用,但尚未配置凭证GITHUB ACTIONS

问题描述 投票:0回答:1

我正在运行一个非常简单的 github 操作脚本(见下文)。它一直工作得很好(昨天还工作),但现在突然失败了:

  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.

这是正在运行的 yml:

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 }}

我检查了我的 github 机密,它们看起来很好,它们在过去 4 个月内没有更改,我还检查了我的 aws 凭证,它们仍然处于活动状态并正在工作。那里也没有变化。

amazon-web-services github-actions aws-credentials
1个回答
0
投票

我们在 Azure DevOps 上看到了非常相似的东西。我们在 GitHub 上发现了一个涵盖该问题的问题,并发现最新版本的 aws-cdk NPM 软件包已被弃用

我们的构建在之前的版本中再次开始成功。

© www.soinside.com 2019 - 2024. All rights reserved.