"The security token included in the request is invalid" for cdk deploy on cloud9

0

Hi, I just did as I always used to do:

  • Create a Cloud9 using Amazon Linux 2
  • upgrade AWS CLI to v2
  • initialize a CDK app and add some sample code
  • I am logged on using a role that has 'AdministratorAccess' policy attached and it is assumed by Cloud9.
  • CDK is bootstrapped.

Running 'cdk deploy' now gives the following error:

current credentials could not be used to assume 'arn:aws:iam::ACCOUNTNUMBER:role/cdk-hnb659fds-deploy-role-ACCOUNTNUMBER-eu-central-1', but are for the right account. Proceeding anyway.

 ❌ Building assets failed: Error: Building Assets Failed: Error: TestStack: The security token included in the request is invalid
    at buildAllStackAssets (/home/ec2-user/.nvm/versions/node/v16.19.1/lib/node_modules/cdk/node_modules/aws-cdk/lib/index.js:362:115279)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async CdkToolkit.deploy (/home/ec2-user/.nvm/versions/node/v16.19.1/lib/node_modules/cdk/node_modules/aws-cdk/lib/index.js:362:142800)
    at async exec4 (/home/ec2-user/.nvm/versions/node/v16.19.1/lib/node_modules/cdk/node_modules/aws-cdk/lib/index.js:417:51795)

Building Assets Failed: Error: TestStack: The security token included in the request is invalid
  • I deleted the CDKToolkit stack and did run 'cdk bootstrap' again, it created the stack again. So apparently this works.
  • Running ' aws sts get-caller-identity' also shows the right role.
  • I also tried on an old instance that was stopped, getting same result.

Ideas?

AWS
Marco
질문됨 일 년 전395회 조회
1개 답변
0

I also encounter same error here in idt not sure why does this happened

loordb
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