CognitoAuthorizer
Define a Amazon Cognito User Pool authorizer.
For more information and examples, see Control API access with your AWS SAM template.
Syntax
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
YAML
AuthorizationScopes:ListIdentity:CognitoAuthorizationIdentityUserPoolArn:String | List
Properties
-
List of authorization scopes for this authorizer.
Type: List
Required: No
CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an CloudFormation equivalent.
-
This property can be used to specify an
IdentitySourcein an incoming request for an authorizer.Type: CognitoAuthorizationIdentity
Required: No
CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an CloudFormation equivalent.
-
The Amazon Cognito user pool ARN(s) to use for authorization. Specify a single ARN as a string, or multiple ARNs as a list to use multiple user pools.
Type: String | List
Required: Yes
CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an CloudFormation equivalent.
Examples
CognitoAuth
Cognito Auth Example
YAML
Auth: Authorizers: MyCognitoAuth: AuthorizationScopes: - scope1 - scope2 UserPoolArn: Fn::GetAtt: - MyCognitoUserPool - Arn Identity: Header: MyAuthorizationHeader ValidationExpression: myauthvalidationexpression