Class HttpLambdaAuthorizerProps
(experimental) Properties to initialize HttpTokenAuthorizer.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.APIGatewayv2.Authorizers
Assembly: Amazon.CDK.AWS.APIGatewayv2.Authorizers.dll
Syntax (csharp)
public class HttpLambdaAuthorizerProps : Object, IHttpLambdaAuthorizerProps
Syntax (vb)
Public Class HttpLambdaAuthorizerProps
Inherits Object
Implements IHttpLambdaAuthorizerProps
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.APIGatewayv2.Authorizers;
using Amazon.CDK.AWS.APIGatewayv2.Integrations;
// This function handles your auth logic
Function authHandler;
var authorizer = new HttpLambdaAuthorizer("BooksAuthorizer", authHandler, new HttpLambdaAuthorizerProps {
ResponseTypes = new [] { HttpLambdaResponseType.SIMPLE }
});
var api = new HttpApi(this, "HttpApi");
api.AddRoutes(new AddRoutesOptions {
Integration = new HttpUrlIntegration("BooksIntegration", "https://get-books-proxy.myproxy.internal"),
Path = "/books",
Authorizer = authorizer
});
Synopsis
Constructors
HttpLambdaAuthorizerProps() |
Properties
AuthorizerName | (experimental) Friendly authorizer name. |
IdentitySource | (experimental) The identity source for which authorization is requested. |
ResponseTypes | (experimental) The types of responses the lambda can return. |
ResultsCacheTtl | (experimental) How long APIGateway should cache the results. |
Constructors
HttpLambdaAuthorizerProps()
public HttpLambdaAuthorizerProps()
Properties
AuthorizerName
(experimental) Friendly authorizer name.
public string AuthorizerName { get; set; }
Property Value
System.String
Remarks
Default: - same value as id
passed in the constructor.
Stability: Experimental
IdentitySource
(experimental) The identity source for which authorization is requested.
public string[] IdentitySource { get; set; }
Property Value
System.String[]
Remarks
Default: ['$request.header.Authorization']
Stability: Experimental
ResponseTypes
(experimental) The types of responses the lambda can return.
public HttpLambdaResponseType[] ResponseTypes { get; set; }
Property Value
Remarks
If HttpLambdaResponseType.SIMPLE is included then response format 2.0 will be used.
Default: [HttpLambdaResponseType.IAM]
Stability: Experimental
ResultsCacheTtl
(experimental) How long APIGateway should cache the results.
public Duration ResultsCacheTtl { get; set; }
Property Value
Remarks
Max 1 hour.
Disable caching by setting this to Duration.seconds(0)
.
Default: Duration.minutes(5)
Stability: Experimental