awscdkawsapigatewayv2alpha

package module
v2.0.0-...-7bcaddb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 2

README

AWS::APIGatewayv2 Construct Library


Features Stability
CFN Resources Stable
Higher level constructs for HTTP APIs Experimental
Higher level constructs for Websocket APIs Experimental

CFN Resources: All classes with the Cfn prefix in this module (CFN Resources) are always stable and safe to use.

Experimental: Higher level constructs in this module that are marked as experimental are under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


Table of Contents

Introduction

Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. API developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud. As an API Gateway API developer, you can create APIs for use in your own client applications. Read the Amazon API Gateway Developer Guide.

This module supports features under API Gateway v2 that lets users set up Websocket and HTTP APIs. REST APIs can be created using the @aws-cdk/aws-apigateway module.

HTTP API

HTTP APIs enable creation of RESTful APIs that integrate with AWS Lambda functions, known as Lambda proxy integration, or to any routable HTTP endpoint, known as HTTP proxy integration.

Defining HTTP APIs

HTTP APIs have two fundamental concepts - Routes and Integrations.

Routes direct incoming API requests to backend resources. Routes consist of two parts: an HTTP method and a resource path, such as, GET /books. Learn more at Working with routes. Use the ANY method to match any methods for a route that are not explicitly defined.

Integrations define how the HTTP API responds when a client reaches a specific Route. HTTP APIs support Lambda proxy integration, HTTP proxy integration and, AWS service integrations, also known as private integrations. Learn more at Configuring integrations.

Integrations are available at the aws-apigatewayv2-integrations module and more information is available in that module. As an early example, the following code snippet configures a route GET /books with an HTTP proxy integration all configures all other HTTP method calls to /books to a lambda proxy.

const getBooksIntegration = new HttpProxyIntegration({
  url: 'https://get-books-proxy.myproxy.internal',
});

const booksDefaultFn = new lambda.Function(stack, 'BooksDefaultFn', { ... });
const booksDefaultIntegration = new LambdaProxyIntegration({
  handler: booksDefaultFn,
});

const httpApi = new HttpApi(stack, 'HttpApi');

httpApi.addRoutes({
  path: '/books',
  methods: [ HttpMethod.GET ],
  integration: getBooksIntegration,
});
httpApi.addRoutes({
  path: '/books',
  methods: [ HttpMethod.ANY ],
  integration: booksDefaultIntegration,
});

The URL to the endpoint can be retrieved via the apiEndpoint attribute. By default this URL is enabled for clients. Use disableExecuteApiEndpoint to disable it.

const httpApi = new HttpApi(stack, 'HttpApi', {
  disableExecuteApiEndpoint: true,
});

The defaultIntegration option while defining HTTP APIs lets you create a default catch-all integration that is matched when a client reaches a route that is not explicitly defined.

new HttpApi(stack, 'HttpProxyApi', {
  defaultIntegration: new HttpProxyIntegration({
    url:'http://example.com',
  }),
});
Cross Origin Resource Sharing (CORS)

