resources/cdk/cognito_scenario_user_pool_with_mfa/README.md
Creates AWS resources for Amazon Cognito scenarios. The scripts in this example create the following resources:
You can use the AWS Cloud Development Kit (AWS CDK) or the AWS Command Line Interface (AWS CLI) to deploy and destroy the resources for this example.
To deploy with the AWS CDK, you must install Node.js and the AWS CDK.
This example was built and tested with AWS CDK 2.29.1.
Deploy AWS resources by running the following at a command prompt in the
resources/cdk/cognito_scenario_user_pool_with_mfa folder:
npm install
cdk deploy
The stack takes a few minutes to deploy. When it completes, it prints output like the following:
Outputs:
doc-example-cognito-scenario-signup-user-with-mfa.ClientId = 123456789eo6cet40krEXAMPLE
doc-example-cognito-scenario-signup-user-with-mfa.UserPoolId = us-west-2_CzEXAMPLE
To deploy with the AWS CLI, you must first install the AWS CLI.
Deploy AWS resources by running the following at a command prompt in the
resources/cdk/cognito_scenario_user_pool_with_mfa folder:
aws cloudformation create-stack --template-body file://setup.yaml --stack-name YOUR_STACK_NAME
Note: The stack name must be unique within an AWS Region and AWS account. You can specify up to 128 characters, and numbers and hyphens are allowed.
The stack takes less than a minute to deploy. You can check status by running the following:
aws cloudformation describe-stacks --stack-name YOUR_STACK_NAME
When the stack is ready, it shows StackStatus of CREATE_COMPLETE.
You can get the outputs from the stack by running the following:
aws cloudformation describe-stacks --stack-name STACK_NAME --query Stacks[0].Outputs --output text
This results in output like the following:
UserPoolId us-west-2_oBEXAMPLE
ClientId 123456789unqtb9jq4bEXAMPLE
After the user pool is created, you can use the AWS Management Console, AWS CLI, or an AWS SDK to manage users or change settings.
You can use the AWS CDK to destroy the resources by running the following:
cdk destroy
You can use the AWS CLI to destroy the resources by running the following:
aws cloudformation delete-stack --stack-name YOUR_STACK_NAME
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0