Prepare Resources
Prepare Resources
- Create a folder: First, create a new folder.
- Open Visual Studio Code: After creating the folder, open it with Visual Studio Code.
- Open Terminal: In Visual Studio Code, select
Terminal from the menu bar to start working.

Create AWS Access Key
To create an AWS Access Key, follow these steps:
- Log in to AWS: Go to the AWS management console and log in with your account.
- Select IAM: In the AWS console, find and select the IAM (Identity and Access Management) service.
- Select IAM User: From the left menu, select IAM users to view the list of users.
- Select user: Find and select the user you created previously (with AdministratorAccess permissions).
- Select Security Credentials: In the user details page, find the ‘Security Credentials’ section.
- Create Access Key: Select Create Access Key to create a new access key.
Note to keep your access key safe and do not share it with others.

- Then, select Command Line Interface (CLI) and check I understand the above recommendation and want to proceed to create an access key.. Select Next.

- Finally, select Create access key.

- You can download the Download.csv file to your personal computer. Then, select Done.

-
Go back to the Visual Studio Code interface:
-
Run aws configure and fill in the information from the Download.csv file.
-
Clone the workshop repository to your personal computer.
-
To clone the repository to your personal computer, run the following command:
git clone https://github.com/AWS-First-Cloud-Journey/aws_cognito_cross_sites.git

- Navigate to the workshop path:
cd aws_cognito_cross_sites
cd cdk

- Install CDK using npm:
npm install -g aws-cdk

- You can verify if the CDK installation was successful via the command:
cdk --version

- Then, you install some necessary libraries,…
npm i @types/node

- Bootstrapping in AWS CloudFormation. Bootstrapping involves deploying an AWS CloudFormation template into a specific AWS environment (account and region). Use the cdk bootstrap command of the AWS CDK Toolkit:
cdk bootstrap aws://ACCOUNT-NUMBER-1/REGION-1 aws://ACCOUNT-NUMBER-2/REGION-2 ...

- Complete CDK initialization.

-
Go to the AWS interface, check the stack in CloudFormation.
- We will see a stack named CDKToolKit
- You can view and learn more about the CDK Tool Kit components.

- Now deploy CDK via the command:
npm run cdk deploy
- After the command completes, you will see the returned results CognitoStack.userPoolClientId and CognitoStack.userPoolId

-
To be sure, verify the infrastructure initialization by CDK is successful.
- Go to the AWS interface and select CloudFormation
- Select CognitoStack and view the Output section.
- Note down the values of userPoolClientId and userPoolId
