@aws-cdk_aws-apigatewayv2-authorizers-alpha.HttpUserPoolAuthorizer

class HttpUserPoolAuthorizer ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Authorizers.Alpha.HttpUserPoolAuthorizer
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2authorizersalpha/v2#HttpUserPoolAuthorizer
Javasoftware.amazon.awscdk.services.apigatewayv2.authorizers.alpha.HttpUserPoolAuthorizer
Pythonaws_cdk.aws_apigatewayv2_authorizers_alpha.HttpUserPoolAuthorizer
TypeScript (source)@aws-cdk/aws-apigatewayv2-authorizers-alpha ยป HttpUserPoolAuthorizer

Implements IHttpRouteAuthorizer

Authorize Http Api routes on whether the requester is registered as part of an AWS Cognito user pool.

Example

import * as cognito from 'aws-cdk-lib/aws-cognito';
import { HttpUserPoolAuthorizer } from '@aws-cdk/aws-apigatewayv2-authorizers-alpha';
import { HttpUrlIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';

const userPool = new cognito.UserPool(this, 'UserPool');

const authorizer = new HttpUserPoolAuthorizer('BooksAuthorizer', userPool);

const api = new apigwv2.HttpApi(this, 'HttpApi');

api.addRoutes({
  integration: new HttpUrlIntegration('BooksIntegration', 'https://get-books-proxy.example.com'),
  path: '/books',
  authorizer,
});

Initializer

new HttpUserPoolAuthorizer(id: string, pool: IUserPool, props?: HttpUserPoolAuthorizerProps)

Parameters

  • id string โ€” The id of the underlying construct.
  • pool IUserPool โ€” The user pool to use for authorization.
  • props HttpUserPoolAuthorizerProps โ€” Properties to configure the authorizer.

Initialize a Cognito user pool authorizer to be bound with HTTP route.

Methods

NameDescription
bind(options)๐Ÿ”นBind this authorizer to a specified Http route.

bind(options)๐Ÿ”น

public bind(options: HttpRouteAuthorizerBindOptions): HttpRouteAuthorizerConfig

Parameters

  • options HttpRouteAuthorizerBindOptions

Returns

  • HttpRouteAuthorizerConfig

Bind this authorizer to a specified Http route.