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

class HttpIamAuthorizer 🔹

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

Implements IHttpRouteAuthorizer

Authorize HTTP API Routes with IAM.

Example

import { HttpIamAuthorizer } from '@aws-cdk/aws-apigatewayv2-authorizers-alpha';
import { HttpUrlIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';

declare const principal: iam.AnyPrincipal;

const authorizer = new HttpIamAuthorizer();

const httpApi = new apigwv2.HttpApi(this, 'HttpApi', {
  defaultAuthorizer: authorizer,
});

const routes = httpApi.addRoutes({
  integration: new HttpUrlIntegration('BooksIntegration', 'https://get-books-proxy.example.com'),
  path: '/books/{book}',
});

routes[0].grantInvoke(principal);

Initializer

new HttpIamAuthorizer()

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.