@Stability(value=Stable) public static final class RequestAuthorizer.Builder extends Object implements software.amazon.jsii.Builder<RequestAuthorizer>
RequestAuthorizer.| Modifier and Type | Method and Description |
|---|---|
RequestAuthorizer.Builder |
assumeRole(IRole assumeRole)
An optional IAM role for APIGateway to assume before calling the Lambda-based authorizer.
|
RequestAuthorizer.Builder |
authorizerName(String authorizerName)
An optional human friendly name for the authorizer.
|
RequestAuthorizer |
build() |
static RequestAuthorizer.Builder |
create(software.constructs.Construct scope,
String id) |
RequestAuthorizer.Builder |
handler(IFunction handler)
The handler for the authorizer lambda function.
|
RequestAuthorizer.Builder |
identitySources(List<String> identitySources)
An array of request header mapping expressions for identities.
|
RequestAuthorizer.Builder |
resultsCacheTtl(Duration resultsCacheTtl)
How long APIGateway should cache the results.
|
@Stability(value=Stable) public static RequestAuthorizer.Builder create(software.constructs.Construct scope, String id)
scope - This parameter is required.id - This parameter is required.RequestAuthorizer.Builder.@Stability(value=Stable) public RequestAuthorizer.Builder handler(IFunction handler)
The handler must follow a very specific protocol on the input it receives and the output it needs to produce. API Gateway has documented the handler's input specification {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-input.html | here} and output specification {@link https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html | here}.
handler - The handler for the authorizer lambda function. This parameter is required.this@Stability(value=Stable) public RequestAuthorizer.Builder assumeRole(IRole assumeRole)
The IAM role must be assumable by 'apigateway.amazonaws.com'.
Default: - A resource policy is added to the Lambda function allowing apigateway.amazonaws.com to invoke the function.
assumeRole - An optional IAM role for APIGateway to assume before calling the Lambda-based authorizer. This parameter is required.this@Stability(value=Stable) public RequestAuthorizer.Builder authorizerName(String authorizerName)
Note that, this is not the primary identifier of the authorizer.
Default: - the unique construcrt ID
authorizerName - An optional human friendly name for the authorizer. This parameter is required.this@Stability(value=Stable) public RequestAuthorizer.Builder resultsCacheTtl(Duration resultsCacheTtl)
Max 1 hour. Disable caching by setting this to 0.
Default: Duration.minutes(5)
resultsCacheTtl - How long APIGateway should cache the results. This parameter is required.this@Stability(value=Stable) public RequestAuthorizer.Builder identitySources(List<String> identitySources)
Supported parameter types are
Header, Query String, Stage Variable, and Context. For instance, extracting an authorization
token from a header would use the identity source IdentitySource.header('Authorizer').
Note: API Gateway uses the specified identity sources as the request authorizer caching key. When caching is enabled, API Gateway calls the authorizer's Lambda function only after successfully verifying that all the specified identity sources are present at runtime. If a specified identify source is missing, null, or empty, API Gateway returns a 401 Unauthorized response without calling the authorizer Lambda function.
identitySources - An array of request header mapping expressions for identities. This parameter is required.this@Stability(value=Stable) public RequestAuthorizer build()
build in interface software.amazon.jsii.Builder<RequestAuthorizer>Copyright © 2022. All rights reserved.