interface HttpApiProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Apigatewayv2.HttpApiProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2#HttpApiProps |
![]() | software.amazon.awscdk.services.apigatewayv2.HttpApiProps |
![]() | aws_cdk.aws_apigatewayv2.HttpApiProps |
![]() | aws-cdk-lib » aws_apigatewayv2 » HttpApiProps |
Properties to initialize an instance of HttpApi
.
Example
import { HttpAlbIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
declare const lb: elbv2.ApplicationLoadBalancer;
const listener = lb.addListener('listener', { port: 80 });
listener.addTargets('target', {
port: 80,
});
const httpEndpoint = new apigwv2.HttpApi(this, 'HttpProxyPrivateApi', {
defaultIntegration: new HttpAlbIntegration('DefaultIntegration', listener, {
parameterMapping: new apigwv2.ParameterMapping().custom('myKey', 'myValue'),
}),
});
Properties
Name | Type | Description |
---|---|---|
api | string | Name for the HTTP API resource. |
cors | Cors | Specifies a CORS configuration for an API. |
create | boolean | Whether a default stage and deployment should be automatically created. |
default | string[] | Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route. |
default | IHttp | Default Authorizer applied to all routes in the gateway. |
default | Domain | Configure a custom domain with the API mapping resource to the HTTP API. |
default | Http | An integration that will be configured on the catch-all route ($default). |
description? | string | The description of the API. |
disable | boolean | Specifies whether clients can invoke your API using the default endpoint. |
route | boolean | Whether to set the default route selection expression for the API. |
apiName?
Type:
string
(optional, default: id of the HttpApi construct.)
Name for the HTTP API resource.
corsPreflight?
Type:
Cors
(optional, default: CORS disabled.)
Specifies a CORS configuration for an API.
See also: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html
createDefaultStage?
Type:
boolean
(optional, default: true)
Whether a default stage and deployment should be automatically created.
defaultAuthorizationScopes?
Type:
string[]
(optional, default: no default authorization scopes)
Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.
The scopes are used with a COGNITO_USER_POOLS authorizer to authorize the method invocation.
defaultAuthorizer?
Type:
IHttp
(optional, default: no default authorizer)
Default Authorizer applied to all routes in the gateway.
defaultDomainMapping?
Type:
Domain
(optional, default: no default domain mapping configured. meaningless if createDefaultStage
is false
.)
Configure a custom domain with the API mapping resource to the HTTP API.
defaultIntegration?
Type:
Http
(optional, default: none)
An integration that will be configured on the catch-all route ($default).
description?
Type:
string
(optional, default: none)
The description of the API.
disableExecuteApiEndpoint?
Type:
boolean
(optional, default: false execute-api endpoint enabled.)
Specifies whether clients can invoke your API using the default endpoint.
By default, clients can invoke your API with the default
https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. Set this to
true if you would like clients to use your custom domain name.
routeSelectionExpression?
Type:
boolean
(optional, default: false)
Whether to set the default route selection expression for the API.
When enabled, "${request.method} ${request.path}" is set as the default route selection expression.