CDK app that deploys a Lambda function that gets invoked by a Step Functions state machine in another AWS account. The project is meant to showcase the newly added cross‑account access for AWS Step Functions.
- AWS:
- Must have completed the steps detailed in the Configuration section.
- Node.js + npm:
- Must be installed in your system.
- Poetry:
- Must be installed in your system.
Set the following variables in your local environment:
CDK_ACCOUNT_SRC- The AWS account ID for the source stack (e.g.123456789012)CDK_REGION_SRC- The AWS region for the source stack (e.g.us-east-1)CDK_ACCOUNT_TRG- The AWS account ID for the target stack (e.g.123456789012)CDK_REGION_TRG- The AWS region for the target stack (e.g.us-east-1)
After that, complete the CDK bootstrapping process for both the SRC and TRG accounts.
-
Execute the command below with a user having admin privileges in the
SRCaccount:cdk bootstrap aws://$CDK_ACCOUNT_SRC/$CDK_REGION_SRC
-
Execute the command below with a user having admin privileges in the
TRGaccount:cdk bootstrap aws://$CDK_ACCOUNT_TRG/$CDK_REGION_TRG --trust $CDK_ACCOUNT_SRC --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess
npx projen installExecute the command below as admin of the SRC account:
npx projen deploy --all --require-approval neverExecute the command below as admin of the SRC account:
npx projen destroy --all --force