Creating a Cognito user pool client with CloudFormation template

With AWS CLI commands we had to hardcode the user pool ID, however with CloudFormation template we will reference it from the user pool CloudFormation template from the previous recipe.

We may add a template format version and a description similar to what we did in previous recipes.

The Resources and Outputs sections should look as follows:

Resources:
MyUserPoolClient:
Type: AWS::Cognito::UserPoolClient
Properties:
ClientName: 'My Cognito User Pool Client'
ExplicitAuthFlows:
- ADMIN_NO_SRP_AUTH
RefreshTokenValidity: 30
UserPoolId: !ImportValue MyFirstUserPoolId
Outputs:
ClientId:
Description: 'Cognito user pool Client'
Value: !Ref MyUserPoolClient

Create the CloudFormation stack by executing the aws cloudformation create-stack command. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.34.197