Show / Hide Table of Contents

Interface IHttpApiProps

Properties to initialize an instance of HttpApi.

Namespace: Amazon.CDK.AWS.Apigatewayv2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IHttpApiProps
Syntax (vb)
Public Interface IHttpApiProps
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK.AwsApigatewayv2Integrations;

            ApplicationLoadBalancer lb;

            var listener = lb.AddListener("listener", new BaseApplicationListenerProps { Port = 80 });
            listener.AddTargets("target", new AddApplicationTargetsProps {
                Port = 80
            });

            var httpEndpoint = new HttpApi(this, "HttpProxyPrivateApi", new HttpApiProps {
                DefaultIntegration = new HttpAlbIntegration("DefaultIntegration", listener, new HttpAlbIntegrationProps {
                    ParameterMapping = new ParameterMapping().Custom("myKey", "myValue")
                })
            });

Synopsis

Properties

ApiName

Name for the HTTP API resource.

CorsPreflight

Specifies a CORS configuration for an API.

CreateDefaultStage

Whether a default stage and deployment should be automatically created.

DefaultAuthorizationScopes

Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.

DefaultAuthorizer

Default Authorizer applied to all routes in the gateway.

DefaultDomainMapping

Configure a custom domain with the API mapping resource to the HTTP API.

DefaultIntegration

An integration that will be configured on the catch-all route ($default).

Description

The description of the API.

DisableExecuteApiEndpoint

Specifies whether clients can invoke your API using the default endpoint.

IpAddressType

The IP address types that can invoke the API.

RouteSelectionExpression

Whether to set the default route selection expression for the API.

Properties

ApiName

Name for the HTTP API resource.

string? ApiName { get; }
Property Value

string

Remarks

Default: - id of the HttpApi construct.

CorsPreflight

Specifies a CORS configuration for an API.

ICorsPreflightOptions? CorsPreflight { get; }
Property Value

ICorsPreflightOptions

Remarks

Default: - CORS disabled.

See: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html

CreateDefaultStage

Whether a default stage and deployment should be automatically created.

bool? CreateDefaultStage { get; }
Property Value

bool?

Remarks

Default: true

DefaultAuthorizationScopes

Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.

string[]? DefaultAuthorizationScopes { get; }
Property Value

string[]

Remarks

The scopes are used with a COGNITO_USER_POOLS authorizer to authorize the method invocation.

Default: - no default authorization scopes

DefaultAuthorizer

Default Authorizer applied to all routes in the gateway.

IHttpRouteAuthorizer? DefaultAuthorizer { get; }
Property Value

IHttpRouteAuthorizer

Remarks

Default: - no default authorizer

DefaultDomainMapping

Configure a custom domain with the API mapping resource to the HTTP API.

IDomainMappingOptions? DefaultDomainMapping { get; }
Property Value

IDomainMappingOptions

Remarks

Default: - no default domain mapping configured. meaningless if createDefaultStage is false.

DefaultIntegration

An integration that will be configured on the catch-all route ($default).

HttpRouteIntegration? DefaultIntegration { get; }
Property Value

HttpRouteIntegration

Remarks

Default: - none

Description

The description of the API.

string? Description { get; }
Property Value

string

Remarks

Default: - none

DisableExecuteApiEndpoint

Specifies whether clients can invoke your API using the default endpoint.

bool? DisableExecuteApiEndpoint { get; }
Property Value

bool?

Remarks

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.

Default: false execute-api endpoint enabled.

IpAddressType

The IP address types that can invoke the API.

IpAddressType? IpAddressType { get; }
Property Value

IpAddressType?

Remarks

Default: undefined - AWS default is IPV4

See: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-ip-address-type.html

RouteSelectionExpression

Whether to set the default route selection expression for the API.

bool? RouteSelectionExpression { get; }
Property Value

bool?

Remarks

When enabled, "${request.method} ${request.path}" is set as the default route selection expression.

Default: false

Back to top Generated by DocFX