Class HttpApiProps
Properties to initialize an instance of HttpApi
.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Apigatewayv2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class HttpApiProps : Object, IHttpApiProps
Syntax (vb)
Public Class HttpApiProps
Inherits Object
Implements IHttpApiProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.HttpAlbIntegration;
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
Constructors
HttpApiProps() |
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. |
Constructors
HttpApiProps()
public HttpApiProps()
Properties
ApiName
Name for the HTTP API resource.
public string ApiName { get; set; }
Property Value
System.String
Remarks
Default: - id of the HttpApi construct.
CorsPreflight
Specifies a CORS configuration for an API.
public ICorsPreflightOptions CorsPreflight { get; set; }
Property Value
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.
public Nullable<bool> CreateDefaultStage { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
DefaultAuthorizationScopes
Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.
public string[] DefaultAuthorizationScopes { get; set; }
Property Value
System.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.
public IHttpRouteAuthorizer DefaultAuthorizer { get; set; }
Property Value
Remarks
Default: - no default authorizer
DefaultDomainMapping
Configure a custom domain with the API mapping resource to the HTTP API.
public IDomainMappingOptions DefaultDomainMapping { get; set; }
Property Value
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).
public HttpRouteIntegration DefaultIntegration { get; set; }
Property Value
Remarks
Default: - none
Description
The description of the API.
public string Description { get; set; }
Property Value
System.String
Remarks
Default: - none
DisableExecuteApiEndpoint
Specifies whether clients can invoke your API using the default endpoint.
public Nullable<bool> DisableExecuteApiEndpoint { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
By default, clients can invoke your API with the default
https://{api_id}.execute-api.{region}.amazonaws.com
endpoint. Enable
this if you would like clients to use your custom domain name.
Default: false execute-api endpoint enabled.