Cross-origin resource sharing (CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. Enabling CORS will allow requests to your API from a web application hosted in a domain different from your API domain.

When configured CORS for an HTTP API, API Gateway automatically sends a response to preflight OPTIONS requests, even if there isn't an OPTIONS route configured. Note that, when this option is used, API Gateway will ignore CORS headers returned from your backend integration. Learn more about Configuring CORS for an HTTP API.

The corsPreflight option lets you specify a CORS configuration for an API.

new HttpApi(stack, 'HttpProxyApi', {
  corsPreflight: {
    allowHeaders: ['Authorization'],
    allowMethods: [CorsHttpMethod.GET, CorsHttpMethod.HEAD, CorsHttpMethod.OPTIONS, CorsHttpMethod.POST],
    allowOrigins: ['*'],
    maxAge: Duration.days(10),
  },
});
Publishing HTTP APIs

A Stage is a logical reference to a lifecycle state of your API (for example, dev, prod, beta, or v2). API stages are identified by their stage name. Each stage is a named reference to a deployment of the API made available for client applications to call.

Use HttpStage to create a Stage resource for HTTP APIs. The following code sets up a Stage, whose URL is available at https://{api_id}.execute-api.{region}.amazonaws.com/beta.

new HttpStage(stack, 'Stage', {
  httpApi: api,
  stageName: 'beta',
});

If you omit the stageName will create a $default stage. A $default stage is one that is served from the base of the API's URL - https://{api_id}.execute-api.{region}.amazonaws.com/.

Note that, HttpApi will always creates a $default stage, unless the createDefaultStage property is unset.

Custom Domain

Custom domain names are simpler and more intuitive URLs that you can provide to your API users. Custom domain name are associated to API stages.

The code snippet below creates a custom domain and configures a default domain mapping for your API that maps the custom domain to the $default stage of the API.

const certArn = 'arn:aws:acm:us-east-1:111111111111:certificate';
const domainName = 'example.com';

const dn = new DomainName(stack, 'DN', {
  domainName,
  certificate: acm.Certificate.fromCertificateArn(stack, 'cert', certArn),
});

const api = new HttpApi(stack, 'HttpProxyProdApi', {
  defaultIntegration: new LambdaProxyIntegration({ handler }),
  // https://${dn.domainName}/foo goes to prodApi $default stage
  defaultDomainMapping: {
    domainName: dn,
    mappingKey: 'foo',
  },
});

To associate a specific Stage to a custom domain mapping -

api.addStage('beta', {
  stageName: 'beta',
  autoDeploy: true,
  // https://${dn.domainName}/bar goes to the beta stage
  domainMapping: {
    domainName: dn,
    mappingKey: 'bar',
  },
});

The same domain name can be associated with stages across different HttpApi as so -

const apiDemo = new HttpApi(stack, 'DemoApi', {
  defaultIntegration: new LambdaProxyIntegration({ handler }),
  // https://${dn.domainName}/demo goes to apiDemo $default stage
  defaultDomainMapping: {
    domainName: dn,
    mappingKey: 'demo',
  },
});

The mappingKey determines the base path of the URL with the custom domain. Each custom domain is only allowed to have one API mapping with undefined mappingKey. If more than one API mappings are specified, mappingKey will be required for all of them. In the sample above, the custom domain is associated with 3 API mapping resources across different APIs and Stages.

API Stage URL
api $default https://${domainName}/foo
api beta https://${domainName}/bar
apiDemo $default https://${domainName}/demo

You can retrieve the full domain URL with mapping key using the domainUrl property as so -

const demoDomainUrl = apiDemo.defaultStage.domainUrl; // returns "https://example.com/demo"
Managing access

API Gateway supports multiple mechanisms for controlling and managing access to your HTTP API through authorizers.

These authorizers can be found in the APIGatewayV2-Authorizers constructs library.

Metrics

The API Gateway v2 service sends metrics around the performance of HTTP APIs to Amazon CloudWatch. These metrics can be referred to using the metric APIs available on the HttpApi construct. The APIs with the metric prefix can be used to get reference to specific metrics for this API. For example, the method below refers to the client side errors metric for this API.

const api = new apigw.HttpApi(stack, 'my-api');
const clientErrorMetric = api.metricClientError();

Please note that this will return a metric for all the stages defined in the api. It is also possible to refer to metrics for a specific Stage using the metric methods from the Stage construct.

const api = new apigw.HttpApi(stack, 'my-api');
const stage = new HttpStage(stack, 'Stage', {
   httpApi: api,
});
const clientErrorMetric = stage.metricClientError();

Private integrations let HTTP APIs connect with AWS resources that are placed behind a VPC. These are usually Application Load Balancers, Network Load Balancers or a Cloud Map service. The VpcLink construct enables this integration. The following code creates a VpcLink to a private VPC.

const vpc = new ec2.Vpc(stack, 'VPC');
const vpcLink = new VpcLink(stack, 'VpcLink', { vpc });

Any existing VpcLink resource can be imported into the CDK app via the VpcLink.fromVpcLinkId().

const awesomeLink = VpcLink.fromVpcLinkId(stack, 'awesome-vpc-link', 'us-east-1_oiuR12Abd');
Private Integration

Private integrations enable integrating an HTTP API route with private resources in a VPC, such as Application Load Balancers or Amazon ECS container-based applications. Using private integrations, resources in a VPC can be exposed for access by clients outside of the VPC.

These integrations can be found in the APIGatewayV2-Integrations constructs library.

WebSocket API

A WebSocket API in API Gateway is a collection of WebSocket routes that are integrated with backend HTTP endpoints, Lambda functions, or other AWS services. You can use API Gateway features to help you with all aspects of the API lifecycle, from creation through monitoring your production APIs. Read more

WebSocket APIs have two fundamental concepts - Routes and Integrations.

WebSocket APIs direct JSON messages to backend integrations based on configured routes. (Non-JSON messages are directed to the configured $default route.)

Integrations define how the WebSocket API behaves when a client reaches a specific Route. Learn more at Configuring integrations.

Integrations are available in the aws-apigatewayv2-integrations module and more information is available in that module.

To add the default WebSocket routes supported by API Gateway ($connect, $disconnect and $default), configure them as part of api props:

const webSocketApi = new WebSocketApi(stack, 'mywsapi', {
  connectRouteOptions: { integration: new LambdaWebSocketIntegration({ handler: connectHandler }) },
  disconnectRouteOptions: { integration: new LambdaWebSocketIntegration({ handler: disconnetHandler }) },
  defaultRouteOptions: { integration: new LambdaWebSocketIntegration({ handler: defaultHandler }) },
});

new WebSocketStage(stack, 'mystage', {
  webSocketApi,
  stageName: 'dev',
  autoDeploy: true,
});

To retrieve a websocket URL and a callback URL:

const webSocketURL = webSocketStage.url;
// wss://${this.api.apiId}.execute-api.${s.region}.${s.urlSuffix}/${urlPath}
const callbackURL = webSocketStage.callbackUrl;
// https://${this.api.apiId}.execute-api.${s.region}.${s.urlSuffix}/${urlPath}

To add any other route:

const webSocketApi = new WebSocketApi(stack, 'mywsapi');
webSocketApi.addRoute('sendmessage', {
  integration: new LambdaWebSocketIntegration({
    handler: messageHandler,
  }),
});

Documentation

Overview

The CDK Construct Library for AWS::APIGatewayv2

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiMapping_IsConstruct

func ApiMapping_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func ApiMapping_IsResource

func ApiMapping_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func DomainName_IsConstruct

func DomainName_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func DomainName_IsResource

func DomainName_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func HttpApi_IsConstruct

func HttpApi_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func HttpApi_IsResource

func HttpApi_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func HttpAuthorizer_IsConstruct

func HttpAuthorizer_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func HttpAuthorizer_IsResource

func HttpAuthorizer_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func HttpIntegration_IsConstruct

func HttpIntegration_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func HttpIntegration_IsResource

func HttpIntegration_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func HttpRoute_IsConstruct

func HttpRoute_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func HttpRoute_IsResource

func HttpRoute_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func HttpStage_IsConstruct

func HttpStage_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func HttpStage_IsResource

func HttpStage_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func NewApiMapping_Override

func NewApiMapping_Override(a ApiMapping, scope constructs.Construct, id *string, props *ApiMappingProps)

Experimental.

func NewDomainName_Override

func NewDomainName_Override(d DomainName, scope constructs.Construct, id *string, props *DomainNameProps)

Experimental.

func NewHttpApi_Override

func NewHttpApi_Override(h HttpApi, scope constructs.Construct, id *string, props *HttpApiProps)

Experimental.

func NewHttpAuthorizer_Override

func NewHttpAuthorizer_Override(h HttpAuthorizer, scope constructs.Construct, id *string, props *HttpAuthorizerProps)

Experimental.

func NewHttpIntegration_Override

func NewHttpIntegration_Override(h HttpIntegration, scope constructs.Construct, id *string, props *HttpIntegrationProps)

Experimental.

func NewHttpNoneAuthorizer_Override

func NewHttpNoneAuthorizer_Override(h HttpNoneAuthorizer)

Experimental.

func NewHttpRoute_Override

func NewHttpRoute_Override(h HttpRoute, scope constructs.Construct, id *string, props *HttpRouteProps)

Experimental.

func NewHttpStage_Override

func NewHttpStage_Override(h HttpStage, scope constructs.Construct, id *string, props *HttpStageProps)

Experimental.

func NewMappingValue_Override

func NewMappingValue_Override(m MappingValue, value *string)

Experimental.

func NewParameterMapping_Override

func NewParameterMapping_Override(p ParameterMapping)

Experimental.

func NewVpcLink_Override(v VpcLink, scope constructs.Construct, id *string, props *VpcLinkProps)

Experimental.

func NewWebSocketApi_Override

func NewWebSocketApi_Override(w WebSocketApi, scope constructs.Construct, id *string, props *WebSocketApiProps)

Experimental.

func NewWebSocketIntegration_Override

func NewWebSocketIntegration_Override(w WebSocketIntegration, scope constructs.Construct, id *string, props *WebSocketIntegrationProps)

Experimental.

func NewWebSocketRoute_Override

func NewWebSocketRoute_Override(w WebSocketRoute, scope constructs.Construct, id *string, props *WebSocketRouteProps)

Experimental.

func NewWebSocketStage_Override

func NewWebSocketStage_Override(w WebSocketStage, scope constructs.Construct, id *string, props *WebSocketStageProps)

Experimental.

func VpcLink_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func VpcLink_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func WebSocketApi_IsConstruct

func WebSocketApi_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func WebSocketApi_IsResource

func WebSocketApi_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func WebSocketIntegration_IsConstruct

func WebSocketIntegration_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func WebSocketIntegration_IsResource

func WebSocketIntegration_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func WebSocketRoute_IsConstruct

func WebSocketRoute_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func WebSocketRoute_IsResource

func WebSocketRoute_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func WebSocketStage_IsConstruct

func WebSocketStage_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead

func WebSocketStage_IsResource

func WebSocketStage_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

Types

type AddRoutesOptions

type AddRoutesOptions struct {
	// The integration to be configured on this route.
	// Experimental.
	Integration IHttpRouteIntegration `json:"integration"`
	// The path at which all of these routes are configured.
	// Experimental.
	Path *string `json:"path"`
	// The list of OIDC scopes to include in the authorization.
	//
	// These scopes will override the default authorization scopes on the gateway.
	// Set to [] to remove default scopes
	// Experimental.
	AuthorizationScopes *[]*string `json:"authorizationScopes"`
	// Authorizer to be associated to these routes.
	//
	// Use NoneAuthorizer to remove the default authorizer for the api
	// Experimental.
	Authorizer IHttpRouteAuthorizer `json:"authorizer"`
	// The HTTP methods to be configured.
	// Experimental.
	Methods *[]HttpMethod `json:"methods"`
}

Options for the Route with Integration resource. Experimental.

type ApiMapping

type ApiMapping interface {
	awscdk.Resource
	IApiMapping
	ApiMappingId() *string
	DomainName() IDomainName
	Env() *awscdk.ResourceEnvironment
	MappingKey() *string
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

Create a new API mapping for API Gateway API endpoint. Experimental.

func NewApiMapping

func NewApiMapping(scope constructs.Construct, id *string, props *ApiMappingProps) ApiMapping

Experimental.

type ApiMappingAttributes

type ApiMappingAttributes struct {
	// The API mapping ID.
	// Experimental.
	ApiMappingId *string `json:"apiMappingId"`
}

The attributes used to import existing ApiMapping. Experimental.

type ApiMappingProps

type ApiMappingProps struct {
	// The Api to which this mapping is applied.
	// Experimental.
	Api IApi `json:"api"`
	// custom domain name of the mapping target.
	// Experimental.
	DomainName IDomainName `json:"domainName"`
	// Api mapping key.
	//
	// The path where this stage should be mapped to on the domain
	// Experimental.
	ApiMappingKey *string `json:"apiMappingKey"`
	// stage for the ApiMapping resource required for WebSocket API defaults to default stage of an HTTP API.
	// Experimental.
	Stage IStage `json:"stage"`
}

Properties used to create the ApiMapping resource. Experimental.

type AuthorizerPayloadVersion

type AuthorizerPayloadVersion string

Payload format version for lambda authorizers. See: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html

Experimental.

const (
	AuthorizerPayloadVersion_VERSION_1_0 AuthorizerPayloadVersion = "VERSION_1_0"
	AuthorizerPayloadVersion_VERSION_2_0 AuthorizerPayloadVersion = "VERSION_2_0"
)

type BatchHttpRouteOptions

type BatchHttpRouteOptions struct {
	// The integration to be configured on this route.
	// Experimental.
	Integration IHttpRouteIntegration `json:"integration"`
}

Options used when configuring multiple routes, at once.

The options here are the ones that would be configured for all being set up. Experimental.

type CorsHttpMethod

type CorsHttpMethod string

Supported CORS HTTP methods. Experimental.

const (
	CorsHttpMethod_ANY     CorsHttpMethod = "ANY"
	CorsHttpMethod_DELETE  CorsHttpMethod = "DELETE"
	CorsHttpMethod_GET     CorsHttpMethod = "GET"
	CorsHttpMethod_HEAD    CorsHttpMethod = "HEAD"
	CorsHttpMethod_OPTIONS CorsHttpMethod = "OPTIONS"
	CorsHttpMethod_PATCH   CorsHttpMethod = "PATCH"
	CorsHttpMethod_POST    CorsHttpMethod = "POST"
	CorsHttpMethod_PUT     CorsHttpMethod = "PUT"
)

type CorsPreflightOptions

type CorsPreflightOptions struct {
	// Specifies whether credentials are included in the CORS request.
	// Experimental.
	AllowCredentials *bool `json:"allowCredentials"`
	// Represents a collection of allowed headers.
	// Experimental.
	AllowHeaders *[]*string `json:"allowHeaders"`
	// Represents a collection of allowed HTTP methods.
	// Experimental.
	AllowMethods *[]CorsHttpMethod `json:"allowMethods"`
	// Represents a collection of allowed origins.
	// Experimental.
	AllowOrigins *[]*string `json:"allowOrigins"`
	// Represents a collection of exposed headers.
	// Experimental.
	ExposeHeaders *[]*string `json:"exposeHeaders"`
	// The duration that the browser should cache preflight request results.
	// Experimental.
	MaxAge awscdk.Duration `json:"maxAge"`
}

Options for the CORS Configuration. Experimental.

type DomainMappingOptions

type DomainMappingOptions struct {
	// The domain name for the mapping.
	// Experimental.
	DomainName IDomainName `json:"domainName"`
	// The API mapping key.
	//
	// Leave it undefined for the root path mapping.
	// Experimental.
	MappingKey *string `json:"mappingKey"`
}

Options for DomainMapping. Experimental.

type DomainName

type DomainName interface {
	awscdk.Resource
	IDomainName
	Env() *awscdk.ResourceEnvironment
	Name() *string
	Node() constructs.Node
	PhysicalName() *string
	RegionalDomainName() *string
	RegionalHostedZoneId() *string
	Stack() awscdk.Stack
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

Custom domain resource for the API. Experimental.

func NewDomainName

func NewDomainName(scope constructs.Construct, id *string, props *DomainNameProps) DomainName

Experimental.

type DomainNameAttributes

type DomainNameAttributes struct {
	// domain name string.
	// Experimental.
	Name *string `json:"name"`
	// The domain name associated with the regional endpoint for this custom domain name.
	// Experimental.
	RegionalDomainName *string `json:"regionalDomainName"`
	// The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint.
	// Experimental.
	RegionalHostedZoneId *string `json:"regionalHostedZoneId"`
}

custom domain name attributes. Experimental.

type DomainNameProps

type DomainNameProps struct {
	// The ACM certificate for this domain name.
	// Experimental.
	Certificate awscertificatemanager.ICertificate `json:"certificate"`
	// The custom domain name.
	// Experimental.
	DomainName *string `json:"domainName"`
}

properties used for creating the DomainName. Experimental.

type HttpApi

type HttpApi interface {
	awscdk.Resource
	IApi
	IHttpApi
	ApiEndpoint() *string
	ApiId() *string
	DefaultStage() IHttpStage
	DisableExecuteApiEndpoint() *bool
	Env() *awscdk.ResourceEnvironment
	HttpApiId() *string
	HttpApiName() *string
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	Url() *string
	AddRoutes(options *AddRoutesOptions) *[]HttpRoute
	AddStage(id *string, options *HttpStageOptions) HttpStage
	AddVpcLink(options *VpcLinkProps) VpcLink
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricClientError(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricCount(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricDataProcessed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricIntegrationLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricServerError(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	ToString() *string
}

Create a new API Gateway HTTP API endpoint. Experimental.

func NewHttpApi

func NewHttpApi(scope constructs.Construct, id *string, props *HttpApiProps) HttpApi

Experimental.

type HttpApiAttributes

type HttpApiAttributes struct {
	// The identifier of the HttpApi.
	// Experimental.
	HttpApiId *string `json:"httpApiId"`
	// The endpoint URL of the HttpApi.
	// Experimental.
	ApiEndpoint *string `json:"apiEndpoint"`
}

Attributes for importing an HttpApi into the CDK. Experimental.

type HttpApiProps

type HttpApiProps struct {
	// Name for the HTTP API resource.
	// Experimental.
	ApiName *string `json:"apiName"`
	// Specifies a CORS configuration for an API.
	// See: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html
	//
	// Experimental.
	CorsPreflight *CorsPreflightOptions `json:"corsPreflight"`
	// Whether a default stage and deployment should be automatically created.
	// Experimental.
	CreateDefaultStage *bool `json:"createDefaultStage"`
	// Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.
	// Experimental.
	DefaultAuthorizationScopes *[]*string `json:"defaultAuthorizationScopes"`
	// Default Authorizer to applied to all routes in the gateway.
	// Experimental.
	DefaultAuthorizer IHttpRouteAuthorizer `json:"defaultAuthorizer"`
	// Configure a custom domain with the API mapping resource to the HTTP API.
	// Experimental.
	DefaultDomainMapping *DomainMappingOptions `json:"defaultDomainMapping"`
	// An integration that will be configured on the catch-all route ($default).
	// Experimental.
	DefaultIntegration IHttpRouteIntegration `json:"defaultIntegration"`
	// The description of the API.
	// Experimental.
	Description *string `json:"description"`
	// 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. Enable
	// this if you would like clients to use your custom domain name.
	// Experimental.
	DisableExecuteApiEndpoint *bool `json:"disableExecuteApiEndpoint"`
}

Properties to initialize an instance of `HttpApi`. Experimental.

type HttpAuthorizer

type HttpAuthorizer interface {
	awscdk.Resource
	IHttpAuthorizer
	AuthorizerId() *string
	Env() *awscdk.ResourceEnvironment
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

An authorizer for Http Apis. Experimental.

func NewHttpAuthorizer

func NewHttpAuthorizer(scope constructs.Construct, id *string, props *HttpAuthorizerProps) HttpAuthorizer

Experimental.

type HttpAuthorizerAttributes

type HttpAuthorizerAttributes struct {
	// Id of the Authorizer.
	// Experimental.
	AuthorizerId *string `json:"authorizerId"`
	// Type of authorizer.
	//
	// Possible values are:
	// - JWT - JSON Web Token Authorizer
	// - CUSTOM - Lambda Authorizer
	// - NONE - No Authorization
	// Experimental.
	AuthorizerType *string `json:"authorizerType"`
}

Reference to an http authorizer. Experimental.

type HttpAuthorizerProps

type HttpAuthorizerProps struct {
	// HTTP Api to attach the authorizer to.
	// Experimental.
	HttpApi IHttpApi `json:"httpApi"`
	// The identity source for which authorization is requested.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-authorizer.html#cfn-apigatewayv2-authorizer-identitysource
	//
	// Experimental.
	IdentitySource *[]*string `json:"identitySource"`
	// The type of authorizer.
	// Experimental.
	Type HttpAuthorizerType `json:"type"`
	// Name of the authorizer.
	// Experimental.
	AuthorizerName *string `json:"authorizerName"`
	// The authorizer's Uniform Resource Identifier (URI).
	//
	// For REQUEST authorizers, this must be a well-formed Lambda function URI.
	// Experimental.
	AuthorizerUri *string `json:"authorizerUri"`
	// Specifies whether a Lambda authorizer returns a response in a simple format.
	//
	// If enabled, the Lambda authorizer can return a boolean value instead of an IAM policy.
	// Experimental.
	EnableSimpleResponses *bool `json:"enableSimpleResponses"`
	// A list of the intended recipients of the JWT.
	//
	// A valid JWT must provide an aud that matches at least one entry in this list.
	// Experimental.
	JwtAudience *[]*string `json:"jwtAudience"`
	// The base domain of the identity provider that issues JWT.
	// Experimental.
	JwtIssuer *string `json:"jwtIssuer"`
	// Specifies the format of the payload sent to an HTTP API Lambda authorizer.
	// Experimental.
	PayloadFormatVersion AuthorizerPayloadVersion `json:"payloadFormatVersion"`
	// How long APIGateway should cache the results.
	//
	// Max 1 hour.
	// Experimental.
	ResultsCacheTtl awscdk.Duration `json:"resultsCacheTtl"`
}

Properties to initialize an instance of `HttpAuthorizer`. Experimental.

type HttpAuthorizerType

type HttpAuthorizerType string

Supported Authorizer types. Experimental.

const (
	HttpAuthorizerType_JWT    HttpAuthorizerType = "JWT"
	HttpAuthorizerType_LAMBDA HttpAuthorizerType = "LAMBDA"
)

type HttpConnectionType

type HttpConnectionType string

Supported connection types. Experimental.

const (
	HttpConnectionType_VPC_LINK HttpConnectionType = "VPC_LINK"
	HttpConnectionType_INTERNET HttpConnectionType = "INTERNET"
)

type HttpIntegration

type HttpIntegration interface {
	awscdk.Resource
	IHttpIntegration
	Env() *awscdk.ResourceEnvironment
	HttpApi() IHttpApi
	IntegrationId() *string
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

The integration for an API route. Experimental.

func NewHttpIntegration

func NewHttpIntegration(scope constructs.Construct, id *string, props *HttpIntegrationProps) HttpIntegration

Experimental.

type HttpIntegrationProps

type HttpIntegrationProps struct {
	// The HTTP API to which this integration should be bound.
	// Experimental.
	HttpApi IHttpApi `json:"httpApi"`
	// Integration type.
	// Experimental.
	IntegrationType HttpIntegrationType `json:"integrationType"`
	// Integration URI.
	//
	// This will be the function ARN in the case of `HttpIntegrationType.LAMBDA_PROXY`,
	// or HTTP URL in the case of `HttpIntegrationType.HTTP_PROXY`.
	// Experimental.
	IntegrationUri *string `json:"integrationUri"`
	// The ID of the VPC link for a private integration.
	//
	// Supported only for HTTP APIs.
	// Experimental.
	ConnectionId *string `json:"connectionId"`
	// The type of the network connection to the integration endpoint.
	// Experimental.
	ConnectionType HttpConnectionType `json:"connectionType"`
	// The HTTP method to use when calling the underlying HTTP proxy.
	// Experimental.
	Method HttpMethod `json:"method"`
	// Specifies how to transform HTTP requests before sending them to the backend.
	// See: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html
	//
	// Experimental.
	ParameterMapping ParameterMapping `json:"parameterMapping"`
	// The version of the payload format.
	// See: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
	//
	// Experimental.
	PayloadFormatVersion PayloadFormatVersion `json:"payloadFormatVersion"`
	// Specifies the TLS configuration for a private integration.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-integration-tlsconfig.html
	//
	// Experimental.
	SecureServerName *string `json:"secureServerName"`
}

The integration properties. Experimental.

type HttpIntegrationType

type HttpIntegrationType string

Supported integration types. Experimental.

const (
	HttpIntegrationType_LAMBDA_PROXY HttpIntegrationType = "LAMBDA_PROXY"
	HttpIntegrationType_HTTP_PROXY   HttpIntegrationType = "HTTP_PROXY"
)

type HttpMethod

type HttpMethod string

Supported HTTP methods. Experimental.

const (
	HttpMethod_ANY     HttpMethod = "ANY"
	HttpMethod_DELETE  HttpMethod = "DELETE"
	HttpMethod_GET     HttpMethod = "GET"
	HttpMethod_HEAD    HttpMethod = "HEAD"
	HttpMethod_OPTIONS HttpMethod = "OPTIONS"
	HttpMethod_PATCH   HttpMethod = "PATCH"
	HttpMethod_POST    HttpMethod = "POST"
	HttpMethod_PUT     HttpMethod = "PUT"
)

type HttpNoneAuthorizer

type HttpNoneAuthorizer interface {
	IHttpRouteAuthorizer
	Bind(_arg *HttpRouteAuthorizerBindOptions) *HttpRouteAuthorizerConfig
}

Explicitly configure no authorizers on specific HTTP API routes. Experimental.

func NewHttpNoneAuthorizer

func NewHttpNoneAuthorizer() HttpNoneAuthorizer

Experimental.

type HttpRoute

type HttpRoute interface {
	awscdk.Resource
	IHttpRoute
	Env() *awscdk.ResourceEnvironment
	HttpApi() IHttpApi
	Node() constructs.Node
	Path() *string
	PhysicalName() *string
	RouteId() *string
	Stack() awscdk.Stack
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

Route class that creates the Route for API Gateway HTTP API. Experimental.

func NewHttpRoute

func NewHttpRoute(scope constructs.Construct, id *string, props *HttpRouteProps) HttpRoute

Experimental.

type HttpRouteAuthorizerBindOptions

type HttpRouteAuthorizerBindOptions struct {
	// The route to which the authorizer is being bound.
	// Experimental.
	Route IHttpRoute `json:"route"`
	// The scope for any constructs created as part of the bind.
	// Experimental.
	Scope constructs.Construct `json:"scope"`
}

Input to the bind() operation, that binds an authorizer to a route. Experimental.

type HttpRouteAuthorizerConfig

type HttpRouteAuthorizerConfig struct {
	// The type of authorization.
	//
	// Possible values are:
	// - JWT - JSON Web Token Authorizer
	// - CUSTOM - Lambda Authorizer
	// - NONE - No Authorization
	// Experimental.
	AuthorizationType *string `json:"authorizationType"`
	// The list of OIDC scopes to include in the authorization.
	// Experimental.
	AuthorizationScopes *[]*string `json:"authorizationScopes"`
	// The authorizer id.
	// Experimental.
	AuthorizerId *string `json:"authorizerId"`
}

Results of binding an authorizer to an http route. Experimental.

type HttpRouteIntegrationBindOptions

type HttpRouteIntegrationBindOptions struct {
	// The route to which this is being bound.
	// Experimental.
	Route IHttpRoute `json:"route"`
	// The current scope in which the bind is occurring.
	//
	// If the `HttpRouteIntegration` being bound creates additional constructs,
	// this will be used as their parent scope.
	// Experimental.
	Scope constructs.Construct `json:"scope"`
}

Options to the HttpRouteIntegration during its bind operation. Experimental.

type HttpRouteIntegrationConfig

type HttpRouteIntegrationConfig struct {
	// Payload format version in the case of lambda proxy integration.
	// See: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
	//
	// Experimental.
	PayloadFormatVersion PayloadFormatVersion `json:"payloadFormatVersion"`
	// Integration type.
	// Experimental.
	Type HttpIntegrationType `json:"type"`
	// Integration URI.
	// Experimental.
	Uri *string `json:"uri"`
	// The ID of the VPC link for a private integration.
	//
	// Supported only for HTTP APIs.
	// Experimental.
	ConnectionId *string `json:"connectionId"`
	// The type of the network connection to the integration endpoint.
	// Experimental.
	ConnectionType HttpConnectionType `json:"connectionType"`
	// The HTTP method that must be used to invoke the underlying proxy.
	//
	// Required for `HttpIntegrationType.HTTP_PROXY`
	// Experimental.
	Method HttpMethod `json:"method"`
	// Specifies how to transform HTTP requests before sending them to the backend.
	// See: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html
	//
	// Experimental.
	ParameterMapping ParameterMapping `json:"parameterMapping"`
	// Specifies the server name to verified by HTTPS when calling the backend integration.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-integration-tlsconfig.html
	//
	// Experimental.
	SecureServerName *string `json:"secureServerName"`
}

Config returned back as a result of the bind. Experimental.

type HttpRouteKey

type HttpRouteKey interface {
	Key() *string
	Path() *string
}

HTTP route in APIGateway is a combination of the HTTP method and the path component.

This class models that combination. Experimental.

func HttpRouteKey_DEFAULT

func HttpRouteKey_DEFAULT() HttpRouteKey

func HttpRouteKey_With

func HttpRouteKey_With(path *string, method HttpMethod) HttpRouteKey

Create a route key with the combination of the path and the method. Experimental.

type HttpRouteProps

type HttpRouteProps struct {
	// The integration to be configured on this route.
	// Experimental.
	Integration IHttpRouteIntegration `json:"integration"`
	// the API the route is associated with.
	// Experimental.
	HttpApi IHttpApi `json:"httpApi"`
	// The key to this route.
	//
	// This is a combination of an HTTP method and an HTTP path.
	// Experimental.
	RouteKey HttpRouteKey `json:"routeKey"`
	// The list of OIDC scopes to include in the authorization.
	//
	// These scopes will be merged with the scopes from the attached authorizer
	// Experimental.
	AuthorizationScopes *[]*string `json:"authorizationScopes"`
	// Authorizer for a WebSocket API or an HTTP API.
	// Experimental.
	Authorizer IHttpRouteAuthorizer `json:"authorizer"`
}

Properties to initialize a new Route. Experimental.

type HttpStage

type HttpStage interface {
	awscdk.Resource
	IHttpStage
	IStage
	Api() IHttpApi
	BaseApi() IApi
	DomainUrl() *string
	Env() *awscdk.ResourceEnvironment
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	StageName() *string
	Url() *string
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricClientError(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricCount(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricDataProcessed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricIntegrationLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	MetricServerError(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	ToString() *string
}

Represents a stage where an instance of the API is deployed. Experimental.

func NewHttpStage

func NewHttpStage(scope constructs.Construct, id *string, props *HttpStageProps) HttpStage

Experimental.

type HttpStageAttributes

type HttpStageAttributes struct {
	// The name of the stage.
	// Experimental.
	StageName *string `json:"stageName"`
	// The API to which this stage is associated.
	// Experimental.
	Api IHttpApi `json:"api"`
}

The attributes used to import existing HttpStage. Experimental.

type HttpStageOptions

type HttpStageOptions struct {
	// Whether updates to an API automatically trigger a new deployment.
	// Experimental.
	AutoDeploy *bool `json:"autoDeploy"`
	// The options for custom domain and api mapping.
	// Experimental.
	DomainMapping *DomainMappingOptions `json:"domainMapping"`
	// The name of the stage.
	//
	// See `StageName` class for more details.
	// Experimental.
	StageName *string `json:"stageName"`
}

The options to create a new Stage for an HTTP API. Experimental.

type HttpStageProps

type HttpStageProps struct {
	// Whether updates to an API automatically trigger a new deployment.
	// Experimental.
	AutoDeploy *bool `json:"autoDeploy"`
	// The options for custom domain and api mapping.
	// Experimental.
	DomainMapping *DomainMappingOptions `json:"domainMapping"`
	// The name of the stage.
	//
	// See `StageName` class for more details.
	// Experimental.
	StageName *string `json:"stageName"`
	// The HTTP API to which this stage is associated.
	// Experimental.
	HttpApi IHttpApi `json:"httpApi"`
}

Properties to initialize an instance of `HttpStage`. Experimental.

type IApi

type IApi interface {
	awscdk.IResource
	// Return the given named metric for this Api Gateway.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The default endpoint for an API.
	// Experimental.
	ApiEndpoint() *string
	// The identifier of this API Gateway API.
	// Experimental.
	ApiId() *string
}

Represents a API Gateway HTTP/WebSocket API. Experimental.

type IApiMapping

type IApiMapping interface {
	awscdk.IResource
	// ID of the api mapping.
	// Experimental.
	ApiMappingId() *string
}

Represents an ApiGatewayV2 ApiMapping resource. See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-apimapping.html

Experimental.

func ApiMapping_FromApiMappingAttributes

func ApiMapping_FromApiMappingAttributes(scope constructs.Construct, id *string, attrs *ApiMappingAttributes) IApiMapping

import from API ID. Experimental.

type IAuthorizer

type IAuthorizer interface {
	awscdk.IResource
	// Id of the Authorizer.
	// Experimental.
	AuthorizerId() *string
}

Represents an Authorizer. Experimental.

type IDomainName

type IDomainName interface {
	awscdk.IResource
	// The custom domain name.
	// Experimental.
	Name() *string
	// The domain name associated with the regional endpoint for this custom domain name.
	// Experimental.
	RegionalDomainName() *string
	// The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint.
	// Experimental.
	RegionalHostedZoneId() *string
}

Represents an APIGatewayV2 DomainName. See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html

Experimental.

func DomainName_FromDomainNameAttributes

func DomainName_FromDomainNameAttributes(scope constructs.Construct, id *string, attrs *DomainNameAttributes) IDomainName

Import from attributes. Experimental.

type IHttpApi

type IHttpApi interface {
	IApi
	// Add a new VpcLink.
	// Experimental.
	AddVpcLink(options *VpcLinkProps) VpcLink
	// Metric for the number of client-side errors captured in a given period.
	// Experimental.
	MetricClientError(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the total number API requests in a given period.
	// Experimental.
	MetricCount(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the amount of data processed in bytes.
	// Experimental.
	MetricDataProcessed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.
	// Experimental.
	MetricIntegrationLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The time between when API Gateway receives a request from a client and when it returns a response to the client.
	//
	// The latency includes the integration latency and other API Gateway overhead.
	// Experimental.
	MetricLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the number of server-side errors captured in a given period.
	// Experimental.
	MetricServerError(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The identifier of this API Gateway HTTP API.
	// Deprecated: - use apiId instead
	HttpApiId() *string
}

Represents an HTTP API. Experimental.

func HttpApi_FromHttpApiAttributes

func HttpApi_FromHttpApiAttributes(scope constructs.Construct, id *string, attrs *HttpApiAttributes) IHttpApi

Import an existing HTTP API into this CDK app. Experimental.

type IHttpAuthorizer

type IHttpAuthorizer interface {
	IAuthorizer
}

An authorizer for HTTP APIs. Experimental.

type IHttpIntegration

type IHttpIntegration interface {
	IIntegration
	// The HTTP API associated with this integration.
	// Experimental.
	HttpApi() IHttpApi
}

Represents an Integration for an HTTP API. Experimental.

type IHttpRoute

type IHttpRoute interface {
	IRoute
	// The HTTP API associated with this route.
	// Experimental.
	HttpApi() IHttpApi
	// Returns the path component of this HTTP route, `undefined` if the path is the catch-all route.
	// Experimental.
	Path() *string
}

Represents a Route for an HTTP API. Experimental.

type IHttpRouteAuthorizer

type IHttpRouteAuthorizer interface {
	// Bind this authorizer to a specified Http route.
	// Experimental.
	Bind(options *HttpRouteAuthorizerBindOptions) *HttpRouteAuthorizerConfig
}

An authorizer that can attach to an Http Route. Experimental.

func HttpAuthorizer_FromHttpAuthorizerAttributes

func HttpAuthorizer_FromHttpAuthorizerAttributes(scope constructs.Construct, id *string, attrs *HttpAuthorizerAttributes) IHttpRouteAuthorizer

Import an existing HTTP Authorizer into this CDK app. Experimental.

type IHttpRouteIntegration

type IHttpRouteIntegration interface {
	// Bind this integration to the route.
	// Experimental.
	Bind(options *HttpRouteIntegrationBindOptions) *HttpRouteIntegrationConfig
}

The interface that various route integration classes will inherit. Experimental.

type IHttpStage

type IHttpStage interface {
	IStage
	// Metric for the number of client-side errors captured in a given period.
	// Experimental.
	MetricClientError(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the total number API requests in a given period.
	// Experimental.
	MetricCount(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the amount of data processed in bytes.
	// Experimental.
	MetricDataProcessed(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the time between when API Gateway relays a request to the backend and when it receives a response from the backend.
	// Experimental.
	MetricIntegrationLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The time between when API Gateway receives a request from a client and when it returns a response to the client.
	//
	// The latency includes the integration latency and other API Gateway overhead.
	// Experimental.
	MetricLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the number of server-side errors captured in a given period.
	// Experimental.
	MetricServerError(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The API this stage is associated to.
	// Experimental.
	Api() IHttpApi
	// The custom domain URL to this stage.
	// Experimental.
	DomainUrl() *string
}

Represents the HttpStage. Experimental.

func HttpStage_FromHttpStageAttributes

func HttpStage_FromHttpStageAttributes(scope constructs.Construct, id *string, attrs *HttpStageAttributes) IHttpStage

Import an existing stage into this CDK app. Experimental.

type IIntegration

type IIntegration interface {
	awscdk.IResource
	// Id of the integration.
	// Experimental.
	IntegrationId() *string
}

Represents an integration to an API Route. Experimental.

type IMappingValue

type IMappingValue interface {
	// Represents a Mapping Value.
	// Experimental.
	Value() *string
}

Represents a Mapping Value. Experimental.

type IRoute

type IRoute interface {
	awscdk.IResource
	// Id of the Route.
	// Experimental.
	RouteId() *string
}

Represents a route. Experimental.

type IStage

type IStage interface {
	awscdk.IResource
	// Return the given named metric for this HTTP Api Gateway Stage.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The name of the stage;
	//
	// its primary identifier.
	// Experimental.
	StageName() *string
	// The URL to this stage.
	// Experimental.
	Url() *string
}

Represents a Stage. Experimental.

type IVpcLink interface {
	awscdk.IResource
	// The VPC to which this VPC Link is associated with.
	// Experimental.
	Vpc() awsec2.IVpc
	// Physical ID of the VpcLink resource.
	// Experimental.
	VpcLinkId() *string
}

Represents an API Gateway VpcLink. Experimental.

func VpcLink_FromVpcLinkAttributes(scope constructs.Construct, id *string, attrs *VpcLinkAttributes) IVpcLink

Import a VPC Link by specifying its attributes. Experimental.

type IWebSocketApi

type IWebSocketApi interface {
	IApi
}

Represents a WebSocket API. Experimental.

type IWebSocketIntegration

type IWebSocketIntegration interface {
	IIntegration
	// The WebSocket API associated with this integration.
	// Experimental.
	WebSocketApi() IWebSocketApi
}

Represents an Integration for an WebSocket API. Experimental.

type IWebSocketRoute

type IWebSocketRoute interface {
	IRoute
	// The key to this route.
	// Experimental.
	RouteKey() *string
	// The WebSocket API associated with this route.
	// Experimental.
	WebSocketApi() IWebSocketApi
}

Represents a Route for an WebSocket API. Experimental.

type IWebSocketRouteIntegration

type IWebSocketRouteIntegration interface {
	// Bind this integration to the route.
	// Experimental.
	Bind(options *WebSocketRouteIntegrationBindOptions) *WebSocketRouteIntegrationConfig
}

The interface that various route integration classes will inherit. Experimental.

type IWebSocketStage

type IWebSocketStage interface {
	IStage
	// The API this stage is associated to.
	// Experimental.
	Api() IWebSocketApi
	// The callback URL to this stage.
	//
	// You can use the callback URL to send messages to the client from the backend system.
	// https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-basic-concept.html
	// https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html
	// Experimental.
	CallbackUrl() *string
}

Represents the WebSocketStage. Experimental.

func WebSocketStage_FromWebSocketStageAttributes

func WebSocketStage_FromWebSocketStageAttributes(scope constructs.Construct, id *string, attrs *WebSocketStageAttributes) IWebSocketStage

Import an existing stage into this CDK app. Experimental.

type MappingValue

type MappingValue interface {
	IMappingValue
	Value() *string
}

Represents a Mapping Value. Experimental.

func MappingValue_ContextVariable

func MappingValue_ContextVariable(variableName *string) MappingValue

Creates a context variable mapping value. Experimental.

func MappingValue_Custom

func MappingValue_Custom(value *string) MappingValue

Creates a custom mapping value. Experimental.

func MappingValue_NONE

func MappingValue_NONE() MappingValue

func MappingValue_RequestBody

func MappingValue_RequestBody(name *string) MappingValue

Creates a request body mapping value. Experimental.

func MappingValue_RequestHeader

func MappingValue_RequestHeader(name *string) MappingValue

Creates a header mapping value. Experimental.

func MappingValue_RequestPath

func MappingValue_RequestPath() MappingValue

Creates a request path mapping value. Experimental.

func MappingValue_RequestPathParam

func MappingValue_RequestPathParam(name *string) MappingValue

Creates a request path parameter mapping value. Experimental.

func MappingValue_RequestQueryString

func MappingValue_RequestQueryString(name *string) MappingValue

Creates a query string mapping value. Experimental.

func MappingValue_StageVariable

func MappingValue_StageVariable(variableName *string) MappingValue

Creates a stage variable mapping value. Experimental.

func NewMappingValue

func NewMappingValue(value *string) MappingValue

Experimental.

type ParameterMapping

type ParameterMapping interface {
	Mappings() *map[string]*string
	AppendHeader(name *string, value MappingValue) ParameterMapping
	AppendQueryString(name *string, value MappingValue) ParameterMapping
	Custom(key *string, value *string) ParameterMapping
	OverwriteHeader(name *string, value MappingValue) ParameterMapping
	OverwritePath(value MappingValue) ParameterMapping
	OverwriteQueryString(name *string, value MappingValue) ParameterMapping
	RemoveHeader(name *string) ParameterMapping
	RemoveQueryString(name *string) ParameterMapping
}

Represents a Parameter Mapping. Experimental.

func NewParameterMapping

func NewParameterMapping() ParameterMapping

Experimental.

type PayloadFormatVersion

type PayloadFormatVersion interface {
	Version() *string
}

Payload format version for lambda proxy integration. See: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html

Experimental.

func PayloadFormatVersion_Custom

func PayloadFormatVersion_Custom(version *string) PayloadFormatVersion

A custom payload version.

Typically used if there is a version number that the CDK doesn't support yet Experimental.

func PayloadFormatVersion_VERSION_1_0

func PayloadFormatVersion_VERSION_1_0() PayloadFormatVersion

func PayloadFormatVersion_VERSION_2_0

func PayloadFormatVersion_VERSION_2_0() PayloadFormatVersion

type StageAttributes

type StageAttributes struct {
	// The name of the stage.
	// Experimental.
	StageName *string `json:"stageName"`
}

The attributes used to import existing Stage. Experimental.

type StageOptions

type StageOptions struct {
	// Whether updates to an API automatically trigger a new deployment.
	// Experimental.
	AutoDeploy *bool `json:"autoDeploy"`
	// The options for custom domain and api mapping.
	// Experimental.
	DomainMapping *DomainMappingOptions `json:"domainMapping"`
}

Options required to create a new stage.

Options that are common between HTTP and Websocket APIs. Experimental.

type VpcLink interface {
	awscdk.Resource
	IVpcLink
	Env() *awscdk.ResourceEnvironment
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	Vpc() awsec2.IVpc
	VpcLinkId() *string
	AddSecurityGroups(groups ...awsec2.ISecurityGroup)
	AddSubnets(subnets ...awsec2.ISubnet)
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

Define a new VPC Link Specifies an API Gateway VPC link for a HTTP API to access resources in an Amazon Virtual Private Cloud (VPC). Experimental.

func NewVpcLink(scope constructs.Construct, id *string, props *VpcLinkProps) VpcLink

Experimental.

type VpcLinkAttributes

type VpcLinkAttributes struct {
	// The VPC to which this VPC link is associated with.
	// Experimental.
	Vpc awsec2.IVpc `json:"vpc"`
	// The VPC Link id.
	// Experimental.
	VpcLinkId *string `json:"vpcLinkId"`
}

Attributes when importing a new VpcLink. Experimental.

type VpcLinkProps

type VpcLinkProps struct {
	// The VPC in which the private resources reside.
	// Experimental.
	Vpc awsec2.IVpc `json:"vpc"`
	// A list of security groups for the VPC link.
	// Experimental.
	SecurityGroups *[]awsec2.ISecurityGroup `json:"securityGroups"`
	// A list of subnets for the VPC link.
	// Experimental.
	Subnets *awsec2.SubnetSelection `json:"subnets"`
	// The name used to label and identify the VPC link.
	// Experimental.
	VpcLinkName *string `json:"vpcLinkName"`
}

Properties for a VpcLink. Experimental.

type WebSocketApi

type WebSocketApi interface {
	awscdk.Resource
	IApi
	IWebSocketApi
	ApiEndpoint() *string
	ApiId() *string
	Env() *awscdk.ResourceEnvironment
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	WebSocketApiName() *string
	AddRoute(routeKey *string, options *WebSocketRouteOptions) WebSocketRoute
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	ToString() *string
}

Create a new API Gateway WebSocket API endpoint. Experimental.

func NewWebSocketApi

func NewWebSocketApi(scope constructs.Construct, id *string, props *WebSocketApiProps) WebSocketApi

Experimental.

type WebSocketApiProps

type WebSocketApiProps struct {
	// Name for the WebSocket API resource.
	// Experimental.
	ApiName *string `json:"apiName"`
	// Options to configure a '$connect' route.
	// Experimental.
	ConnectRouteOptions *WebSocketRouteOptions `json:"connectRouteOptions"`
	// Options to configure a '$default' route.
	// Experimental.
	DefaultRouteOptions *WebSocketRouteOptions `json:"defaultRouteOptions"`
	// The description of the API.
	// Experimental.
	Description *string `json:"description"`
	// Options to configure a '$disconnect' route.
	// Experimental.
	DisconnectRouteOptions *WebSocketRouteOptions `json:"disconnectRouteOptions"`
	// The route selection expression for the API.
	// Experimental.
	RouteSelectionExpression *string `json:"routeSelectionExpression"`
}

Props for WebSocket API. Experimental.

type WebSocketIntegration

type WebSocketIntegration interface {
	awscdk.Resource
	IWebSocketIntegration
	Env() *awscdk.ResourceEnvironment
	IntegrationId() *string
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	WebSocketApi() IWebSocketApi
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

The integration for an API route. Experimental.

func NewWebSocketIntegration

func NewWebSocketIntegration(scope constructs.Construct, id *string, props *WebSocketIntegrationProps) WebSocketIntegration

Experimental.

type WebSocketIntegrationProps

type WebSocketIntegrationProps struct {
	// Integration type.
	// Experimental.
	IntegrationType WebSocketIntegrationType `json:"integrationType"`
	// Integration URI.
	// Experimental.
	IntegrationUri *string `json:"integrationUri"`
	// The WebSocket API to which this integration should be bound.
	// Experimental.
	WebSocketApi IWebSocketApi `json:"webSocketApi"`
}

The integration properties. Experimental.

type WebSocketIntegrationType

type WebSocketIntegrationType string

WebSocket Integration Types. Experimental.

const (
	WebSocketIntegrationType_AWS_PROXY WebSocketIntegrationType = "AWS_PROXY"
)

type WebSocketRoute

type WebSocketRoute interface {
	awscdk.Resource
	IWebSocketRoute
	Env() *awscdk.ResourceEnvironment
	IntegrationResponseId() *string
	Node() constructs.Node
	PhysicalName() *string
	RouteId() *string
	RouteKey() *string
	Stack() awscdk.Stack
	WebSocketApi() IWebSocketApi
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	ToString() *string
}

Route class that creates the Route for API Gateway WebSocket API. Experimental.

func NewWebSocketRoute

func NewWebSocketRoute(scope constructs.Construct, id *string, props *WebSocketRouteProps) WebSocketRoute

Experimental.

type WebSocketRouteIntegrationBindOptions

type WebSocketRouteIntegrationBindOptions struct {
	// The route to which this is being bound.
	// Experimental.
	Route IWebSocketRoute `json:"route"`
	// The current scope in which the bind is occurring.
	//
	// If the `WebSocketRouteIntegration` being bound creates additional constructs,
	// this will be used as their parent scope.
	// Experimental.
	Scope constructs.Construct `json:"scope"`
}

Options to the WebSocketRouteIntegration during its bind operation. Experimental.

type WebSocketRouteIntegrationConfig

type WebSocketRouteIntegrationConfig struct {
	// Integration type.
	// Experimental.
	Type WebSocketIntegrationType `json:"type"`
	// Integration URI.
	// Experimental.
	Uri *string `json:"uri"`
}

Config returned back as a result of the bind. Experimental.

type WebSocketRouteOptions

type WebSocketRouteOptions struct {
	// The integration to be configured on this route.
	// Experimental.
	Integration IWebSocketRouteIntegration `json:"integration"`
}

Options used to add route to the API. Experimental.

type WebSocketRouteProps

type WebSocketRouteProps struct {
	// The integration to be configured on this route.
	// Experimental.
	Integration IWebSocketRouteIntegration `json:"integration"`
	// The key to this route.
	// Experimental.
	RouteKey *string `json:"routeKey"`
	// the API the route is associated with.
	// Experimental.
	WebSocketApi IWebSocketApi `json:"webSocketApi"`
}

Properties to initialize a new Route. Experimental.

type WebSocketStage

type WebSocketStage interface {
	awscdk.Resource
	IStage
	IWebSocketStage
	Api() IWebSocketApi
	BaseApi() IApi
	CallbackUrl() *string
	Env() *awscdk.ResourceEnvironment
	Node() constructs.Node
	PhysicalName() *string
	Stack() awscdk.Stack
	StageName() *string
	Url() *string
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	GetResourceNameAttribute(nameAttr *string) *string
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	ToString() *string
}

Represents a stage where an instance of the API is deployed. Experimental.

func NewWebSocketStage

func NewWebSocketStage(scope constructs.Construct, id *string, props *WebSocketStageProps) WebSocketStage

Experimental.

type WebSocketStageAttributes

type WebSocketStageAttributes struct {
	// The name of the stage.
	// Experimental.
	StageName *string `json:"stageName"`
	// The API to which this stage is associated.
	// Experimental.
	Api IWebSocketApi `json:"api"`
}

The attributes used to import existing WebSocketStage. Experimental.

type WebSocketStageProps

type WebSocketStageProps struct {
	// Whether updates to an API automatically trigger a new deployment.
	// Experimental.
	AutoDeploy *bool `json:"autoDeploy"`
	// The options for custom domain and api mapping.
	// Experimental.
	DomainMapping *DomainMappingOptions `json:"domainMapping"`
	// The name of the stage.
	// Experimental.
	StageName *string `json:"stageName"`
	// The WebSocket API to which this stage is associated.
	// Experimental.
	WebSocketApi IWebSocketApi `json:"webSocketApi"`
}

Properties to initialize an instance of `WebSocketStage`. Experimental.

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL