AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

CognitoUserPoolsAuthorizer

Cognito user pools based custom authorizer.

Import

import { CognitoUserPoolsAuthorizer } from 'aws-cdk-lib/aws-apigateway';

Or use the module namespace:

import * as apigateway from 'aws-cdk-lib/aws-apigateway';
// apigateway.CognitoUserPoolsAuthorizer

Properties

Configuration passed to the constructor as CognitoUserPoolsAuthorizerProps.

cognitoUserPoolsRequired
IUserPool[]

The user pools to associate with this authorizer.

authorizerNameOptional
string

An optional human friendly name for the authorizer. Note that, this is not the primary identifier of the authorizer.

Default: - the unique construct ID

identitySourceOptional
string

The request header mapping expression for the bearer token. This is typically passed as part of the header, in which case this should be `method.request.header.Authorizer` where `Authorizer` is the header containing the bearer token.

Default: `IdentitySource.header('Authorization')`

resultsCacheTtlOptional
Duration

How long APIGateway should cache the results. Max 1 hour. Disable caching by setting this to 0.

Default: Duration.minutes(5)

Get the Amazon API Gateway Cheat Sheet

Everything you need to know about Amazon API Gateway on one page. HD quality, print-friendly.

Download Free Infographic