Class ApiGatewayV2RouterConfig
Configuration settings shared by the AWS Lambda router adapters.
Inherited Members
Namespace: NanoRoute.AwsLambda
Assembly: NanoRoute.AwsLambda.dll
Syntax
public sealed class ApiGatewayV2RouterConfig : RouterConfig
Examples
ApiGatewayV2Router router = builder.CreateRouter(config =>
{
config.LambdaTimeoutBuffer = TimeSpan.FromSeconds(2);
});
Constructors
ApiGatewayV2RouterConfig()
Declaration
public ApiGatewayV2RouterConfig()
Properties
LambdaTimeoutBuffer
Gets or sets the amount of time reserved before the Lambda invocation timeout is reached.
Declaration
public TimeSpan LambdaTimeoutBuffer { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Examples
ApiGatewayV2Router router = builder.CreateRouter(config =>
{
config.LambdaTimeoutBuffer = TimeSpan.FromSeconds(2);
});
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when the assigned value is negative. |
RequestDomain
Gets or sets the host, optionally including a port, used when mapping AWS HTTP API and Lambda Function URL events to RequestUri.
Declaration
public string? RequestDomain { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
When this value is null, the adapter uses requestContext.domainName from the AWS event.
Set this value when your application needs a canonical public host that differs from the event domain name.
Examples
ApiGatewayV2Router router = builder.CreateRouter(config =>
{
config.RequestDomain = "api.example.com";
});
RequestScheme
Gets or sets the URI scheme used when mapping AWS HTTP API and Lambda Function URL events to RequestUri.
Declaration
public string RequestScheme { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
The default is https.
Examples
ApiGatewayV2Router router = builder.CreateRouter(config =>
{
config.RequestScheme = "https";
});
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when the assigned value is null. |