If you simply use the command:
cdk bootstrap
in an unbootstrapped environment, you would likely receive an error such as:
Specify an environment name like ‘aws://123456789012/us-east-1’, or run in a directory with ‘cdk.json’.
A CDK environment consists of an AWS account + AWS region which you have bootstrapped to allow using the CDK to deploy resources.
Therefore, you could provide the cdk bootstrap command with
the path of the environment in which you wish to deploy resources.
AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
echo $AWS_ACCOUNT_ID
echo $AWS_REGION
echo aws://$AWS_ACCOUNT_ID/$AWS_REGION
cdk bootstrap aws://$AWS_ACCOUNT_ID/$AWS_REGION
How was the value of AWS_REGION chosen by AWS CloudShell?