January 2019
Intermediate to advanced
490 pages
15h 37m
English
The template starts as usual, with a template version and a description:
---AWSTemplateFormatVersion: '2010-09-09'Description: Building Cognito API with AWS CloudFormation
We will then create the RestApi resource, as follows:
Resources: MyFirstRestAPI: Type: AWS::ApiGateway::RestApi Properties: Name: Greeting API Description: API for greeting an user FailOnWarnings: true
Next, we will create an authorizer of the type COGNITO_USER_POOLS:
CustomCognitoAuthorizer: Type: AWS::ApiGateway::Authorizer Properties: Name: FirstCognitoAuthorizer RestApiId: !Ref MyFirstRestAPI Type: COGNITO_USER_POOLS ProviderARNs: - Fn::Sub: - arn:aws:cognito-idp:${AWS::Region}:${AWS::AccountId}:userpool/${UserPoolId} - UserPoolId: !ImportValue ...
Read now
Unlock full access