interface HttpAuthorizerProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Apigatewayv2.HttpAuthorizerProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2#HttpAuthorizerProps |
![]() | software.amazon.awscdk.services.apigatewayv2.HttpAuthorizerProps |
![]() | aws_cdk.aws_apigatewayv2.HttpAuthorizerProps |
![]() | aws-cdk-lib » aws_apigatewayv2 » HttpAuthorizerProps |
Properties to initialize an instance of HttpAuthorizer
.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_apigatewayv2 as apigatewayv2 } from 'aws-cdk-lib';
declare const httpApi: apigatewayv2.HttpApi;
const httpAuthorizerProps: apigatewayv2.HttpAuthorizerProps = {
httpApi: httpApi,
identitySource: ['identitySource'],
type: apigatewayv2.HttpAuthorizerType.IAM,
// the properties below are optional
authorizerName: 'authorizerName',
authorizerUri: 'authorizerUri',
enableSimpleResponses: false,
jwtAudience: ['jwtAudience'],
jwtIssuer: 'jwtIssuer',
payloadFormatVersion: apigatewayv2.AuthorizerPayloadVersion.VERSION_1_0,
resultsCacheTtl: cdk.Duration.minutes(30),
};
Properties
Name | Type | Description |
---|---|---|
http | IHttp | HTTP Api to attach the authorizer to. |
identity | string[] | The identity source for which authorization is requested. |
type | Http | The type of authorizer. |
authorizer | string | Name of the authorizer. |
authorizer | string | The authorizer's Uniform Resource Identifier (URI). |
enable | boolean | Specifies whether a Lambda authorizer returns a response in a simple format. |
jwt | string[] | A list of the intended recipients of the JWT. |
jwt | string | The base domain of the identity provider that issues JWT. |
payload | Authorizer | Specifies the format of the payload sent to an HTTP API Lambda authorizer. |
results | Duration | How long APIGateway should cache the results. |
httpApi
Type:
IHttp
HTTP Api to attach the authorizer to.
identitySource
Type:
string[]
The identity source for which authorization is requested.
type
Type:
Http
The type of authorizer.
authorizerName?
Type:
string
(optional, default: id of the HttpAuthorizer construct.)
Name of the authorizer.
authorizerUri?
Type:
string
(optional, default: required for Request authorizer types)
The authorizer's Uniform Resource Identifier (URI).
For REQUEST authorizers, this must be a well-formed Lambda function URI.
enableSimpleResponses?
Type:
boolean
(optional, default: The lambda authorizer must return an IAM policy as its response)
Specifies whether a Lambda authorizer returns a response in a simple format.
If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy.
jwtAudience?
Type:
string[]
(optional, default: required for JWT authorizer typess.)
A list of the intended recipients of the JWT.
A valid JWT must provide an aud that matches at least one entry in this list.
jwtIssuer?
Type:
string
(optional, default: required for JWT authorizer types.)
The base domain of the identity provider that issues JWT.
payloadFormatVersion?
Type:
Authorizer
(optional, default: AuthorizerPayloadVersion.VERSION_2_0 if the authorizer type is HttpAuthorizerType.LAMBDA)
Specifies the format of the payload sent to an HTTP API Lambda authorizer.
resultsCacheTtl?
Type:
Duration
(optional, default: API Gateway will not cache authorizer responses)
How long APIGateway should cache the results.
Max 1 hour.