agent-claw: automated task changes
This commit is contained in:
13
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/.jsiirc.json
generated
vendored
Normal file
13
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/.jsiirc.json
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"targets": {
|
||||
"java": {
|
||||
"package": "software.amazon.awscdk.services.apigatewayv2"
|
||||
},
|
||||
"dotnet": {
|
||||
"namespace": "Amazon.CDK.AWS.Apigatewayv2"
|
||||
},
|
||||
"python": {
|
||||
"module": "aws_cdk.aws_apigatewayv2"
|
||||
}
|
||||
}
|
||||
}
|
||||
755
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/README.md
generated
vendored
Normal file
755
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/README.md
generated
vendored
Normal file
@@ -0,0 +1,755 @@
|
||||
# AWS APIGatewayv2 Construct Library
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [HTTP API](#http-api)
|
||||
- [Defining HTTP APIs](#defining-http-apis)
|
||||
- [Cross Origin Resource Sharing (CORS)](#cross-origin-resource-sharing-cors)
|
||||
- [Publishing HTTP APIs](#publishing-http-apis)
|
||||
- [Custom Domain](#custom-domain)
|
||||
- [Mutual TLS](#mutual-tls-mtls)
|
||||
- [Managing access to HTTP APIs](#managing-access-to-http-apis)
|
||||
- [Metrics](#metrics)
|
||||
- [VPC Link](#vpc-link)
|
||||
- [Private Integration](#private-integration)
|
||||
- [Generating ARN for Execute API](#generating-arn-for-execute-api)
|
||||
- [WebSocket API](#websocket-api)
|
||||
- [Manage Connections Permission](#manage-connections-permission)
|
||||
- [Managing access to WebSocket APIs](#managing-access-to-websocket-apis)
|
||||
- [Usage Plan and API Keys](#usage-plan-and-api-keys)
|
||||
- [Common Config](#common-config)
|
||||
- [Route Settings](#route-settings)
|
||||
- [Access Logging](#access-logging)
|
||||
|
||||
## 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](https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html).
|
||||
|
||||
This module supports features under [API Gateway v2](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_ApiGatewayV2.html)
|
||||
that lets users set up Websocket and HTTP APIs.
|
||||
REST APIs can be created using the `aws-cdk-lib/aws-apigateway` module.
|
||||
|
||||
HTTP and Websocket APIs use the same CloudFormation resources under the hood. However, this module separates them into two separate constructs for a more efficient abstraction since there are a number of CloudFormation properties that specifically apply only to each type of API.
|
||||
|
||||
## 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](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-routes.html). 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](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations.html).
|
||||
|
||||
Integrations are available at the `aws-apigatewayv2-integrations` module and more information is available in that module.
|
||||
As an early example, we have a website for a bookstore where the following code snippet configures a route `GET /books` with an HTTP proxy integration. All other HTTP method calls to `/books` route to a default lambda proxy for the bookstore.
|
||||
|
||||
```ts
|
||||
import { HttpUrlIntegration, HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
||||
|
||||
const getBooksIntegration = new HttpUrlIntegration('GetBooksIntegration', 'https://get-books-proxy.example.com');
|
||||
|
||||
declare const bookStoreDefaultFn: lambda.Function;
|
||||
const bookStoreDefaultIntegration = new HttpLambdaIntegration('BooksIntegration', bookStoreDefaultFn);
|
||||
|
||||
const httpApi = new apigwv2.HttpApi(this, 'HttpApi');
|
||||
|
||||
httpApi.addRoutes({
|
||||
path: '/books',
|
||||
methods: [ apigwv2.HttpMethod.GET ],
|
||||
integration: getBooksIntegration,
|
||||
});
|
||||
httpApi.addRoutes({
|
||||
path: '/books',
|
||||
methods: [ apigwv2.HttpMethod.ANY ],
|
||||
integration: bookStoreDefaultIntegration,
|
||||
});
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
```ts
|
||||
const httpApi = new apigwv2.HttpApi(this, '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.
|
||||
|
||||
```ts
|
||||
import { HttpUrlIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
||||
|
||||
new apigwv2.HttpApi(this, 'HttpProxyApi', {
|
||||
defaultIntegration: new HttpUrlIntegration('DefaultIntegration', 'https://example.com'),
|
||||
});
|
||||
```
|
||||
|
||||
The `routeSelectionExpression` option allows configuring the HTTP API to accept only `${request.method} ${request.path}`. Setting it to `true` automatically applies this value.
|
||||
|
||||
```ts
|
||||
new apigwv2.HttpApi(this, 'HttpProxyApi', {
|
||||
routeSelectionExpression: true,
|
||||
});
|
||||
```
|
||||
|
||||
You can configure IP address type for the API endpoint using `ipAddressType` property.
|
||||
Valid values are `IPV4` (default) and `DUAL_STACK`.
|
||||
|
||||
```ts
|
||||
new apigwv2.HttpApi(this, 'HttpApi', {
|
||||
ipAddressType: apigwv2.IpAddressType.DUAL_STACK,
|
||||
});
|
||||
```
|
||||
|
||||
### Cross Origin Resource Sharing (CORS)
|
||||
|
||||
[Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/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](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html).
|
||||
|
||||
The `corsPreflight` option lets you specify a CORS configuration for an API.
|
||||
|
||||
```ts
|
||||
new apigwv2.HttpApi(this, 'HttpProxyApi', {
|
||||
corsPreflight: {
|
||||
allowHeaders: ['Authorization'],
|
||||
allowMethods: [
|
||||
apigwv2.CorsHttpMethod.GET,
|
||||
apigwv2.CorsHttpMethod.HEAD,
|
||||
apigwv2.CorsHttpMethod.OPTIONS,
|
||||
apigwv2.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`.
|
||||
|
||||
```ts
|
||||
declare const api: apigwv2.HttpApi;
|
||||
|
||||
new apigwv2.HttpStage(this, 'Stage', {
|
||||
httpApi: api,
|
||||
stageName: 'beta',
|
||||
description: 'My Stage',
|
||||
});
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
```ts
|
||||
import * as acm from 'aws-cdk-lib/aws-certificatemanager';
|
||||
import { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
||||
|
||||
const certArn = 'arn:aws:acm:us-east-1:111111111111:certificate';
|
||||
const domainName = 'example.com';
|
||||
|
||||
const dn = new apigwv2.DomainName(this, 'DN', {
|
||||
domainName: domainName,
|
||||
certificate: acm.Certificate.fromCertificateArn(this, 'cert', certArn),
|
||||
});
|
||||
|
||||
declare const handler: lambda.Function;
|
||||
const api = new apigwv2.HttpApi(this, 'HttpProxyProdApi', {
|
||||
defaultIntegration: new HttpLambdaIntegration('DefaultIntegration', handler),
|
||||
// https://${dn.domainName}/foo goes to prodApi $default stage
|
||||
defaultDomainMapping: {
|
||||
domainName: dn,
|
||||
mappingKey: 'foo',
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
The IP address type for the domain name can be configured by using the `ipAddressType`
|
||||
property. Valid values are `IPV4` (default) and `DUAL_STACK`.
|
||||
|
||||
```ts
|
||||
import * as acm from 'aws-cdk-lib/aws-certificatemanager';
|
||||
|
||||
declare const certificate: acm.ICertificate;
|
||||
declare const domainName: string;
|
||||
|
||||
const dn = new apigwv2.DomainName(this, 'DN', {
|
||||
domainName: domainName,
|
||||
certificate: certificate,
|
||||
ipAddressType: apigwv2.IpAddressType.DUAL_STACK,
|
||||
});
|
||||
```
|
||||
|
||||
To migrate a domain endpoint from one type to another, you can add a new endpoint configuration via `addEndpoint()`
|
||||
and then configure DNS records to route traffic to the new endpoint. After that, you can remove the previous endpoint configuration.
|
||||
Learn more at [Migrating a custom domain name](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-regional-api-custom-domain-migrate.html)
|
||||
|
||||
To associate a specific `Stage` to a custom domain mapping -
|
||||
|
||||
```ts
|
||||
declare const api: apigwv2.HttpApi;
|
||||
declare const dn: apigwv2.DomainName;
|
||||
|
||||
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 -
|
||||
|
||||
```ts
|
||||
import { HttpLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
||||
|
||||
declare const handler: lambda.Function;
|
||||
declare const dn: apigwv2.DomainName;
|
||||
|
||||
const apiDemo = new apigwv2.HttpApi(this, 'DemoApi', {
|
||||
defaultIntegration: new HttpLambdaIntegration('DefaultIntegration', 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 -
|
||||
|
||||
```ts
|
||||
declare const apiDemo: apigwv2.HttpApi;
|
||||
const demoDomainUrl = apiDemo.defaultStage?.domainUrl; // returns "https://example.com/demo"
|
||||
```
|
||||
|
||||
### Mutual TLS (mTLS)
|
||||
|
||||
Mutual TLS can be configured to limit access to your API based by using client certificates instead of (or as an extension of) using authorization headers.
|
||||
|
||||
```ts
|
||||
import * as s3 from 'aws-cdk-lib/aws-s3';
|
||||
import * as acm from 'aws-cdk-lib/aws-certificatemanager';
|
||||
|
||||
const certArn = 'arn:aws:acm:us-east-1:111111111111:certificate';
|
||||
const domainName = 'example.com';
|
||||
declare const bucket: s3.Bucket;
|
||||
|
||||
new apigwv2.DomainName(this, 'DomainName', {
|
||||
domainName,
|
||||
certificate: acm.Certificate.fromCertificateArn(this, 'cert', certArn),
|
||||
mtls: {
|
||||
bucket,
|
||||
key: 'someca.pem',
|
||||
version: 'version',
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Instructions for configuring your trust store can be found [here](https://aws.amazon.com/blogs/compute/introducing-mutual-tls-authentication-for-amazon-api-gateway/)
|
||||
|
||||
### Managing access to HTTP APIs
|
||||
|
||||
API Gateway supports multiple mechanisms for [controlling and managing access to your HTTP
|
||||
API](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-access-control.html) through authorizers.
|
||||
|
||||
These authorizers can be found in the [APIGatewayV2-Authorizers](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2_authorizers-readme.html) 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.
|
||||
|
||||
```ts
|
||||
const api = new apigwv2.HttpApi(this, '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.
|
||||
|
||||
```ts
|
||||
const api = new apigwv2.HttpApi(this, 'my-api');
|
||||
const stage = new apigwv2.HttpStage(this, 'Stage', {
|
||||
httpApi: api,
|
||||
});
|
||||
const clientErrorMetric = stage.metricClientError();
|
||||
```
|
||||
|
||||
### VPC Link
|
||||
|
||||
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.
|
||||
|
||||
```ts
|
||||
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
||||
import * as elb from 'aws-cdk-lib/aws-elasticloadbalancingv2';
|
||||
import { HttpAlbIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
||||
|
||||
const vpc = new ec2.Vpc(this, 'VPC');
|
||||
const alb = new elb.ApplicationLoadBalancer(this, 'AppLoadBalancer', { vpc });
|
||||
|
||||
const vpcLink = new apigwv2.VpcLink(this, 'VpcLink', { vpc });
|
||||
|
||||
// Creating an HTTP ALB Integration:
|
||||
const albIntegration = new HttpAlbIntegration('ALBIntegration', alb.listeners[0], {});
|
||||
```
|
||||
|
||||
Any existing `VpcLink` resource can be imported into the CDK app via the `VpcLink.fromVpcLinkAttributes()`.
|
||||
|
||||
```ts
|
||||
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
||||
|
||||
declare const vpc: ec2.Vpc;
|
||||
const awesomeLink = apigwv2.VpcLink.fromVpcLinkAttributes(this, 'awesome-vpc-link', {
|
||||
vpcLinkId: 'us-east-1_oiuR12Abd',
|
||||
vpc,
|
||||
});
|
||||
```
|
||||
|
||||
### 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 [aws-apigatewayv2-integrations](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2_integrations-readme.html) constructs library.
|
||||
|
||||
### Generating ARN for Execute API
|
||||
|
||||
The arnForExecuteApi function in AWS CDK is designed to generate Amazon Resource Names (ARNs) for Execute API operations. This is particularly useful when you need to create ARNs dynamically based on different parameters like HTTP method, API path, and stage.
|
||||
|
||||
```ts
|
||||
const api = new apigwv2.HttpApi(this, 'my-api');
|
||||
const arn = api.arnForExecuteApi('GET', '/myApiPath', 'dev');
|
||||
```
|
||||
|
||||
- Ensure that the path parameter, if provided, starts with '/'.
|
||||
- The 'ANY' method can be used for matching any HTTP methods not explicitly defined.
|
||||
- The function gracefully handles undefined parameters by using wildcards, making it flexible for various API configurations.
|
||||
|
||||
## 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](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-overview.html)
|
||||
|
||||
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](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-integration-requests.html).
|
||||
|
||||
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:
|
||||
|
||||
```ts
|
||||
import { WebSocketLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
||||
|
||||
declare const connectHandler: lambda.Function;
|
||||
declare const disconnectHandler: lambda.Function;
|
||||
declare const defaultHandler: lambda.Function;
|
||||
|
||||
const webSocketApi = new apigwv2.WebSocketApi(this, 'mywsapi', {
|
||||
connectRouteOptions: { integration: new WebSocketLambdaIntegration('ConnectIntegration', connectHandler) },
|
||||
disconnectRouteOptions: { integration: new WebSocketLambdaIntegration('DisconnectIntegration',disconnectHandler) },
|
||||
defaultRouteOptions: { integration: new WebSocketLambdaIntegration('DefaultIntegration', defaultHandler) },
|
||||
});
|
||||
|
||||
new apigwv2.WebSocketStage(this, 'mystage', {
|
||||
webSocketApi,
|
||||
stageName: 'dev',
|
||||
description: 'My Stage',
|
||||
autoDeploy: true,
|
||||
});
|
||||
```
|
||||
|
||||
To retrieve a websocket URL and a callback URL:
|
||||
|
||||
```ts
|
||||
declare const webSocketStage: apigwv2.WebSocketStage;
|
||||
|
||||
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:
|
||||
|
||||
```ts
|
||||
import { WebSocketLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
||||
|
||||
declare const messageHandler: lambda.Function;
|
||||
const webSocketApi = new apigwv2.WebSocketApi(this, 'mywsapi');
|
||||
webSocketApi.addRoute('sendmessage', {
|
||||
integration: new WebSocketLambdaIntegration('SendMessageIntegration', messageHandler),
|
||||
});
|
||||
```
|
||||
|
||||
To add a route that can return a result:
|
||||
|
||||
```ts
|
||||
import { WebSocketLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
|
||||
|
||||
declare const messageHandler: lambda.Function;
|
||||
const webSocketApi = new apigwv2.WebSocketApi(this, 'mywsapi');
|
||||
webSocketApi.addRoute('sendmessage', {
|
||||
integration: new WebSocketLambdaIntegration('SendMessageIntegration', messageHandler),
|
||||
returnResponse: true,
|
||||
});
|
||||
```
|
||||
|
||||
To import an existing WebSocketApi:
|
||||
|
||||
```ts
|
||||
const webSocketApi = apigwv2.WebSocketApi.fromWebSocketApiAttributes(this, 'mywsapi', { webSocketId: 'api-1234' });
|
||||
```
|
||||
|
||||
To generate an ARN for Execute API:
|
||||
|
||||
```ts
|
||||
const api = new apigwv2.WebSocketApi(this, 'mywsapi');
|
||||
const arn = api.arnForExecuteApiV2('$connect', 'dev');
|
||||
```
|
||||
|
||||
For a detailed explanation of this function, including usage and examples, please refer to the [Generating ARN for Execute API](#generating-arn-for-execute-api) section under HTTP API.
|
||||
|
||||
To disable schema validation, set `disableSchemaValidation` to true.
|
||||
|
||||
```ts
|
||||
new apigwv2.WebSocketApi(this, 'api', {
|
||||
disableSchemaValidation: true,
|
||||
});
|
||||
```
|
||||
|
||||
You can configure IP address type for the API endpoint using `ipAddressType` property.
|
||||
Valid values are `IPV4` (default) and `DUAL_STACK`.
|
||||
|
||||
```ts
|
||||
new apigwv2.WebSocketApi(this, 'WebSocketApi', {
|
||||
ipAddressType: apigwv2.IpAddressType.DUAL_STACK,
|
||||
});
|
||||
```
|
||||
|
||||
### Manage Connections Permission
|
||||
|
||||
Grant permission to use API Gateway Management API of a WebSocket API by calling the `grantManageConnections` API.
|
||||
You can use Management API to send a callback message to a connected client, get connection information, or disconnect the client. Learn more at [Use @connections commands in your backend service](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-how-to-call-websocket-api-connections.html).
|
||||
|
||||
```ts
|
||||
declare const fn: lambda.Function;
|
||||
|
||||
const webSocketApi = new apigwv2.WebSocketApi(this, 'mywsapi');
|
||||
const stage = new apigwv2.WebSocketStage(this, 'mystage', {
|
||||
webSocketApi,
|
||||
stageName: 'dev',
|
||||
});
|
||||
// per stage permission
|
||||
stage.grantManagementApiAccess(fn);
|
||||
// for all the stages permission
|
||||
webSocketApi.grantManageConnections(fn);
|
||||
```
|
||||
|
||||
### Managing access to WebSocket APIs
|
||||
|
||||
API Gateway supports multiple mechanisms for [controlling and managing access to a WebSocket API](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-control-access.html) through authorizers.
|
||||
|
||||
These authorizers can be found in the [APIGatewayV2-Authorizers](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2_authorizers-readme.html) constructs library.
|
||||
|
||||
### API Keys
|
||||
|
||||
Websocket APIs also support usage of API Keys. An API Key is a key that is used to grant access to an API. These are useful for controlling and tracking access to an API, when used together with [usage plans](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html). These together allow you to configure controls around API access such as quotas and throttling, along with per-API Key metrics on usage.
|
||||
|
||||
To require an API Key when accessing the Websocket API:
|
||||
|
||||
```ts
|
||||
const webSocketApi = new apigwv2.WebSocketApi(this, 'mywsapi',{
|
||||
apiKeySelectionExpression: apigwv2.WebSocketApiKeySelectionExpression.HEADER_X_API_KEY,
|
||||
});
|
||||
```
|
||||
|
||||
## Usage Plan and API Keys
|
||||
|
||||
A usage plan specifies who can access one or more deployed WebSocket API stages, and the rate at which they can be accessed. The plan uses API keys to
|
||||
identify API clients and meters access to the associated API stages for each key. Usage plans also allow configuring throttling limits and quota limits that are
|
||||
enforced on individual client API keys.
|
||||
|
||||
The following example shows how to create and associate a usage plan and an API key for WebSocket APIs:
|
||||
|
||||
```ts
|
||||
const apiKey = new apigwv2.ApiKey(this, "ApiKey");
|
||||
|
||||
const usagePlan = new apigwv2.UsagePlan(this, "UsagePlan", {
|
||||
usagePlanName: "WebSocketUsagePlan",
|
||||
throttle: {
|
||||
rateLimit: 10,
|
||||
burstLimit: 2
|
||||
}
|
||||
});
|
||||
|
||||
usagePlan.addApiKey(apiKey);
|
||||
```
|
||||
|
||||
To associate a plan to a given WebSocketAPI stage:
|
||||
|
||||
```ts
|
||||
const api = new apigwv2.WebSocketApi(this, 'my-api');
|
||||
const stage = new apigwv2.WebSocketStage(this, 'my-stage', {
|
||||
webSocketApi: api,
|
||||
stageName: 'dev',
|
||||
});
|
||||
|
||||
const usagePlan = new apigwv2.UsagePlan(this, 'my-usage-plan', {
|
||||
usagePlanName: 'Basic',
|
||||
});
|
||||
|
||||
usagePlan.addApiStage({
|
||||
api: api,
|
||||
stage: stage,
|
||||
});
|
||||
```
|
||||
Existing usage plans can be imported into a CDK app using its id.
|
||||
|
||||
```ts
|
||||
const usagePlan: apigwv2.IUsagePlan = apigwv2.UsagePlan.fromUsagePlanId(this, 'imported-usage-plan', '<usage-plan-id>');
|
||||
```
|
||||
|
||||
The name and value of the API Key can be specified at creation; if not provided, a name and a value will be automatically generated by API Gateway.
|
||||
|
||||
```ts
|
||||
// Auto-generated name and value
|
||||
const autoKey = new apigwv2.ApiKey(this, 'AutoKey');
|
||||
|
||||
// Explicit name and value
|
||||
const explicitKey = new apigwv2.ApiKey(this, 'ExplicitKey', {
|
||||
apiKeyName: 'MyWebSocketApiKey',
|
||||
value: 'MyApiKeyThatIsAtLeast20Characters',
|
||||
});
|
||||
```
|
||||
|
||||
Existing API keys can also be imported into a CDK app using its id.
|
||||
|
||||
```ts
|
||||
const importedKey = apigwv2.ApiKey.fromApiKeyId(this, 'imported-key', '<api-key-id>');
|
||||
```
|
||||
|
||||
The "grant" methods can be used to give prepackaged sets of permissions to other resources. The
|
||||
following code provides read permission to an API key.
|
||||
|
||||
```ts
|
||||
import * as iam from 'aws-cdk-lib/aws-iam';
|
||||
|
||||
const user = new iam.User(this, 'User');
|
||||
const apiKey = new apigwv2.ApiKey(this, 'ApiKey', {
|
||||
customerId: 'test-customer',
|
||||
});
|
||||
apiKey.grantRead(user);
|
||||
```
|
||||
|
||||
### Adding an API Key to an imported WebSocketApi
|
||||
|
||||
API Keys for WebSocket APIs are associated through Usage Plans, not directly to stages. When you import a WebSocketApi, you need to create a Usage Plan that references the
|
||||
imported stage and then associate the API key with that Usage Plan.
|
||||
|
||||
```ts
|
||||
declare const webSocketApi: apigwv2.IWebSocketApi;
|
||||
|
||||
const importedStage = apigwv2.WebSocketStage.fromWebSocketStageAttributes(this, 'imported-stage', {
|
||||
stageName: 'myStage',
|
||||
api: webSocketApi,
|
||||
});
|
||||
|
||||
const apiKey = new apigwv2.ApiKey(this, 'MyApiKey');
|
||||
|
||||
const usagePlan = new apigwv2.UsagePlan(this, 'MyUsagePlan', {
|
||||
apiStages: [{ api: webSocketApi, stage: importedStage }],
|
||||
});
|
||||
|
||||
usagePlan.addApiKey(apiKey);
|
||||
```
|
||||
|
||||
### Multiple API Keys
|
||||
|
||||
It is possible to specify multiple API keys for a given Usage Plan, by calling `usagePlan.addApiKey()`.
|
||||
|
||||
When using multiple API keys, you may need to ensure that the CloudFormation logical ids of the API keys remain consistent across deployments. You can set the logical id as part of the `addApiKey()` method
|
||||
|
||||
```ts
|
||||
declare const usagePlan: apigwv2.UsagePlan;
|
||||
declare const apiKey: apigwv2.ApiKey;
|
||||
|
||||
usagePlan.addApiKey(apiKey, {
|
||||
overrideLogicalId: 'MyCustomLogicalId',
|
||||
});
|
||||
```
|
||||
|
||||
### Rate Limited API Key
|
||||
|
||||
In scenarios where you need to create a single api key and configure rate limiting for it, you can use `RateLimitedApiKey`.
|
||||
This construct lets you specify rate limiting properties which should be applied only to the api key being created.
|
||||
The API key created has the specified rate limits, such as quota and throttles, applied.
|
||||
|
||||
The following example shows how to use a rate limited api key :
|
||||
|
||||
```ts
|
||||
declare const api: apigwv2.WebSocketApi;
|
||||
declare const stage: apigwv2.WebSocketStage;
|
||||
|
||||
const key = new apigwv2.RateLimitedApiKey(this, 'rate-limited-api-key', {
|
||||
customerId: 'test-customer',
|
||||
apiStages: [{
|
||||
api: api,
|
||||
stage: stage
|
||||
}],
|
||||
quota: {
|
||||
limit: 10000,
|
||||
period: apigwv2.Period.MONTH
|
||||
},
|
||||
throttle: {
|
||||
rateLimit: 100,
|
||||
burstLimit: 200
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## Common Config
|
||||
|
||||
Common config for both HTTP API and WebSocket API
|
||||
|
||||
### Route Settings
|
||||
|
||||
Represents a collection of route settings.
|
||||
|
||||
```ts
|
||||
declare const api: apigwv2.HttpApi;
|
||||
|
||||
new apigwv2.HttpStage(this, 'Stage', {
|
||||
httpApi: api,
|
||||
throttle: {
|
||||
rateLimit: 1000,
|
||||
burstLimit: 1000,
|
||||
},
|
||||
detailedMetricsEnabled: true,
|
||||
});
|
||||
```
|
||||
|
||||
### Access Logging
|
||||
|
||||
You can turn on logging to write logs to CloudWatch Logs.
|
||||
Read more at Configure logging for [HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging.html) or [WebSocket APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-logging.html)
|
||||
|
||||
```ts
|
||||
import * as logs from 'aws-cdk-lib/aws-logs';
|
||||
|
||||
declare const httpApi: apigwv2.HttpApi;
|
||||
declare const webSocketApi : apigwv2.WebSocketApi;
|
||||
declare const logGroup: logs.LogGroup;
|
||||
|
||||
new apigwv2.HttpStage(this, 'HttpStage', {
|
||||
httpApi,
|
||||
accessLogSettings: {
|
||||
destination: new apigwv2.LogGroupLogDestination(logGroup),
|
||||
},
|
||||
});
|
||||
|
||||
new apigwv2.WebSocketStage(this, 'WebSocketStage', {
|
||||
webSocketApi,
|
||||
stageName: 'dev',
|
||||
accessLogSettings: {
|
||||
destination: new apigwv2.LogGroupLogDestination(logGroup),
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
The following code will generate the access log in the [CLF format](https://en.wikipedia.org/wiki/Common_Log_Format).
|
||||
|
||||
```ts
|
||||
import * as apigw from 'aws-cdk-lib/aws-apigateway';
|
||||
import * as logs from 'aws-cdk-lib/aws-logs';
|
||||
|
||||
declare const api: apigwv2.HttpApi;
|
||||
declare const logGroup: logs.LogGroup;
|
||||
|
||||
const stage = new apigwv2.HttpStage(this, 'Stage', {
|
||||
httpApi: api,
|
||||
accessLogSettings: {
|
||||
destination: new apigwv2.LogGroupLogDestination(logGroup),
|
||||
format: apigw.AccessLogFormat.clf(),
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
You can also configure your own access log format by using the `AccessLogFormat.custom()` API.
|
||||
`AccessLogField` provides commonly used fields. The following code configures access log to contain.
|
||||
|
||||
```ts
|
||||
import * as apigw from 'aws-cdk-lib/aws-apigateway';
|
||||
import * as logs from 'aws-cdk-lib/aws-logs';
|
||||
|
||||
declare const api: apigwv2.HttpApi;
|
||||
declare const logGroup: logs.LogGroup;
|
||||
|
||||
const stage = new apigwv2.HttpStage(this, 'Stage', {
|
||||
httpApi: api,
|
||||
accessLogSettings: {
|
||||
destination: new apigwv2.LogGroupLogDestination(logGroup),
|
||||
format: apigw.AccessLogFormat.custom(
|
||||
`${apigw.AccessLogField.contextRequestId()} ${apigw.AccessLogField.contextErrorMessage()} ${apigw.AccessLogField.contextErrorMessageString()}
|
||||
${apigw.AccessLogField.contextAuthorizerError()} ${apigw.AccessLogField.contextAuthorizerIntegrationStatus()}`
|
||||
),
|
||||
},
|
||||
});
|
||||
```
|
||||
25
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/grants.json
generated
vendored
Normal file
25
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/grants.json
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"resources": {
|
||||
"WebSocketApi": {
|
||||
"grants": {
|
||||
"manageConnections": {
|
||||
"arnFormat": "${webSocketApiArn}/*/*/@connections/*",
|
||||
"actions": [
|
||||
"execute-api:ManageConnections"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"WebSocketStage": {
|
||||
"grants": {
|
||||
"managementApiAccess": {
|
||||
"arnFormat": "${webSocketStageArn}/*/@connections/*",
|
||||
"actions": [
|
||||
"execute-api:ManageConnections"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/index.d.ts
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './lib';
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/index.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
327
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/apigatewayv2-canned-metrics.generated.d.ts
generated
vendored
Normal file
327
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/apigatewayv2-canned-metrics.generated.d.ts
generated
vendored
Normal file
@@ -0,0 +1,327 @@
|
||||
export interface MetricWithDims<D> {
|
||||
readonly namespace: string;
|
||||
readonly metricName: string;
|
||||
readonly statistic: string;
|
||||
readonly dimensionsMap: D;
|
||||
}
|
||||
export declare class ApiGatewayMetrics {
|
||||
static _4XxSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static _5XxSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static countSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static countSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
}>;
|
||||
static countSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static countSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static countSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static integrationLatencyAverage(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static integrationLatencyAverage(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
}>;
|
||||
static integrationLatencyAverage(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static integrationLatencyAverage(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static integrationLatencyAverage(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}>;
|
||||
static integrationLatencyAverage(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static latencyAverage(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static latencyAverage(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
}>;
|
||||
static latencyAverage(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static latencyAverage(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static latencyAverage(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static integrationErrorSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static integrationErrorSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}>;
|
||||
static dataProcessedSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static connectCountSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static connectCountSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}>;
|
||||
static messageCountSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static messageCountSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}>;
|
||||
static clientErrorSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static clientErrorSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}>;
|
||||
static executionErrorSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
}>;
|
||||
static executionErrorSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
Route: string;
|
||||
}>;
|
||||
static _4XxErrorSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static _4XxErrorSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
}>;
|
||||
static _4XxErrorSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static _4XxErrorSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static _5XxErrorSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static _5XxErrorSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
}>;
|
||||
static _5XxErrorSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static _5XxErrorSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static cacheHitCountSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static cacheHitCountSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
}>;
|
||||
static cacheHitCountSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static cacheHitCountSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static cacheMissCountSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static cacheMissCountSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
}>;
|
||||
static cacheMissCountSum(this: void, dimensions: {
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiName: string;
|
||||
Method: string;
|
||||
Resource: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
static cacheMissCountSum(this: void, dimensions: {
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}): MetricWithDims<{
|
||||
ApiId: string;
|
||||
Stage: string;
|
||||
}>;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/apigatewayv2-canned-metrics.generated.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/apigatewayv2-canned-metrics.generated.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiGatewayMetrics=void 0;class ApiGatewayMetrics{static _4XxSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"4xx",dimensionsMap:dimensions,statistic:"Sum"}}static _5XxSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"5xx",dimensionsMap:dimensions,statistic:"Sum"}}static countSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"Count",dimensionsMap:dimensions,statistic:"Sum"}}static integrationLatencyAverage(dimensions){return{namespace:"AWS/ApiGateway",metricName:"IntegrationLatency",dimensionsMap:dimensions,statistic:"Average"}}static latencyAverage(dimensions){return{namespace:"AWS/ApiGateway",metricName:"Latency",dimensionsMap:dimensions,statistic:"Average"}}static integrationErrorSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"IntegrationError",dimensionsMap:dimensions,statistic:"Sum"}}static dataProcessedSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"DataProcessed",dimensionsMap:dimensions,statistic:"Sum"}}static connectCountSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"ConnectCount",dimensionsMap:dimensions,statistic:"Sum"}}static messageCountSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"MessageCount",dimensionsMap:dimensions,statistic:"Sum"}}static clientErrorSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"ClientError",dimensionsMap:dimensions,statistic:"Sum"}}static executionErrorSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"ExecutionError",dimensionsMap:dimensions,statistic:"Sum"}}static _4XxErrorSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"4XXError",dimensionsMap:dimensions,statistic:"Sum"}}static _5XxErrorSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"5XXError",dimensionsMap:dimensions,statistic:"Sum"}}static cacheHitCountSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"CacheHitCount",dimensionsMap:dimensions,statistic:"Sum"}}static cacheMissCountSum(dimensions){return{namespace:"AWS/ApiGateway",metricName:"CacheMissCount",dimensionsMap:dimensions,statistic:"Sum"}}}exports.ApiGatewayMetrics=ApiGatewayMetrics;
|
||||
3854
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/apigatewayv2.generated.d.ts
generated
vendored
Normal file
3854
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/apigatewayv2.generated.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/apigatewayv2.generated.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/apigatewayv2.generated.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
31
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/access-log.d.ts
generated
vendored
Normal file
31
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/access-log.d.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { IStage } from './stage';
|
||||
import type { ILogGroupRef } from '../../../interfaces/generated/aws-logs-interfaces.generated';
|
||||
/**
|
||||
* Access log destination for a HttpApi Stage.
|
||||
*/
|
||||
export interface IAccessLogDestination {
|
||||
/**
|
||||
* Binds this destination to the HttpApi Stage.
|
||||
*/
|
||||
bind(stage: IStage): AccessLogDestinationConfig;
|
||||
}
|
||||
/**
|
||||
* Options when binding a log destination to a HttpApi Stage.
|
||||
*/
|
||||
export interface AccessLogDestinationConfig {
|
||||
/**
|
||||
* The Amazon Resource Name (ARN) of the destination resource
|
||||
*/
|
||||
readonly destinationArn: string;
|
||||
}
|
||||
/**
|
||||
* Use CloudWatch Logs as a custom access log destination for API Gateway.
|
||||
*/
|
||||
export declare class LogGroupLogDestination implements IAccessLogDestination {
|
||||
private readonly logGroup;
|
||||
constructor(logGroup: ILogGroupRef);
|
||||
/**
|
||||
* Binds this destination to the CloudWatch Logs.
|
||||
*/
|
||||
bind(_stage: IStage): AccessLogDestinationConfig;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/access-log.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/access-log.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LogGroupLogDestination=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class LogGroupLogDestination{logGroup;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_apigatewayv2.LogGroupLogDestination",version:"2.252.0"};constructor(logGroup){this.logGroup=logGroup;try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_logs_ILogGroupRef(logGroup)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,LogGroupLogDestination),error}}bind(_stage){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_apigatewayv2_IStage(_stage)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{destinationArn:this.logGroup.logGroupRef.logGroupArn}}}exports.LogGroupLogDestination=LogGroupLogDestination;
|
||||
92
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/api-mapping.d.ts
generated
vendored
Normal file
92
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/api-mapping.d.ts
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IDomainName } from './domain-name';
|
||||
import type { IStage } from './stage';
|
||||
import type { IResource } from '../../../core';
|
||||
import { Resource } from '../../../core';
|
||||
import type { ApiMappingReference, IApiMappingRef, IApiRef, IDomainNameRef } from '../../../interfaces/generated/aws-apigatewayv2-interfaces.generated';
|
||||
/**
|
||||
* Represents an ApiGatewayV2 ApiMapping resource
|
||||
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-apimapping.html
|
||||
*/
|
||||
export interface IApiMapping extends IResource, IApiMappingRef {
|
||||
/**
|
||||
* ID of the api mapping
|
||||
* @attribute
|
||||
*/
|
||||
readonly apiMappingId: string;
|
||||
}
|
||||
/**
|
||||
* Properties used to create the ApiMapping resource
|
||||
*/
|
||||
export interface ApiMappingProps {
|
||||
/**
|
||||
* Api mapping key. The path where this stage should be mapped to on the domain
|
||||
* @default - undefined for the root path mapping.
|
||||
*/
|
||||
readonly apiMappingKey?: string;
|
||||
/**
|
||||
* The Api to which this mapping is applied
|
||||
*/
|
||||
readonly api: IApiRef;
|
||||
/**
|
||||
* custom domain name of the mapping target
|
||||
*/
|
||||
readonly domainName: IDomainNameRef;
|
||||
/**
|
||||
* stage for the ApiMapping resource
|
||||
* required for WebSocket API
|
||||
* defaults to default stage of an HTTP API
|
||||
*
|
||||
* @default - Default stage of the passed API for HTTP API, required for WebSocket API
|
||||
*/
|
||||
readonly stage?: IStage;
|
||||
}
|
||||
/**
|
||||
* The attributes used to import existing ApiMapping
|
||||
*/
|
||||
export interface ApiMappingAttributes {
|
||||
/**
|
||||
* The API mapping ID
|
||||
*/
|
||||
readonly apiMappingId: string;
|
||||
/**
|
||||
* Domain name
|
||||
*
|
||||
* @default - Certain operations on the referenced object may fail if not supplied
|
||||
*/
|
||||
readonly domainName?: string;
|
||||
}
|
||||
/**
|
||||
* Create a new API mapping for API Gateway API endpoint.
|
||||
* @resource AWS::ApiGatewayV2::ApiMapping
|
||||
*/
|
||||
export declare class ApiMapping extends Resource implements IApiMapping {
|
||||
/** Uniquely identifies this class. */
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* import from API ID
|
||||
*/
|
||||
static fromApiMappingAttributes(scope: Construct, id: string, attrs: ApiMappingAttributes): IApiMapping;
|
||||
/**
|
||||
* ID of the API Mapping
|
||||
*/
|
||||
readonly apiMappingId: string;
|
||||
/**
|
||||
* API Mapping key
|
||||
*/
|
||||
readonly mappingKey?: string;
|
||||
/**
|
||||
* API domain name
|
||||
*/
|
||||
private readonly _domainName;
|
||||
constructor(scope: Construct, id: string, props: ApiMappingProps);
|
||||
/**
|
||||
* API domain name
|
||||
*/
|
||||
get domainName(): IDomainName;
|
||||
get apiMappingRef(): ApiMappingReference;
|
||||
/**
|
||||
* Return the domain for this API Mapping
|
||||
*/
|
||||
get domainUrl(): string;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/api-mapping.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/api-mapping.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
37
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/api.d.ts
generated
vendored
Normal file
37
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/api.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import type * as cloudwatch from '../../../aws-cloudwatch';
|
||||
import type { IResource } from '../../../core';
|
||||
import type { IApiRef } from '../apigatewayv2.generated';
|
||||
/**
|
||||
* Represents a API Gateway HTTP/WebSocket API
|
||||
*/
|
||||
export interface IApi extends IResource, IApiRef {
|
||||
/**
|
||||
* The identifier of this API Gateway API.
|
||||
* @attribute
|
||||
*/
|
||||
readonly apiId: string;
|
||||
/**
|
||||
* The default endpoint for an API
|
||||
* @attribute
|
||||
*/
|
||||
readonly apiEndpoint: string;
|
||||
/**
|
||||
* Return the given named metric for this Api Gateway
|
||||
*
|
||||
* @default - average over 5 minutes
|
||||
*/
|
||||
metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
|
||||
}
|
||||
/**
|
||||
* Supported IP Address Types
|
||||
*/
|
||||
export declare enum IpAddressType {
|
||||
/**
|
||||
* IPv4 address type
|
||||
*/
|
||||
IPV4 = "ipv4",
|
||||
/**
|
||||
* IPv4 and IPv6 address type
|
||||
*/
|
||||
DUAL_STACK = "dualstack"
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/api.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/api.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IpAddressType=void 0;var IpAddressType;(function(IpAddressType2){IpAddressType2.IPV4="ipv4",IpAddressType2.DUAL_STACK="dualstack"})(IpAddressType||(exports.IpAddressType=IpAddressType={}));
|
||||
12
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/authorizer.d.ts
generated
vendored
Normal file
12
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/authorizer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { IResource } from '../../../core';
|
||||
import type { IAuthorizerRef } from '../apigatewayv2.generated';
|
||||
/**
|
||||
* Represents an Authorizer.
|
||||
*/
|
||||
export interface IAuthorizer extends IResource, IAuthorizerRef {
|
||||
/**
|
||||
* Id of the Authorizer
|
||||
* @attribute
|
||||
*/
|
||||
readonly authorizerId: string;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/authorizer.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/authorizer.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
||||
57
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/base.d.ts
generated
vendored
Normal file
57
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/base.d.ts
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { IApi } from './api';
|
||||
import { ApiMapping } from './api-mapping';
|
||||
import type { DomainMappingOptions, IAccessLogSettings, IStage } from './stage';
|
||||
import type { AccessLogFormat } from '../../../aws-apigateway/lib';
|
||||
import * as cloudwatch from '../../../aws-cloudwatch';
|
||||
import { Resource } from '../../../core';
|
||||
import type { CfnStage, IApiRef, StageReference } from '../apigatewayv2.generated';
|
||||
/**
|
||||
* Base class representing an API
|
||||
* @internal
|
||||
*/
|
||||
export declare abstract class ApiBase extends Resource implements IApi {
|
||||
abstract readonly apiId: string;
|
||||
abstract readonly apiEndpoint: string;
|
||||
metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
|
||||
get apiRef(): IApiRef['apiRef'];
|
||||
}
|
||||
/**
|
||||
* Base class representing a Stage
|
||||
* @internal
|
||||
*/
|
||||
export declare abstract class StageBase extends Resource implements IStage {
|
||||
private stageVariables;
|
||||
abstract readonly stageName: string;
|
||||
protected abstract readonly baseApi: IApi;
|
||||
/**
|
||||
* The created ApiMapping if domain mapping has been added
|
||||
* @internal
|
||||
*/
|
||||
protected _apiMapping?: ApiMapping;
|
||||
/**
|
||||
* The URL to this stage.
|
||||
*/
|
||||
abstract get url(): string;
|
||||
/**
|
||||
* The default Access Logging format of this stage.
|
||||
*/
|
||||
abstract defaultAccessLogFormat(): AccessLogFormat;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
protected _addDomainMapping(domainMapping: DomainMappingOptions): void;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
protected _validateAccessLogSettings(props?: IAccessLogSettings): CfnStage.AccessLogSettingsProperty | undefined;
|
||||
metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
|
||||
addStageVariable(name: string, value: string): void;
|
||||
/**
|
||||
* Returns the stage variables for this stage.
|
||||
* @internal
|
||||
*/
|
||||
protected get _stageVariables(): {
|
||||
[key: string]: string;
|
||||
} | undefined;
|
||||
get stageRef(): StageReference;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/base.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/base.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StageBase=exports.ApiBase=void 0;var api_mapping_1=()=>{var tmp=require("./api-mapping");return api_mapping_1=()=>tmp,tmp},cloudwatch=()=>{var tmp=require("../../../aws-cloudwatch");return cloudwatch=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},errors_1=()=>{var tmp=require("../../../core/lib/errors");return errors_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class ApiBase extends core_1().Resource{metric(metricName,props){return new(cloudwatch()).Metric({namespace:"AWS/ApiGateway",metricName,dimensionsMap:{ApiId:this.apiId},...props}).attachTo(this)}get apiRef(){return{apiId:this.apiId}}}exports.ApiBase=ApiBase;class StageBase extends core_1().Resource{stageVariables={};_apiMapping;_addDomainMapping(domainMapping){if(this._apiMapping)throw new(errors_1()).UnscopedValidationError((0,literal_string_1().lit)`OnlyApimappingAllowedStage`,"Only one ApiMapping allowed per Stage");this._apiMapping=new(api_mapping_1()).ApiMapping(this,`${domainMapping.domainName}${domainMapping.mappingKey}`,{api:this.baseApi,domainName:domainMapping.domainName,stage:this,apiMappingKey:domainMapping.mappingKey}),this.node.addDependency(domainMapping.domainName)}_validateAccessLogSettings(props){if(!props)return;const format=props.format;if(format&&!core_1().Token.isUnresolved(format.toString())&&!/\$context\.(?:requestId|extendedRequestId)\b/.test(format.toString()))throw new(errors_1()).ValidationError((0,literal_string_1().lit)`AccessIncludeEither`,"Access log must include either `AccessLogFormat.contextRequestId()` or `AccessLogFormat.contextExtendedRequestId()`",this);return{destinationArn:props.destination.bind(this).destinationArn,format:format?format.toString():this.defaultAccessLogFormat().toString()}}metric(metricName,props){return this.baseApi.metric(metricName,props).with({dimensionsMap:{ApiId:this.baseApi.apiId,Stage:this.stageName}}).attachTo(this)}addStageVariable(name,value){this.stageVariables[name]=value}get _stageVariables(){return Object.keys(this.stageVariables).length>0?{...this.stageVariables}:void 0}get stageRef(){return{stageName:this.stageName}}}exports.StageBase=StageBase;
|
||||
168
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/domain-name.d.ts
generated
vendored
Normal file
168
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/domain-name.d.ts
generated
vendored
Normal file
@@ -0,0 +1,168 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IpAddressType } from './api';
|
||||
import type { IBucket } from '../../../aws-s3';
|
||||
import type { IResource } from '../../../core';
|
||||
import { Resource } from '../../../core';
|
||||
import type { ICertificateRef } from '../../../interfaces/generated/aws-certificatemanager-interfaces.generated';
|
||||
import type { DomainNameReference, IDomainNameRef } from '../apigatewayv2.generated';
|
||||
/**
|
||||
* The minimum version of the SSL protocol that you want API Gateway to use for HTTPS connections.
|
||||
*/
|
||||
export declare enum SecurityPolicy {
|
||||
/** Cipher suite TLS 1.0 */
|
||||
TLS_1_0 = "TLS_1_0",
|
||||
/** Cipher suite TLS 1.2 */
|
||||
TLS_1_2 = "TLS_1_2"
|
||||
}
|
||||
/**
|
||||
* Endpoint type for a domain name.
|
||||
*/
|
||||
export declare enum EndpointType {
|
||||
/**
|
||||
* For an edge-optimized custom domain name.
|
||||
*/
|
||||
EDGE = "EDGE",
|
||||
/**
|
||||
* For a regional custom domain name.
|
||||
*/
|
||||
REGIONAL = "REGIONAL"
|
||||
}
|
||||
/**
|
||||
* Represents an APIGatewayV2 DomainName
|
||||
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-domainname.html
|
||||
*/
|
||||
export interface IDomainName extends IResource, IDomainNameRef {
|
||||
/**
|
||||
* The custom domain name
|
||||
* @attribute
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* The domain name associated with the regional endpoint for this custom domain name.
|
||||
* @attribute
|
||||
*/
|
||||
readonly regionalDomainName: string;
|
||||
/**
|
||||
* The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint.
|
||||
* @attribute
|
||||
*/
|
||||
readonly regionalHostedZoneId: string;
|
||||
}
|
||||
/**
|
||||
* custom domain name attributes
|
||||
*/
|
||||
export interface DomainNameAttributes {
|
||||
/**
|
||||
* domain name string
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* The domain name associated with the regional endpoint for this custom domain name.
|
||||
*/
|
||||
readonly regionalDomainName: string;
|
||||
/**
|
||||
* The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint.
|
||||
*/
|
||||
readonly regionalHostedZoneId: string;
|
||||
}
|
||||
/**
|
||||
* properties used for creating the DomainName
|
||||
*/
|
||||
export interface DomainNameProps extends EndpointOptions {
|
||||
/**
|
||||
* The custom domain name
|
||||
*/
|
||||
readonly domainName: string;
|
||||
/**
|
||||
* The mutual TLS authentication configuration for a custom domain name.
|
||||
* @default - mTLS is not configured.
|
||||
*/
|
||||
readonly mtls?: MTLSConfig;
|
||||
}
|
||||
/**
|
||||
* properties for creating a domain name endpoint
|
||||
*/
|
||||
export interface EndpointOptions {
|
||||
/**
|
||||
* The ACM certificate for this domain name.
|
||||
* Certificate can be both ACM issued or imported.
|
||||
*/
|
||||
readonly certificate: ICertificateRef;
|
||||
/**
|
||||
* The user-friendly name of the certificate that will be used by the endpoint for this domain name.
|
||||
* @default - No friendly certificate name
|
||||
*/
|
||||
readonly certificateName?: string;
|
||||
/**
|
||||
* The type of endpoint for this DomainName.
|
||||
* @default EndpointType.REGIONAL
|
||||
*/
|
||||
readonly endpointType?: EndpointType;
|
||||
/**
|
||||
* The Transport Layer Security (TLS) version + cipher suite for this domain name.
|
||||
* @default SecurityPolicy.TLS_1_2
|
||||
*/
|
||||
readonly securityPolicy?: SecurityPolicy;
|
||||
/**
|
||||
* A public certificate issued by ACM to validate that you own a custom domain. This parameter is required
|
||||
* only when you configure mutual TLS authentication and you specify an ACM imported or private CA certificate
|
||||
* for `certificate`. The ownership certificate validates that you have permissions to use the domain name.
|
||||
* @default - only required when configuring mTLS
|
||||
*/
|
||||
readonly ownershipCertificate?: ICertificateRef;
|
||||
/**
|
||||
* The IP address types that can invoke the API.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-ip-address-type.html
|
||||
*
|
||||
* @default undefined - AWS default is IPV4
|
||||
*/
|
||||
readonly ipAddressType?: IpAddressType;
|
||||
}
|
||||
/**
|
||||
* The mTLS authentication configuration for a custom domain name.
|
||||
*/
|
||||
export interface MTLSConfig {
|
||||
/**
|
||||
* The bucket that the trust store is hosted in.
|
||||
*/
|
||||
readonly bucket: IBucket;
|
||||
/**
|
||||
* The key in S3 to look at for the trust store
|
||||
*/
|
||||
readonly key: string;
|
||||
/**
|
||||
* The version of the S3 object that contains your truststore.
|
||||
* To specify a version, you must have versioning enabled for the S3 bucket.
|
||||
* @default - latest version
|
||||
*/
|
||||
readonly version?: string;
|
||||
}
|
||||
/**
|
||||
* Custom domain resource for the API
|
||||
*/
|
||||
export declare class DomainName extends Resource implements IDomainName {
|
||||
/**
|
||||
* Uniquely identifies this class.
|
||||
*/
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* Import from attributes
|
||||
*/
|
||||
static fromDomainNameAttributes(scope: Construct, id: string, attrs: DomainNameAttributes): IDomainName;
|
||||
readonly name: string;
|
||||
private readonly domainNameConfigurations;
|
||||
private readonly resource;
|
||||
constructor(scope: Construct, id: string, props: DomainNameProps);
|
||||
private configureMTLS;
|
||||
/**
|
||||
* Adds an endpoint to a domain name.
|
||||
* @param options domain name endpoint properties to be set
|
||||
*/
|
||||
addEndpoint(options: EndpointOptions): void;
|
||||
private validateEndpointType;
|
||||
get regionalDomainName(): string;
|
||||
get regionalHostedZoneId(): string;
|
||||
private get domainNameArn();
|
||||
get domainNameRef(): DomainNameReference;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/domain-name.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/domain-name.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
8
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/index.d.ts
generated
vendored
Normal file
8
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export * from './access-log';
|
||||
export * from './api';
|
||||
export * from './integration';
|
||||
export * from './route';
|
||||
export * from './stage';
|
||||
export * from './domain-name';
|
||||
export * from './api-mapping';
|
||||
export * from './authorizer';
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/index.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.LogGroupLogDestination=void 0,Object.defineProperty(exports,_noFold="LogGroupLogDestination",{enumerable:!0,configurable:!0,get:()=>{var value=require("./access-log").LogGroupLogDestination;return Object.defineProperty(exports,_noFold="LogGroupLogDestination",{enumerable:!0,configurable:!0,value}),value}}),exports.IpAddressType=void 0,Object.defineProperty(exports,_noFold="IpAddressType",{enumerable:!0,configurable:!0,get:()=>{var value=require("./api").IpAddressType;return Object.defineProperty(exports,_noFold="IpAddressType",{enumerable:!0,configurable:!0,value}),value}}),exports.SecurityPolicy=void 0,Object.defineProperty(exports,_noFold="SecurityPolicy",{enumerable:!0,configurable:!0,get:()=>{var value=require("./domain-name").SecurityPolicy;return Object.defineProperty(exports,_noFold="SecurityPolicy",{enumerable:!0,configurable:!0,value}),value}}),exports.EndpointType=void 0,Object.defineProperty(exports,_noFold="EndpointType",{enumerable:!0,configurable:!0,get:()=>{var value=require("./domain-name").EndpointType;return Object.defineProperty(exports,_noFold="EndpointType",{enumerable:!0,configurable:!0,value}),value}}),exports.DomainName=void 0,Object.defineProperty(exports,_noFold="DomainName",{enumerable:!0,configurable:!0,get:()=>{var value=require("./domain-name").DomainName;return Object.defineProperty(exports,_noFold="DomainName",{enumerable:!0,configurable:!0,value}),value}}),exports.ApiMapping=void 0,Object.defineProperty(exports,_noFold="ApiMapping",{enumerable:!0,configurable:!0,get:()=>{var value=require("./api-mapping").ApiMapping;return Object.defineProperty(exports,_noFold="ApiMapping",{enumerable:!0,configurable:!0,value}),value}});
|
||||
12
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/integration.d.ts
generated
vendored
Normal file
12
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/integration.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { IResource } from '../../../core';
|
||||
import type { IIntegrationRef } from '../apigatewayv2.generated';
|
||||
/**
|
||||
* Represents an integration to an API Route.
|
||||
*/
|
||||
export interface IIntegration extends IResource, IIntegrationRef {
|
||||
/**
|
||||
* Id of the integration.
|
||||
* @attribute
|
||||
*/
|
||||
readonly integrationId: string;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/integration.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/integration.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
||||
12
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/route.d.ts
generated
vendored
Normal file
12
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/route.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { IResource } from '../../../core';
|
||||
import type { IRouteRef } from '../apigatewayv2.generated';
|
||||
/**
|
||||
* Represents a route.
|
||||
*/
|
||||
export interface IRoute extends IResource, IRouteRef {
|
||||
/**
|
||||
* Id of the Route
|
||||
* @attribute
|
||||
*/
|
||||
readonly routeId: string;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/route.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/route.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
||||
146
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/stage.d.ts
generated
vendored
Normal file
146
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/stage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
import type { IAccessLogDestination } from './access-log';
|
||||
import type { AccessLogFormat } from '../../../aws-apigateway/lib';
|
||||
import type { Metric, MetricOptions } from '../../../aws-cloudwatch';
|
||||
import type { IResource } from '../../../core';
|
||||
import type { IDomainNameRef, IStageRef } from '../apigatewayv2.generated';
|
||||
/**
|
||||
* Represents a Stage.
|
||||
*/
|
||||
export interface IStage extends IResource, IStageRef {
|
||||
/**
|
||||
* The name of the stage; its primary identifier.
|
||||
* @attribute
|
||||
*/
|
||||
readonly stageName: string;
|
||||
/**
|
||||
* The URL to this stage.
|
||||
*/
|
||||
readonly url: string;
|
||||
/**
|
||||
* Return the given named metric for this HTTP Api Gateway Stage
|
||||
*
|
||||
* @default - average over 5 minutes
|
||||
*/
|
||||
metric(metricName: string, props?: MetricOptions): Metric;
|
||||
/**
|
||||
* Adds a stage variable to this stage.
|
||||
*
|
||||
* @param name The name of the stage variable.
|
||||
* @param value The value of the stage variable.
|
||||
*
|
||||
* The allowed characters for variable names and the required pattern for variable values are specified here: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-apigateway-stage.html#cfn-apigateway-stage-variables
|
||||
*/
|
||||
addStageVariable(name: string, value: string): void;
|
||||
}
|
||||
/**
|
||||
* Options for DomainMapping
|
||||
*/
|
||||
export interface DomainMappingOptions {
|
||||
/**
|
||||
* The domain name for the mapping
|
||||
*
|
||||
*/
|
||||
readonly domainName: IDomainNameRef;
|
||||
/**
|
||||
* The API mapping key. Leave it undefined for the root path mapping.
|
||||
* @default - empty key for the root path mapping
|
||||
*/
|
||||
readonly mappingKey?: string;
|
||||
}
|
||||
/**
|
||||
* Options required to create a new stage.
|
||||
* Options that are common between HTTP and Websocket APIs.
|
||||
*/
|
||||
export interface StageOptions {
|
||||
/**
|
||||
* Whether updates to an API automatically trigger a new deployment.
|
||||
* @default false
|
||||
*/
|
||||
readonly autoDeploy?: boolean;
|
||||
/**
|
||||
* The options for custom domain and api mapping
|
||||
*
|
||||
* @default - no custom domain and api mapping configuration
|
||||
*/
|
||||
readonly domainMapping?: DomainMappingOptions;
|
||||
/**
|
||||
* Throttle settings for the routes of this stage
|
||||
*
|
||||
* @default - no throttling configuration
|
||||
*/
|
||||
readonly throttle?: ThrottleSettings;
|
||||
/**
|
||||
* The description for the API stage
|
||||
*
|
||||
* @default - no description
|
||||
*/
|
||||
readonly description?: string;
|
||||
/**
|
||||
* Specifies whether detailed metrics are enabled.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly detailedMetricsEnabled?: boolean;
|
||||
/**
|
||||
* Settings for access logging.
|
||||
*
|
||||
* @default - No access logging
|
||||
*/
|
||||
readonly accessLogSettings?: IAccessLogSettings;
|
||||
/**
|
||||
* Stage variables for the stage.
|
||||
* These are key-value pairs that you can define and use in your API routes.
|
||||
*
|
||||
* The allowed characters for variable names and the required pattern for variable values are specified here: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-apigateway-stage.html#cfn-apigateway-stage-variables
|
||||
*
|
||||
* @default - No stage variables
|
||||
*/
|
||||
readonly stageVariables?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* The attributes used to import existing Stage
|
||||
*/
|
||||
export interface StageAttributes {
|
||||
/**
|
||||
* The name of the stage
|
||||
*/
|
||||
readonly stageName: string;
|
||||
}
|
||||
/**
|
||||
* Container for defining throttling parameters to API stages
|
||||
*/
|
||||
export interface ThrottleSettings {
|
||||
/**
|
||||
* The API request steady-state rate limit (average requests per second over an extended period of time)
|
||||
* @default none
|
||||
*/
|
||||
readonly rateLimit?: number;
|
||||
/**
|
||||
* The maximum API request rate limit over a time ranging from one to a few seconds.
|
||||
* @default none
|
||||
*/
|
||||
readonly burstLimit?: number;
|
||||
}
|
||||
/**
|
||||
* Settings for access logging.
|
||||
*/
|
||||
export interface IAccessLogSettings {
|
||||
/**
|
||||
* The destination where to write access logs.
|
||||
*
|
||||
* @default - No destination
|
||||
*/
|
||||
readonly destination: IAccessLogDestination;
|
||||
/**
|
||||
* A single line format of access logs of data, as specified by selected $context variables.
|
||||
* The format must include either `AccessLogFormat.contextRequestId()`
|
||||
* or `AccessLogFormat.contextExtendedRequestId()`.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging-variables.html
|
||||
*
|
||||
* @default - Common Log Format
|
||||
*/
|
||||
readonly format?: AccessLogFormat;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/stage.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/common/stage.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
||||
24
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/api-helper.d.ts
generated
vendored
Normal file
24
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/api-helper.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { IHttpApiRef } from './api';
|
||||
/**
|
||||
* Calculations and operations for HTTP APIs
|
||||
*/
|
||||
export declare class HttpApiHelper {
|
||||
private readonly httpApi;
|
||||
/**
|
||||
* Return an `HttpApiHelper` for the given HTTP API
|
||||
*/
|
||||
static fromHttpApi(httpApi: IHttpApiRef): HttpApiHelper;
|
||||
private constructor();
|
||||
/**
|
||||
* Get the "execute-api" ARN.
|
||||
*
|
||||
* When 'ANY' is passed to the method, an ARN with the method set to '*' is obtained.
|
||||
*
|
||||
* @default - The default behavior applies when no specific method, path, or stage is provided.
|
||||
* In this case, the ARN will cover all methods, all resources, and all stages of this API.
|
||||
* Specifically, if 'method' is not specified, it defaults to '*', representing all methods.
|
||||
* If 'path' is not specified, it defaults to '/*', representing all paths.
|
||||
* If 'stage' is not specified, it also defaults to '*', representing all stages.
|
||||
*/
|
||||
arnForExecuteApi(method?: string, path?: string, stage?: string): string;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/api-helper.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/api-helper.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpApiHelper=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class HttpApiHelper{httpApi;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_apigatewayv2.HttpApiHelper",version:"2.252.0"};static fromHttpApi(httpApi){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_apigatewayv2_IHttpApiRef(httpApi)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromHttpApi),error}return new HttpApiHelper(httpApi)}constructor(httpApi){this.httpApi=httpApi}arnForExecuteApi(method,path,stage){if(path&&!core_1().Token.isUnresolved(path)&&!path.startsWith("/"))throw new(core_1()).ValidationError((0,literal_string_1().lit)`PathStart`,`Path must start with '/': ${path}`,this.httpApi);return method&&method.toUpperCase()==="ANY"&&(method="*"),core_1().Stack.of(this.httpApi).formatArn({service:"execute-api",account:this.httpApi.env.account,region:this.httpApi.env.region,resource:this.httpApi.apiRef.apiId,arnFormat:core_1().ArnFormat.SLASH_RESOURCE_NAME,resourceName:`${stage??"*"}/${method??"*"}${path??"/*"}`})}}exports.HttpApiHelper=HttpApiHelper;
|
||||
363
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/api.d.ts
generated
vendored
Normal file
363
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/api.d.ts
generated
vendored
Normal file
@@ -0,0 +1,363 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IHttpRouteAuthorizer } from './authorizer';
|
||||
import type { HttpRouteIntegration } from './integration';
|
||||
import type { BatchHttpRouteOptions } from './route';
|
||||
import { HttpMethod, HttpRoute } from './route';
|
||||
import type { IHttpStage, HttpStageOptions } from './stage';
|
||||
import { HttpStage } from './stage';
|
||||
import type { VpcLinkProps } from './vpc-link';
|
||||
import { VpcLink } from './vpc-link';
|
||||
import type { Metric, MetricOptions } from '../../../aws-cloudwatch';
|
||||
import type { Duration } from '../../../core';
|
||||
import type { ApiReference, IApiRef } from '../apigatewayv2.generated';
|
||||
import type { IApi, IpAddressType } from '../common/api';
|
||||
import { ApiBase } from '../common/base';
|
||||
import type { DomainMappingOptions } from '../common/stage';
|
||||
/**
|
||||
* Represents a reference to an HTTP API
|
||||
*/
|
||||
export interface IHttpApiRef extends IApiRef {
|
||||
/**
|
||||
* Indicates that this is an HTTP API
|
||||
*
|
||||
* Will always return true, but is necessary to prevent accidental structural
|
||||
* equality in TypeScript.
|
||||
*/
|
||||
readonly isHttpApi: boolean;
|
||||
}
|
||||
/**
|
||||
* Represents an HTTP API
|
||||
*/
|
||||
export interface IHttpApi extends IApi, IHttpApiRef {
|
||||
/**
|
||||
* Default Authorizer applied to all routes in the gateway.
|
||||
*
|
||||
* @attribute
|
||||
* @default - no default authorizer
|
||||
*/
|
||||
readonly defaultAuthorizer?: IHttpRouteAuthorizer;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @attribute
|
||||
* @default - no default authorization scopes
|
||||
*/
|
||||
readonly defaultAuthorizationScopes?: string[];
|
||||
/**
|
||||
* The default stage of this API
|
||||
*
|
||||
* @attribute
|
||||
* @default - a stage will be created
|
||||
*/
|
||||
readonly defaultStage?: IHttpStage;
|
||||
/**
|
||||
* Metric for the number of client-side errors captured in a given period.
|
||||
*
|
||||
* @default - sum over 5 minutes
|
||||
*/
|
||||
metricClientError(props?: MetricOptions): Metric;
|
||||
/**
|
||||
* Metric for the number of server-side errors captured in a given period.
|
||||
*
|
||||
* @default - sum over 5 minutes
|
||||
*/
|
||||
metricServerError(props?: MetricOptions): Metric;
|
||||
/**
|
||||
* Metric for the amount of data processed in bytes.
|
||||
*
|
||||
* @default - sum over 5 minutes
|
||||
*/
|
||||
metricDataProcessed(props?: MetricOptions): Metric;
|
||||
/**
|
||||
* Metric for the total number API requests in a given period.
|
||||
*
|
||||
* @default - SampleCount over 5 minutes
|
||||
*/
|
||||
metricCount(props?: MetricOptions): Metric;
|
||||
/**
|
||||
* Metric for the time between when API Gateway relays a request to the backend
|
||||
* and when it receives a response from the backend.
|
||||
*
|
||||
* @default - no statistic
|
||||
*/
|
||||
metricIntegrationLatency(props?: MetricOptions): 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.
|
||||
*
|
||||
* @default - no statistic
|
||||
*/
|
||||
metricLatency(props?: MetricOptions): Metric;
|
||||
/**
|
||||
* Add a new VpcLink
|
||||
*/
|
||||
addVpcLink(options: VpcLinkProps): VpcLink;
|
||||
/**
|
||||
* Get the "execute-api" ARN.
|
||||
* When 'ANY' is passed to the method, an ARN with the method set to '*' is obtained.
|
||||
*
|
||||
* @default - The default behavior applies when no specific method, path, or stage is provided.
|
||||
* In this case, the ARN will cover all methods, all resources, and all stages of this API.
|
||||
* Specifically, if 'method' is not specified, it defaults to '*', representing all methods.
|
||||
* If 'path' is not specified, it defaults to '/*', representing all paths.
|
||||
* If 'stage' is not specified, it also defaults to '*', representing all stages.
|
||||
*/
|
||||
arnForExecuteApi(method?: string, path?: string, stage?: string): string;
|
||||
}
|
||||
/**
|
||||
* Properties to initialize an instance of `HttpApi`.
|
||||
*/
|
||||
export interface HttpApiProps {
|
||||
/**
|
||||
* Name for the HTTP API resource
|
||||
* @default - id of the HttpApi construct.
|
||||
*/
|
||||
readonly apiName?: string;
|
||||
/**
|
||||
* The description of the API.
|
||||
* @default - none
|
||||
*/
|
||||
readonly description?: string;
|
||||
/**
|
||||
* An integration that will be configured on the catch-all route ($default).
|
||||
* @default - none
|
||||
*/
|
||||
readonly defaultIntegration?: HttpRouteIntegration;
|
||||
/**
|
||||
* Whether a default stage and deployment should be automatically created.
|
||||
* @default true
|
||||
*/
|
||||
readonly createDefaultStage?: boolean;
|
||||
/**
|
||||
* Specifies a CORS configuration for an API.
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html
|
||||
* @default - CORS disabled.
|
||||
*/
|
||||
readonly corsPreflight?: CorsPreflightOptions;
|
||||
/**
|
||||
* Configure a custom domain with the API mapping resource to the HTTP API
|
||||
*
|
||||
* @default - no default domain mapping configured. meaningless if `createDefaultStage` is `false`.
|
||||
*/
|
||||
readonly defaultDomainMapping?: DomainMappingOptions;
|
||||
/**
|
||||
* 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.
|
||||
* @default false execute-api endpoint enabled.
|
||||
*/
|
||||
readonly disableExecuteApiEndpoint?: boolean;
|
||||
/**
|
||||
* Default Authorizer applied to all routes in the gateway.
|
||||
*
|
||||
* @default - no default authorizer
|
||||
*/
|
||||
readonly defaultAuthorizer?: IHttpRouteAuthorizer;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @default - no default authorization scopes
|
||||
*/
|
||||
readonly defaultAuthorizationScopes?: string[];
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly routeSelectionExpression?: boolean;
|
||||
/**
|
||||
* The IP address types that can invoke the API.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-ip-address-type.html
|
||||
*
|
||||
* @default undefined - AWS default is IPV4
|
||||
*/
|
||||
readonly ipAddressType?: IpAddressType;
|
||||
}
|
||||
/**
|
||||
* Supported CORS HTTP methods
|
||||
*/
|
||||
export declare enum CorsHttpMethod {
|
||||
/** HTTP ANY */
|
||||
ANY = "*",
|
||||
/** HTTP DELETE */
|
||||
DELETE = "DELETE",
|
||||
/** HTTP GET */
|
||||
GET = "GET",
|
||||
/** HTTP HEAD */
|
||||
HEAD = "HEAD",
|
||||
/** HTTP OPTIONS */
|
||||
OPTIONS = "OPTIONS",
|
||||
/** HTTP PATCH */
|
||||
PATCH = "PATCH",
|
||||
/** HTTP POST */
|
||||
POST = "POST",
|
||||
/** HTTP PUT */
|
||||
PUT = "PUT"
|
||||
}
|
||||
/**
|
||||
* Options for the CORS Configuration
|
||||
*/
|
||||
export interface CorsPreflightOptions {
|
||||
/**
|
||||
* Specifies whether credentials are included in the CORS request.
|
||||
* @default false
|
||||
*/
|
||||
readonly allowCredentials?: boolean;
|
||||
/**
|
||||
* Represents a collection of allowed headers.
|
||||
* @default - No Headers are allowed.
|
||||
*/
|
||||
readonly allowHeaders?: string[];
|
||||
/**
|
||||
* Represents a collection of allowed HTTP methods.
|
||||
* @default - No Methods are allowed.
|
||||
*/
|
||||
readonly allowMethods?: CorsHttpMethod[];
|
||||
/**
|
||||
* Represents a collection of allowed origins.
|
||||
* @default - No Origins are allowed.
|
||||
*/
|
||||
readonly allowOrigins?: string[];
|
||||
/**
|
||||
* Represents a collection of exposed headers.
|
||||
* @default - No Expose Headers are allowed.
|
||||
*/
|
||||
readonly exposeHeaders?: string[];
|
||||
/**
|
||||
* The duration that the browser should cache preflight request results.
|
||||
* @default Duration.seconds(0)
|
||||
*/
|
||||
readonly maxAge?: Duration;
|
||||
}
|
||||
/**
|
||||
* Options for the Route with Integration resource
|
||||
*/
|
||||
export interface AddRoutesOptions extends BatchHttpRouteOptions {
|
||||
/**
|
||||
* The path at which all of these routes are configured.
|
||||
*/
|
||||
readonly path: string;
|
||||
/**
|
||||
* The HTTP methods to be configured
|
||||
* @default HttpMethod.ANY
|
||||
*/
|
||||
readonly methods?: HttpMethod[];
|
||||
/**
|
||||
* Authorizer to be associated to these routes.
|
||||
*
|
||||
* Use NoneAuthorizer to remove the default authorizer for the api
|
||||
*
|
||||
* @default - uses the default authorizer if one is specified on the HttpApi
|
||||
*/
|
||||
readonly authorizer?: IHttpRouteAuthorizer;
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @default - uses defaultAuthorizationScopes if configured on the API, otherwise none.
|
||||
*/
|
||||
readonly authorizationScopes?: string[];
|
||||
}
|
||||
declare abstract class HttpApiBase extends ApiBase implements IHttpApi {
|
||||
abstract readonly apiId: string;
|
||||
abstract readonly httpApiId: string;
|
||||
abstract readonly apiEndpoint: string;
|
||||
readonly isHttpApi = true;
|
||||
private vpcLinks;
|
||||
metricClientError(props?: MetricOptions): Metric;
|
||||
metricServerError(props?: MetricOptions): Metric;
|
||||
metricDataProcessed(props?: MetricOptions): Metric;
|
||||
metricCount(props?: MetricOptions): Metric;
|
||||
metricIntegrationLatency(props?: MetricOptions): Metric;
|
||||
metricLatency(props?: MetricOptions): Metric;
|
||||
addVpcLink(options: VpcLinkProps): VpcLink;
|
||||
arnForExecuteApi(method?: string, path?: string, stage?: string): string;
|
||||
get apiRef(): ApiReference;
|
||||
}
|
||||
/**
|
||||
* Attributes for importing an HttpApi into the CDK
|
||||
*/
|
||||
export interface HttpApiAttributes {
|
||||
/**
|
||||
* The identifier of the HttpApi
|
||||
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#aws-resource-apigatewayv2-api-return-values
|
||||
*/
|
||||
readonly httpApiId: string;
|
||||
/**
|
||||
* The endpoint URL of the HttpApi
|
||||
* @default - throws an error if apiEndpoint is accessed.
|
||||
*/
|
||||
readonly apiEndpoint?: string;
|
||||
}
|
||||
/**
|
||||
* Create a new API Gateway HTTP API endpoint.
|
||||
* @resource AWS::ApiGatewayV2::Api
|
||||
*/
|
||||
export declare class HttpApi extends HttpApiBase {
|
||||
/**
|
||||
* Uniquely identifies this class.
|
||||
*/
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* Import an existing HTTP API into this CDK app.
|
||||
*/
|
||||
static fromHttpApiAttributes(scope: Construct, id: string, attrs: HttpApiAttributes): IHttpApi;
|
||||
/**
|
||||
* A human friendly name for this HTTP API. Note that this is different from `httpApiId`.
|
||||
*/
|
||||
readonly httpApiName?: string;
|
||||
readonly apiId: string;
|
||||
/**
|
||||
* The identifier of the HTTP API.
|
||||
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-api.html#aws-resource-apigatewayv2-api-return-values
|
||||
*/
|
||||
readonly httpApiId: string;
|
||||
/**
|
||||
* Specifies whether clients can invoke this HTTP API by using the default execute-api endpoint.
|
||||
*/
|
||||
readonly disableExecuteApiEndpoint?: boolean;
|
||||
/**
|
||||
* The default stage of this API
|
||||
*/
|
||||
readonly defaultStage: IHttpStage | undefined;
|
||||
/**
|
||||
* Default Authorizer applied to all routes in the gateway.
|
||||
*/
|
||||
readonly defaultAuthorizer?: IHttpRouteAuthorizer;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
readonly defaultAuthorizationScopes?: string[];
|
||||
private readonly _apiEndpoint;
|
||||
constructor(scope: Construct, id: string, props?: HttpApiProps);
|
||||
/**
|
||||
* Get the default endpoint for this API.
|
||||
*/
|
||||
get apiEndpoint(): string;
|
||||
/**
|
||||
* Get the URL to the default stage of this API.
|
||||
* Returns `undefined` if `createDefaultStage` is unset.
|
||||
*/
|
||||
get url(): string | undefined;
|
||||
/**
|
||||
* Add a new stage.
|
||||
*/
|
||||
addStage(id: string, options: HttpStageOptions): HttpStage;
|
||||
/**
|
||||
* Add multiple routes that uses the same configuration. The routes all go to the same path, but for different
|
||||
* methods.
|
||||
*/
|
||||
addRoutes(options: AddRoutesOptions): HttpRoute[];
|
||||
}
|
||||
export declare function toIHttpApi(x: IHttpApiRef): IHttpApi;
|
||||
export {};
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/api.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/api.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
198
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/authorizer.d.ts
generated
vendored
Normal file
198
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/authorizer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,198 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IHttpApiRef } from './api';
|
||||
import type { IHttpRoute } from './route';
|
||||
import type { IRoleRef } from '../../../aws-iam';
|
||||
import type { Duration } from '../../../core';
|
||||
import { Resource } from '../../../core';
|
||||
import type { IAuthorizer } from '../common';
|
||||
import type { AuthorizerReference } from '../index';
|
||||
/**
|
||||
* Supported Authorizer types
|
||||
*/
|
||||
export declare enum HttpAuthorizerType {
|
||||
/** IAM Authorizer */
|
||||
IAM = "AWS_IAM",
|
||||
/** JSON Web Tokens */
|
||||
JWT = "JWT",
|
||||
/** Lambda Authorizer */
|
||||
LAMBDA = "REQUEST"
|
||||
}
|
||||
/**
|
||||
* Payload format version for lambda authorizers
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html
|
||||
*/
|
||||
export declare enum AuthorizerPayloadVersion {
|
||||
/** Version 1.0 */
|
||||
VERSION_1_0 = "1.0",
|
||||
/** Version 2.0 */
|
||||
VERSION_2_0 = "2.0"
|
||||
}
|
||||
/**
|
||||
* Properties to initialize an instance of `HttpAuthorizer`.
|
||||
*/
|
||||
export interface HttpAuthorizerProps {
|
||||
/**
|
||||
* Name of the authorizer
|
||||
* @default - id of the HttpAuthorizer construct.
|
||||
*/
|
||||
readonly authorizerName?: string;
|
||||
/**
|
||||
* HTTP Api to attach the authorizer to
|
||||
*/
|
||||
readonly httpApi: IHttpApiRef;
|
||||
/**
|
||||
* The type of authorizer
|
||||
*/
|
||||
readonly type: HttpAuthorizerType;
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
readonly identitySource: string[];
|
||||
/**
|
||||
* 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.
|
||||
* @default - required for JWT authorizer typess.
|
||||
*/
|
||||
readonly jwtAudience?: string[];
|
||||
/**
|
||||
* The base domain of the identity provider that issues JWT.
|
||||
* @default - required for JWT authorizer types.
|
||||
*/
|
||||
readonly jwtIssuer?: string;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @default - The lambda authorizer must return an IAM policy as its response
|
||||
*/
|
||||
readonly enableSimpleResponses?: boolean;
|
||||
/**
|
||||
* Specifies the format of the payload sent to an HTTP API Lambda authorizer.
|
||||
*
|
||||
* @default AuthorizerPayloadVersion.VERSION_2_0 if the authorizer type is HttpAuthorizerType.LAMBDA
|
||||
*/
|
||||
readonly payloadFormatVersion?: AuthorizerPayloadVersion;
|
||||
/**
|
||||
* The authorizer's Uniform Resource Identifier (URI).
|
||||
*
|
||||
* For REQUEST authorizers, this must be a well-formed Lambda function URI.
|
||||
*
|
||||
* @default - required for Request authorizer types
|
||||
*/
|
||||
readonly authorizerUri?: string;
|
||||
/**
|
||||
* How long APIGateway should cache the results. Max 1 hour.
|
||||
*
|
||||
* @default - API Gateway will not cache authorizer responses
|
||||
*/
|
||||
readonly resultsCacheTtl?: Duration;
|
||||
/**
|
||||
* The IAM role that the API Gateway service assumes while invoking the authorizer.
|
||||
*
|
||||
* Supported only for REQUEST authorizers.
|
||||
*
|
||||
* @default - No role
|
||||
*/
|
||||
readonly role?: IRoleRef;
|
||||
}
|
||||
/**
|
||||
* An authorizer for HTTP APIs
|
||||
*/
|
||||
export interface IHttpAuthorizer extends IAuthorizer {
|
||||
}
|
||||
/**
|
||||
* Reference to an http authorizer
|
||||
*/
|
||||
export interface HttpAuthorizerAttributes {
|
||||
/**
|
||||
* Id of the Authorizer
|
||||
*/
|
||||
readonly authorizerId: string;
|
||||
/**
|
||||
* Type of authorizer
|
||||
*
|
||||
* Possible values are:
|
||||
* - JWT - JSON Web Token Authorizer
|
||||
* - CUSTOM - Lambda Authorizer
|
||||
* - NONE - No Authorization
|
||||
*/
|
||||
readonly authorizerType: string;
|
||||
}
|
||||
/**
|
||||
* An authorizer for Http Apis
|
||||
* @resource AWS::ApiGatewayV2::Authorizer
|
||||
*/
|
||||
export declare class HttpAuthorizer extends Resource implements IHttpAuthorizer {
|
||||
/**
|
||||
* Uniquely identifies this class.
|
||||
*/
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* Import an existing HTTP Authorizer into this CDK app.
|
||||
*/
|
||||
static fromHttpAuthorizerAttributes(scope: Construct, id: string, attrs: HttpAuthorizerAttributes): IHttpRouteAuthorizer;
|
||||
readonly authorizerId: string;
|
||||
private readonly apiId;
|
||||
constructor(scope: Construct, id: string, props: HttpAuthorizerProps);
|
||||
get authorizerRef(): AuthorizerReference;
|
||||
}
|
||||
/**
|
||||
* Input to the bind() operation, that binds an authorizer to a route.
|
||||
*/
|
||||
export interface HttpRouteAuthorizerBindOptions {
|
||||
/**
|
||||
* The route to which the authorizer is being bound.
|
||||
*/
|
||||
readonly route: IHttpRoute;
|
||||
/**
|
||||
* The scope for any constructs created as part of the bind.
|
||||
*/
|
||||
readonly scope: Construct;
|
||||
}
|
||||
/**
|
||||
* Results of binding an authorizer to an http route.
|
||||
*/
|
||||
export interface HttpRouteAuthorizerConfig {
|
||||
/**
|
||||
* The authorizer id
|
||||
*
|
||||
* @default - No authorizer id (useful for AWS_IAM route authorizer)
|
||||
*/
|
||||
readonly authorizerId?: string;
|
||||
/**
|
||||
* The type of authorization
|
||||
*
|
||||
* Possible values are:
|
||||
* - AWS_IAM - IAM Authorizer
|
||||
* - JWT - JSON Web Token Authorizer
|
||||
* - CUSTOM - Lambda Authorizer
|
||||
* - NONE - No Authorization
|
||||
*/
|
||||
readonly authorizationType: string;
|
||||
/**
|
||||
* The list of OIDC scopes to include in the authorization.
|
||||
* @default - no authorization scopes
|
||||
*/
|
||||
readonly authorizationScopes?: string[];
|
||||
}
|
||||
/**
|
||||
* An authorizer that can attach to an Http Route.
|
||||
*/
|
||||
export interface IHttpRouteAuthorizer {
|
||||
/**
|
||||
* Bind this authorizer to a specified Http route.
|
||||
*/
|
||||
bind(options: HttpRouteAuthorizerBindOptions): HttpRouteAuthorizerConfig;
|
||||
}
|
||||
/**
|
||||
* Explicitly configure no authorizers on specific HTTP API routes.
|
||||
*/
|
||||
export declare class HttpNoneAuthorizer implements IHttpRouteAuthorizer {
|
||||
/**
|
||||
* The authorizationType used for IAM Authorizer
|
||||
*/
|
||||
readonly authorizationType = "NONE";
|
||||
bind(_options: HttpRouteAuthorizerBindOptions): HttpRouteAuthorizerConfig;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/authorizer.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/authorizer.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/index.d.ts
generated
vendored
Normal file
7
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export * from './api';
|
||||
export * from './route';
|
||||
export * from './integration';
|
||||
export * from './stage';
|
||||
export * from './vpc-link';
|
||||
export * from './authorizer';
|
||||
export * from './api-helper';
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/index.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
341
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/integration.d.ts
generated
vendored
Normal file
341
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/integration.d.ts
generated
vendored
Normal file
@@ -0,0 +1,341 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IHttpApi, IHttpApiRef } from './api';
|
||||
import type { HttpMethod, IHttpRoute } from './route';
|
||||
import type { IntegrationReference } from '.././index';
|
||||
import type { IRoleRef } from '../../../aws-iam';
|
||||
import type { Duration } from '../../../core';
|
||||
import { Resource } from '../../../core';
|
||||
import type { IIntegration } from '../common';
|
||||
import type { ParameterMapping } from '../parameter-mapping';
|
||||
/**
|
||||
* Represents an Integration for an HTTP API.
|
||||
*/
|
||||
export interface IHttpIntegration extends IIntegration {
|
||||
/** The HTTP API associated with this integration */
|
||||
readonly httpApi: IHttpApi;
|
||||
}
|
||||
/**
|
||||
* Supported integration types
|
||||
*/
|
||||
export declare enum HttpIntegrationType {
|
||||
/**
|
||||
* Integration type is an HTTP proxy.
|
||||
*
|
||||
* For integrating the route or method request with an HTTP endpoint, with the
|
||||
* client request passed through as-is. This is also referred to as HTTP proxy
|
||||
* integration. For HTTP API private integrations, use an HTTP_PROXY integration.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-http.html
|
||||
*/
|
||||
HTTP_PROXY = "HTTP_PROXY",
|
||||
/**
|
||||
* Integration type is an AWS proxy.
|
||||
*
|
||||
* For integrating the route or method request with a Lambda function or other
|
||||
* AWS service action. This integration is also referred to as a Lambda proxy
|
||||
* integration.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services.html
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
||||
*/
|
||||
AWS_PROXY = "AWS_PROXY"
|
||||
}
|
||||
/**
|
||||
* Supported integration subtypes
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-aws-services-reference.html
|
||||
*/
|
||||
export declare enum HttpIntegrationSubtype {
|
||||
/**
|
||||
* EventBridge PutEvents integration
|
||||
*/
|
||||
EVENTBRIDGE_PUT_EVENTS = "EventBridge-PutEvents",
|
||||
/**
|
||||
* SQS SendMessage integration
|
||||
*/
|
||||
SQS_SEND_MESSAGE = "SQS-SendMessage",
|
||||
/**
|
||||
* SQS ReceiveMessage integration,
|
||||
*/
|
||||
SQS_RECEIVE_MESSAGE = "SQS-ReceiveMessage",
|
||||
/**
|
||||
* SQS DeleteMessage integration,
|
||||
*/
|
||||
SQS_DELETE_MESSAGE = "SQS-DeleteMessage",
|
||||
/**
|
||||
* SQS PurgeQueue integration
|
||||
*/
|
||||
SQS_PURGE_QUEUE = "SQS-PurgeQueue",
|
||||
/**
|
||||
* AppConfig GetConfiguration integration
|
||||
*/
|
||||
APPCONFIG_GET_CONFIGURATION = "AppConfig-GetConfiguration",
|
||||
/**
|
||||
* Kinesis PutRecord integration
|
||||
*/
|
||||
KINESIS_PUT_RECORD = "Kinesis-PutRecord",
|
||||
/**
|
||||
* Step Functions StartExecution integration
|
||||
*/
|
||||
STEPFUNCTIONS_START_EXECUTION = "StepFunctions-StartExecution",
|
||||
/**
|
||||
* Step Functions StartSyncExecution integration
|
||||
*/
|
||||
STEPFUNCTIONS_START_SYNC_EXECUTION = "StepFunctions-StartSyncExecution",
|
||||
/**
|
||||
* Step Functions StopExecution integration
|
||||
*/
|
||||
STEPFUNCTIONS_STOP_EXECUTION = "StepFunctions-StopExecution"
|
||||
}
|
||||
/**
|
||||
* Credentials used for AWS Service integrations.
|
||||
*/
|
||||
export declare abstract class IntegrationCredentials {
|
||||
/**
|
||||
* Use the specified role for integration requests
|
||||
*/
|
||||
static fromRole(role: IRoleRef): IntegrationCredentials;
|
||||
/** Use the calling user's identity to call the integration */
|
||||
static useCallerIdentity(): IntegrationCredentials;
|
||||
/**
|
||||
* The ARN of the credentials
|
||||
*/
|
||||
abstract readonly credentialsArn: string;
|
||||
}
|
||||
/**
|
||||
* Supported connection types
|
||||
*/
|
||||
export declare enum HttpConnectionType {
|
||||
/**
|
||||
* For private connections between API Gateway and resources in a VPC
|
||||
*/
|
||||
VPC_LINK = "VPC_LINK",
|
||||
/**
|
||||
* For connections through public routable internet
|
||||
*/
|
||||
INTERNET = "INTERNET"
|
||||
}
|
||||
/**
|
||||
* Payload format version for lambda proxy integration
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
||||
*/
|
||||
export declare class PayloadFormatVersion {
|
||||
/** Version 1.0 */
|
||||
static readonly VERSION_1_0: PayloadFormatVersion;
|
||||
/** Version 2.0 */
|
||||
static readonly VERSION_2_0: PayloadFormatVersion;
|
||||
/**
|
||||
* A custom payload version.
|
||||
* Typically used if there is a version number that the CDK doesn't support yet
|
||||
*/
|
||||
static custom(version: string): PayloadFormatVersion;
|
||||
/** version as a string */
|
||||
readonly version: string;
|
||||
private constructor();
|
||||
}
|
||||
/**
|
||||
* The integration properties
|
||||
*/
|
||||
export interface HttpIntegrationProps {
|
||||
/**
|
||||
* The HTTP API to which this integration should be bound.
|
||||
*/
|
||||
readonly httpApi: IHttpApiRef;
|
||||
/**
|
||||
* Integration type
|
||||
*/
|
||||
readonly integrationType: HttpIntegrationType;
|
||||
/**
|
||||
* Integration subtype.
|
||||
*
|
||||
* Used for AWS Service integrations, specifies the target of the integration.
|
||||
*
|
||||
* @default - none, required if no `integrationUri` is defined.
|
||||
*/
|
||||
readonly integrationSubtype?: HttpIntegrationSubtype;
|
||||
/**
|
||||
* Integration URI.
|
||||
* This will be the function ARN in the case of `HttpIntegrationType.AWS_PROXY`,
|
||||
* or HTTP URL in the case of `HttpIntegrationType.HTTP_PROXY`.
|
||||
*
|
||||
* @default - none, required if no `integrationSubtype` is defined.
|
||||
*/
|
||||
readonly integrationUri?: string;
|
||||
/**
|
||||
* The HTTP method to use when calling the underlying HTTP proxy
|
||||
* @default - none. required if the integration type is `HttpIntegrationType.HTTP_PROXY`.
|
||||
*/
|
||||
readonly method?: HttpMethod;
|
||||
/**
|
||||
* The ID of the VPC link for a private integration. Supported only for HTTP APIs.
|
||||
*
|
||||
* @default - undefined
|
||||
*/
|
||||
readonly connectionId?: string;
|
||||
/**
|
||||
* The type of the network connection to the integration endpoint
|
||||
*
|
||||
* @default HttpConnectionType.INTERNET
|
||||
*/
|
||||
readonly connectionType?: HttpConnectionType;
|
||||
/**
|
||||
* The version of the payload format
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
|
||||
* @default - defaults to latest in the case of HttpIntegrationType.AWS_PROXY`, irrelevant otherwise.
|
||||
*/
|
||||
readonly payloadFormatVersion?: PayloadFormatVersion;
|
||||
/**
|
||||
* Specifies the TLS configuration for a private integration
|
||||
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-integration-tlsconfig.html
|
||||
* @default undefined private integration traffic will use HTTP protocol
|
||||
*/
|
||||
readonly secureServerName?: string;
|
||||
/**
|
||||
* The maximum amount of time an integration will run before it returns without a response.
|
||||
* Must be between 50 milliseconds and 29 seconds.
|
||||
*
|
||||
* @default Duration.seconds(29)
|
||||
*/
|
||||
readonly timeout?: Duration;
|
||||
/**
|
||||
* 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
|
||||
* @default undefined requests are sent to the backend unmodified
|
||||
*/
|
||||
readonly parameterMapping?: ParameterMapping;
|
||||
/**
|
||||
* The credentials with which to invoke the integration.
|
||||
*
|
||||
* @default - no credentials, use resource-based permissions on supported AWS services
|
||||
*/
|
||||
readonly credentials?: IntegrationCredentials;
|
||||
}
|
||||
/**
|
||||
* The integration for an API route.
|
||||
* @resource AWS::ApiGatewayV2::Integration
|
||||
*/
|
||||
export declare class HttpIntegration extends Resource implements IHttpIntegration {
|
||||
/** Uniquely identifies this class. */
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
readonly integrationId: string;
|
||||
private readonly _httpApi;
|
||||
constructor(scope: Construct, id: string, props: HttpIntegrationProps);
|
||||
get httpApi(): IHttpApi;
|
||||
get integrationRef(): IntegrationReference;
|
||||
}
|
||||
/**
|
||||
* Options to the HttpRouteIntegration during its bind operation.
|
||||
*/
|
||||
export interface HttpRouteIntegrationBindOptions {
|
||||
/**
|
||||
* The route to which this is being bound.
|
||||
*/
|
||||
readonly route: IHttpRoute;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
readonly scope: Construct;
|
||||
}
|
||||
/**
|
||||
* The interface that various route integration classes will inherit.
|
||||
*/
|
||||
export declare abstract class HttpRouteIntegration {
|
||||
private readonly id;
|
||||
private integration?;
|
||||
/**
|
||||
* Initialize an integration for a route on http api.
|
||||
* @param id id of the underlying `HttpIntegration` construct.
|
||||
*/
|
||||
constructor(id: string);
|
||||
/**
|
||||
* Internal method called when binding this integration to the route.
|
||||
* @internal
|
||||
*/
|
||||
_bindToRoute(options: HttpRouteIntegrationBindOptions): {
|
||||
readonly integrationId: string;
|
||||
};
|
||||
/**
|
||||
* Complete the binding of the integration to the route. In some cases, there is
|
||||
* some additional work to do, such as adding permissions for the API to access
|
||||
* the target. This work is necessary whether the integration has just been
|
||||
* created for this route or it is an existing one, previously created for other
|
||||
* routes. In most cases, however, concrete implementations do not need to
|
||||
* override this method.
|
||||
*/
|
||||
protected completeBind(_options: HttpRouteIntegrationBindOptions): void;
|
||||
/**
|
||||
* Bind this integration to the route.
|
||||
*/
|
||||
abstract bind(options: HttpRouteIntegrationBindOptions): HttpRouteIntegrationConfig;
|
||||
}
|
||||
/**
|
||||
* Config returned back as a result of the bind.
|
||||
*/
|
||||
export interface HttpRouteIntegrationConfig {
|
||||
/**
|
||||
* Integration type.
|
||||
*/
|
||||
readonly type: HttpIntegrationType;
|
||||
/**
|
||||
* Integration subtype.
|
||||
*
|
||||
* @default - none, required if no `integrationUri` is defined.
|
||||
*/
|
||||
readonly subtype?: HttpIntegrationSubtype;
|
||||
/**
|
||||
* Integration URI
|
||||
*
|
||||
* @default - none, required if no `integrationSubtype` is defined.
|
||||
*/
|
||||
readonly uri?: string;
|
||||
/**
|
||||
* The HTTP method that must be used to invoke the underlying proxy.
|
||||
* Required for `HttpIntegrationType.HTTP_PROXY`
|
||||
* @default - undefined
|
||||
*/
|
||||
readonly method?: HttpMethod;
|
||||
/**
|
||||
* The ID of the VPC link for a private integration. Supported only for HTTP APIs.
|
||||
*
|
||||
* @default - undefined
|
||||
*/
|
||||
readonly connectionId?: string;
|
||||
/**
|
||||
* The type of the network connection to the integration endpoint
|
||||
*
|
||||
* @default HttpConnectionType.INTERNET
|
||||
*/
|
||||
readonly connectionType?: HttpConnectionType;
|
||||
/**
|
||||
* 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
|
||||
* @default - undefined
|
||||
*/
|
||||
readonly payloadFormatVersion: PayloadFormatVersion;
|
||||
/**
|
||||
* 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
|
||||
* @default undefined private integration traffic will use HTTP protocol
|
||||
*/
|
||||
readonly secureServerName?: string;
|
||||
/**
|
||||
* The maximum amount of time an integration will run before it returns without a response.
|
||||
* Must be between 50 milliseconds and 29 seconds.
|
||||
*
|
||||
* @default Duration.seconds(29)
|
||||
*/
|
||||
readonly timeout?: Duration;
|
||||
/**
|
||||
* 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
|
||||
* @default undefined requests are sent to the backend unmodified
|
||||
*/
|
||||
readonly parameterMapping?: ParameterMapping;
|
||||
/**
|
||||
* The credentials with which to invoke the integration.
|
||||
*
|
||||
* @default - no credentials, use resource-based permissions on supported AWS services
|
||||
*/
|
||||
readonly credentials?: IntegrationCredentials;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/integration.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/integration.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
151
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/route.d.ts
generated
vendored
Normal file
151
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/route.d.ts
generated
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
import { Construct } from 'constructs';
|
||||
import type { IHttpApi, IHttpApiRef } from './api';
|
||||
import type { IHttpRouteAuthorizer } from './authorizer';
|
||||
import type { HttpRouteIntegration } from './integration';
|
||||
import type { RouteReference } from '.././index';
|
||||
import * as iam from '../../../aws-iam';
|
||||
import { Resource } from '../../../core';
|
||||
import type { IRoute } from '../common';
|
||||
/**
|
||||
* Represents a Route for an HTTP API.
|
||||
*/
|
||||
export interface IHttpRoute extends IRoute {
|
||||
/**
|
||||
* The HTTP API associated with this route.
|
||||
*/
|
||||
readonly httpApi: IHttpApi;
|
||||
/**
|
||||
* Returns the path component of this HTTP route, `undefined` if the path is the catch-all route.
|
||||
*/
|
||||
readonly path?: string;
|
||||
/**
|
||||
* Returns the arn of the route.
|
||||
* @attribute
|
||||
*/
|
||||
readonly routeArn: string;
|
||||
/**
|
||||
* Grant access to invoke the route.
|
||||
* This method requires that the authorizer of the route is undefined or is
|
||||
* an `HttpIamAuthorizer`.
|
||||
*/
|
||||
grantInvoke(grantee: iam.IGrantable, options?: GrantInvokeOptions): iam.Grant;
|
||||
}
|
||||
/**
|
||||
* Options for granting invoke access.
|
||||
*/
|
||||
export interface GrantInvokeOptions {
|
||||
/**
|
||||
* The HTTP methods to allow.
|
||||
* @default - the HttpMethod of the route
|
||||
*/
|
||||
readonly httpMethods?: HttpMethod[];
|
||||
}
|
||||
/**
|
||||
* Supported HTTP methods
|
||||
*/
|
||||
export declare enum HttpMethod {
|
||||
/** HTTP ANY */
|
||||
ANY = "ANY",
|
||||
/** HTTP DELETE */
|
||||
DELETE = "DELETE",
|
||||
/** HTTP GET */
|
||||
GET = "GET",
|
||||
/** HTTP HEAD */
|
||||
HEAD = "HEAD",
|
||||
/** HTTP OPTIONS */
|
||||
OPTIONS = "OPTIONS",
|
||||
/** HTTP PATCH */
|
||||
PATCH = "PATCH",
|
||||
/** HTTP POST */
|
||||
POST = "POST",
|
||||
/** HTTP PUT */
|
||||
PUT = "PUT"
|
||||
}
|
||||
/**
|
||||
* HTTP route in APIGateway is a combination of the HTTP method and the path component.
|
||||
* This class models that combination.
|
||||
*/
|
||||
export declare class HttpRouteKey {
|
||||
/**
|
||||
* The catch-all route of the API, i.e., when no other routes match
|
||||
*/
|
||||
static readonly DEFAULT: HttpRouteKey;
|
||||
/**
|
||||
* Create a route key with the combination of the path and the method.
|
||||
* @param method default is 'ANY'
|
||||
*/
|
||||
static with(path: string, method?: HttpMethod): HttpRouteKey;
|
||||
/**
|
||||
* The method of the route
|
||||
*/
|
||||
readonly method: HttpMethod;
|
||||
/**
|
||||
* The key to the RouteKey as recognized by APIGateway
|
||||
*/
|
||||
readonly key: string;
|
||||
/**
|
||||
* The path part of this RouteKey.
|
||||
* Returns `undefined` when `RouteKey.DEFAULT` is used.
|
||||
*/
|
||||
readonly path?: string;
|
||||
private constructor();
|
||||
}
|
||||
/**
|
||||
* Options used when configuring multiple routes, at once.
|
||||
* The options here are the ones that would be configured for all being set up.
|
||||
*/
|
||||
export interface BatchHttpRouteOptions {
|
||||
/**
|
||||
* The integration to be configured on this route.
|
||||
*/
|
||||
readonly integration: HttpRouteIntegration;
|
||||
}
|
||||
/**
|
||||
* Properties to initialize a new Route
|
||||
*/
|
||||
export interface HttpRouteProps extends BatchHttpRouteOptions {
|
||||
/**
|
||||
* the API the route is associated with
|
||||
*/
|
||||
readonly httpApi: IHttpApiRef;
|
||||
/**
|
||||
* The key to this route. This is a combination of an HTTP method and an HTTP path.
|
||||
*/
|
||||
readonly routeKey: HttpRouteKey;
|
||||
/**
|
||||
* Authorizer for a WebSocket API or an HTTP API.
|
||||
* @default - No authorizer
|
||||
*/
|
||||
readonly authorizer?: IHttpRouteAuthorizer;
|
||||
/**
|
||||
* The list of OIDC scopes to include in the authorization.
|
||||
*
|
||||
* These scopes will be merged with the scopes from the attached authorizer
|
||||
* @default - no additional authorization scopes
|
||||
*/
|
||||
readonly authorizationScopes?: string[];
|
||||
}
|
||||
/**
|
||||
* Route class that creates the Route for API Gateway HTTP API
|
||||
* @resource AWS::ApiGatewayV2::Route
|
||||
*/
|
||||
export declare class HttpRoute extends Resource implements IHttpRoute {
|
||||
/**
|
||||
* Uniquely identifies this class.
|
||||
*/
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
readonly routeId: string;
|
||||
readonly path?: string;
|
||||
readonly routeArn: string;
|
||||
private readonly _httpApi;
|
||||
private readonly method;
|
||||
private readonly authBindResult?;
|
||||
constructor(scope: Construct, id: string, props: HttpRouteProps);
|
||||
private produceRouteArn;
|
||||
/**
|
||||
* [disable-awslint:no-grants]
|
||||
*/
|
||||
grantInvoke(grantee: iam.IGrantable, options?: GrantInvokeOptions): iam.Grant;
|
||||
get httpApi(): IHttpApi;
|
||||
get routeRef(): RouteReference;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/route.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/route.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
140
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/stage.d.ts
generated
vendored
Normal file
140
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/stage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IHttpApi, IHttpApiRef } from './api';
|
||||
import { AccessLogFormat } from '../../../aws-apigateway';
|
||||
import type { Metric, MetricOptions } from '../../../aws-cloudwatch';
|
||||
import type { StageOptions, IStage, StageAttributes } from '../common';
|
||||
import type { IApi } from '../common/api';
|
||||
import { StageBase } from '../common/base';
|
||||
import type { IStageRef } from '../index';
|
||||
/**
|
||||
* Represents a reference to an HTTP Stage
|
||||
*/
|
||||
export interface IHttpStageRef extends IStageRef {
|
||||
/**
|
||||
* Indicates that this is an HTTP Stage
|
||||
*
|
||||
* Will always return true, but is necessary to prevent accidental structural
|
||||
* equality in TypeScript.
|
||||
*/
|
||||
readonly isHttpStage: boolean;
|
||||
}
|
||||
/**
|
||||
* Represents the HttpStage
|
||||
*/
|
||||
export interface IHttpStage extends IStage, IHttpStageRef {
|
||||
/**
|
||||
* The API this stage is associated to.
|
||||
*/
|
||||
readonly api: IHttpApi;
|
||||
/**
|
||||
* The custom domain URL to this stage
|
||||
*/
|
||||
readonly domainUrl: string;
|
||||
/**
|
||||
* Metric for the number of client-side errors captured in a given period.
|
||||
*
|
||||
* @default - sum over 5 minutes
|
||||
*/
|
||||
metricClientError(props?: MetricOptions): Metric;
|
||||
/**
|
||||
* Metric for the number of server-side errors captured in a given period.
|
||||
*
|
||||
* @default - sum over 5 minutes
|
||||
*/
|
||||
metricServerError(props?: MetricOptions): Metric;
|
||||
/**
|
||||
* Metric for the amount of data processed in bytes.
|
||||
*
|
||||
* @default - sum over 5 minutes
|
||||
*/
|
||||
metricDataProcessed(props?: MetricOptions): Metric;
|
||||
/**
|
||||
* Metric for the total number API requests in a given period.
|
||||
*
|
||||
* @default - SampleCount over 5 minutes
|
||||
*/
|
||||
metricCount(props?: MetricOptions): Metric;
|
||||
/**
|
||||
* Metric for the time between when API Gateway relays a request to the backend
|
||||
* and when it receives a response from the backend.
|
||||
*
|
||||
* @default - no statistic
|
||||
*/
|
||||
metricIntegrationLatency(props?: MetricOptions): 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.
|
||||
*
|
||||
* @default - no statistic
|
||||
*/
|
||||
metricLatency(props?: MetricOptions): Metric;
|
||||
}
|
||||
/**
|
||||
* The options to create a new Stage for an HTTP API
|
||||
*/
|
||||
export interface HttpStageOptions extends StageOptions {
|
||||
/**
|
||||
* The name of the stage. See `StageName` class for more details.
|
||||
* @default '$default' the default stage of the API. This stage will have the URL at the root of the API endpoint.
|
||||
*/
|
||||
readonly stageName?: string;
|
||||
}
|
||||
/**
|
||||
* Properties to initialize an instance of `HttpStage`.
|
||||
*/
|
||||
export interface HttpStageProps extends HttpStageOptions {
|
||||
/**
|
||||
* The HTTP API to which this stage is associated.
|
||||
*/
|
||||
readonly httpApi: IHttpApiRef;
|
||||
}
|
||||
/**
|
||||
* The attributes used to import existing HttpStage
|
||||
*/
|
||||
export interface HttpStageAttributes extends StageAttributes {
|
||||
/**
|
||||
* The API to which this stage is associated
|
||||
*/
|
||||
readonly api: IHttpApi;
|
||||
}
|
||||
declare abstract class HttpStageBase extends StageBase implements IHttpStage {
|
||||
readonly isHttpStage = true;
|
||||
abstract readonly domainUrl: string;
|
||||
abstract readonly api: IHttpApi;
|
||||
metricClientError(props?: MetricOptions): Metric;
|
||||
metricServerError(props?: MetricOptions): Metric;
|
||||
metricDataProcessed(props?: MetricOptions): Metric;
|
||||
metricCount(props?: MetricOptions): Metric;
|
||||
metricIntegrationLatency(props?: MetricOptions): Metric;
|
||||
metricLatency(props?: MetricOptions): Metric;
|
||||
}
|
||||
/**
|
||||
* Represents a stage where an instance of the API is deployed.
|
||||
* @resource AWS::ApiGatewayV2::Stage
|
||||
*/
|
||||
export declare class HttpStage extends HttpStageBase {
|
||||
/** Uniquely identifies this class. */
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* Import an existing stage into this CDK app.
|
||||
*/
|
||||
static fromHttpStageAttributes(scope: Construct, id: string, attrs: HttpStageAttributes): IHttpStage;
|
||||
readonly stageName: string;
|
||||
private readonly _api;
|
||||
constructor(scope: Construct, id: string, props: HttpStageProps);
|
||||
get api(): IHttpApi;
|
||||
protected get baseApi(): IApi;
|
||||
/**
|
||||
* The URL to this stage.
|
||||
*/
|
||||
get url(): string;
|
||||
get domainUrl(): string;
|
||||
/**
|
||||
* CLF Log format for HTTP API Stage.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging.html
|
||||
*/
|
||||
defaultAccessLogFormat(): AccessLogFormat;
|
||||
}
|
||||
export {};
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/stage.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/stage.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
86
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/vpc-link.d.ts
generated
vendored
Normal file
86
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/vpc-link.d.ts
generated
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import * as ec2 from '../../../aws-ec2';
|
||||
import type { IResource } from '../../../core';
|
||||
import { Resource } from '../../../core';
|
||||
import type { IVpcLinkRef, VpcLinkReference } from '../index';
|
||||
/**
|
||||
* Represents an API Gateway VpcLink
|
||||
*/
|
||||
export interface IVpcLink extends IResource, IVpcLinkRef {
|
||||
/**
|
||||
* Physical ID of the VpcLink resource
|
||||
* @attribute
|
||||
*/
|
||||
readonly vpcLinkId: string;
|
||||
/**
|
||||
* The VPC to which this VPC Link is associated with.
|
||||
*/
|
||||
readonly vpc: ec2.IVpc;
|
||||
}
|
||||
/**
|
||||
* Properties for a VpcLink
|
||||
*/
|
||||
export interface VpcLinkProps {
|
||||
/**
|
||||
* The VPC in which the private resources reside.
|
||||
*/
|
||||
readonly vpc: ec2.IVpc;
|
||||
/**
|
||||
* The name used to label and identify the VPC link.
|
||||
* @default - automatically generated name
|
||||
*/
|
||||
readonly vpcLinkName?: string;
|
||||
/**
|
||||
* A list of subnets for the VPC link.
|
||||
*
|
||||
* @default - private subnets of the provided VPC. Use `addSubnets` to add more subnets
|
||||
*/
|
||||
readonly subnets?: ec2.SubnetSelection;
|
||||
/**
|
||||
* A list of security groups for the VPC link.
|
||||
*
|
||||
* @default - no security groups. Use `addSecurityGroups` to add security groups
|
||||
*/
|
||||
readonly securityGroups?: ec2.ISecurityGroupRef[];
|
||||
}
|
||||
/**
|
||||
* Attributes when importing a new VpcLink
|
||||
*/
|
||||
export interface VpcLinkAttributes {
|
||||
/**
|
||||
* The VPC Link id
|
||||
*/
|
||||
readonly vpcLinkId: string;
|
||||
/**
|
||||
* The VPC to which this VPC link is associated with.
|
||||
*/
|
||||
readonly vpc: ec2.IVpc;
|
||||
}
|
||||
/**
|
||||
* 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).
|
||||
*/
|
||||
export declare class VpcLink extends Resource implements IVpcLink {
|
||||
/** Uniquely identifies this class. */
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* Import a VPC Link by specifying its attributes.
|
||||
*/
|
||||
static fromVpcLinkAttributes(scope: Construct, id: string, attrs: VpcLinkAttributes): IVpcLink;
|
||||
readonly vpcLinkId: string;
|
||||
readonly vpc: ec2.IVpc;
|
||||
private readonly subnets;
|
||||
private readonly securityGroups;
|
||||
constructor(scope: Construct, id: string, props: VpcLinkProps);
|
||||
/**
|
||||
* Adds the provided subnets to the vpc link
|
||||
*/
|
||||
addSubnets(...subnets: ec2.ISubnetRef[]): void;
|
||||
/**
|
||||
* Adds the provided security groups to the vpc link
|
||||
*/
|
||||
addSecurityGroups(...groups: ec2.ISecurityGroupRef[]): void;
|
||||
get vpcLinkRef(): VpcLinkReference;
|
||||
private renderSubnets;
|
||||
private renderSecurityGroups;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/vpc-link.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/http/vpc-link.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/index.d.ts
generated
vendored
Normal file
5
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from './common';
|
||||
export * from './http';
|
||||
export * from './websocket';
|
||||
export * from './parameter-mapping';
|
||||
export * from './apigatewayv2.generated';
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/index.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
105
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/parameter-mapping.d.ts
generated
vendored
Normal file
105
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/parameter-mapping.d.ts
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* Represents a Mapping Value.
|
||||
*/
|
||||
export interface IMappingValue {
|
||||
/**
|
||||
* Represents a Mapping Value.
|
||||
*/
|
||||
readonly value: string;
|
||||
}
|
||||
/**
|
||||
* Represents a Mapping Value.
|
||||
*/
|
||||
export declare class MappingValue implements IMappingValue {
|
||||
/**
|
||||
* Creates an empty mapping value.
|
||||
*/
|
||||
static readonly NONE: MappingValue;
|
||||
/**
|
||||
* Creates a header mapping value.
|
||||
*/
|
||||
static requestHeader(name: string): MappingValue;
|
||||
/**
|
||||
* Creates a query string mapping value.
|
||||
*/
|
||||
static requestQueryString(name: string): MappingValue;
|
||||
/**
|
||||
* Creates a request body mapping value.
|
||||
*/
|
||||
static requestBody(name: string): MappingValue;
|
||||
/**
|
||||
* Creates a request path mapping value.
|
||||
*/
|
||||
static requestPath(): MappingValue;
|
||||
/**
|
||||
* Creates a request path parameter mapping value.
|
||||
*/
|
||||
static requestPathParam(name: string): MappingValue;
|
||||
/**
|
||||
* Creates a context variable mapping value.
|
||||
*/
|
||||
static contextVariable(variableName: string): MappingValue;
|
||||
/**
|
||||
* Creates a stage variable mapping value.
|
||||
*/
|
||||
static stageVariable(variableName: string): MappingValue;
|
||||
/**
|
||||
* Creates a custom mapping value.
|
||||
*/
|
||||
static custom(value: string): MappingValue;
|
||||
/**
|
||||
* Represents a Mapping Value.
|
||||
*/
|
||||
readonly value: string;
|
||||
protected constructor(value: string);
|
||||
}
|
||||
/**
|
||||
* Represents a Parameter Mapping.
|
||||
*/
|
||||
export declare class ParameterMapping {
|
||||
/**
|
||||
* Creates a mapping from an object.
|
||||
*/
|
||||
static fromObject(obj: {
|
||||
[key: string]: MappingValue;
|
||||
}): ParameterMapping;
|
||||
/**
|
||||
* Represents all created parameter mappings.
|
||||
*/
|
||||
readonly mappings: {
|
||||
[key: string]: string;
|
||||
};
|
||||
constructor();
|
||||
/**
|
||||
* Creates a mapping to append a header.
|
||||
*/
|
||||
appendHeader(name: string, value: MappingValue): ParameterMapping;
|
||||
/**
|
||||
* Creates a mapping to overwrite a header.
|
||||
*/
|
||||
overwriteHeader(name: string, value: MappingValue): ParameterMapping;
|
||||
/**
|
||||
* Creates a mapping to remove a header.
|
||||
*/
|
||||
removeHeader(name: string): ParameterMapping;
|
||||
/**
|
||||
* Creates a mapping to append a query string.
|
||||
*/
|
||||
appendQueryString(name: string, value: MappingValue): ParameterMapping;
|
||||
/**
|
||||
* Creates a mapping to overwrite a querystring.
|
||||
*/
|
||||
overwriteQueryString(name: string, value: MappingValue): ParameterMapping;
|
||||
/**
|
||||
* Creates a mapping to remove a querystring.
|
||||
*/
|
||||
removeQueryString(name: string): ParameterMapping;
|
||||
/**
|
||||
* Creates a mapping to overwrite a path.
|
||||
*/
|
||||
overwritePath(value: MappingValue): ParameterMapping;
|
||||
/**
|
||||
* Creates a custom mapping.
|
||||
*/
|
||||
custom(key: string, value: string): ParameterMapping;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/parameter-mapping.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/parameter-mapping.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ParameterMapping=exports.MappingValue=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class MappingValue{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_apigatewayv2.MappingValue",version:"2.252.0"};static NONE=new MappingValue("");static requestHeader(name){return new MappingValue(`$request.header.${name}`)}static requestQueryString(name){return new MappingValue(`$request.querystring.${name}`)}static requestBody(name){return new MappingValue(`$request.body.${name}`)}static requestPath(){return new MappingValue("$request.path")}static requestPathParam(name){return new MappingValue(`$request.path.${name}`)}static contextVariable(variableName){return new MappingValue(`$context.${variableName}`)}static stageVariable(variableName){return new MappingValue(`$stageVariables.${variableName}`)}static custom(value){return new MappingValue(value)}value;constructor(value){this.value=value}}exports.MappingValue=MappingValue;class ParameterMapping{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_apigatewayv2.ParameterMapping",version:"2.252.0"};static fromObject(obj){const mapping=new ParameterMapping;for(const[k,m]of Object.entries(obj))mapping.custom(k,m.value);return mapping}mappings;constructor(){this.mappings={}}appendHeader(name,value){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_apigatewayv2_MappingValue(value)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.appendHeader),error}return this.mappings[`append:header.${name}`]=value.value,this}overwriteHeader(name,value){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_apigatewayv2_MappingValue(value)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.overwriteHeader),error}return this.mappings[`overwrite:header.${name}`]=value.value,this}removeHeader(name){return this.mappings[`remove:header.${name}`]="",this}appendQueryString(name,value){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_apigatewayv2_MappingValue(value)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.appendQueryString),error}return this.mappings[`append:querystring.${name}`]=value.value,this}overwriteQueryString(name,value){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_apigatewayv2_MappingValue(value)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.overwriteQueryString),error}return this.mappings[`overwrite:querystring.${name}`]=value.value,this}removeQueryString(name){return this.mappings[`remove:querystring.${name}`]="",this}overwritePath(value){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_apigatewayv2_MappingValue(value)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.overwritePath),error}return this.mappings["overwrite:path"]=value.value,this}custom(key,value){return this.mappings[key]=value,this}}exports.ParameterMapping=ParameterMapping;
|
||||
156
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api-key.d.ts
generated
vendored
Normal file
156
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api-key.d.ts
generated
vendored
Normal file
@@ -0,0 +1,156 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IResource as IResourceBase } from '../../../core';
|
||||
import { Resource } from '../../../core';
|
||||
import type { ThrottleSettings } from '../common';
|
||||
import type { QuotaSettings, UsagePlanPerApiStage } from './usage-plan';
|
||||
import type { ApiKeyReference, IApiKeyRef } from '../../../aws-apigateway/lib';
|
||||
import * as iam from '../../../aws-iam';
|
||||
/**
|
||||
* API keys are alphanumeric string values that you distribute to
|
||||
* app developer customers to grant access to your API
|
||||
*
|
||||
* API Keys are an API Gateway V1 concept.
|
||||
*/
|
||||
export interface IApiKey extends IResourceBase, IApiKeyRef {
|
||||
/**
|
||||
* The API key ID.
|
||||
* @attribute
|
||||
*/
|
||||
readonly keyId: string;
|
||||
/**
|
||||
* The API key ARN.
|
||||
* @attribute
|
||||
*/
|
||||
readonly keyArn: string;
|
||||
}
|
||||
/**
|
||||
* The options for creating an API Key.
|
||||
*/
|
||||
export interface ApiKeyOptions {
|
||||
/**
|
||||
* A name for the API key. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name.
|
||||
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-name
|
||||
* @default automatically generated name
|
||||
*/
|
||||
readonly apiKeyName?: string;
|
||||
/**
|
||||
* The value of the API key. Must be at least 20 characters long.
|
||||
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-value
|
||||
* @default none
|
||||
*/
|
||||
readonly value?: string;
|
||||
/**
|
||||
* A description of the purpose of the API key.
|
||||
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-description
|
||||
* @default none
|
||||
*/
|
||||
readonly description?: string;
|
||||
}
|
||||
/**
|
||||
* ApiKey Properties.
|
||||
*/
|
||||
export interface ApiKeyProps extends ApiKeyOptions {
|
||||
/**
|
||||
* An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.
|
||||
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-customerid
|
||||
* @default none
|
||||
*/
|
||||
readonly customerId?: string;
|
||||
/**
|
||||
* Indicates whether the API key can be used by clients.
|
||||
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-enabled
|
||||
* @default true
|
||||
*/
|
||||
readonly enabled?: boolean;
|
||||
/**
|
||||
* Specifies whether the key identifier is distinct from the created API key value.
|
||||
* @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-apikey.html#cfn-apigateway-apikey-generatedistinctid
|
||||
* @default false
|
||||
*/
|
||||
readonly generateDistinctId?: boolean;
|
||||
}
|
||||
/**
|
||||
* Base implementation that is common to the various implementations of IApiKey
|
||||
*/
|
||||
declare abstract class ApiKeyBase extends Resource implements IApiKey {
|
||||
abstract readonly keyId: string;
|
||||
abstract readonly keyArn: string;
|
||||
/**
|
||||
* Permits the IAM principal all read operations through this key
|
||||
* [disable-awslint:no-grants]
|
||||
*
|
||||
* @param grantee The principal to grant access to
|
||||
*/
|
||||
grantRead(grantee: iam.IGrantable): iam.Grant;
|
||||
/**
|
||||
* Permits the IAM principal all write operations through this key
|
||||
* [disable-awslint:no-grants]
|
||||
*
|
||||
* @param grantee The principal to grant access to
|
||||
*/
|
||||
grantWrite(grantee: iam.IGrantable): iam.Grant;
|
||||
/**
|
||||
* Permits the IAM principal all read and write operations through this key
|
||||
* [disable-awslint:no-grants]
|
||||
*
|
||||
* @param grantee The principal to grant access to
|
||||
*/
|
||||
grantReadWrite(grantee: iam.IGrantable): iam.Grant;
|
||||
get apiKeyRef(): ApiKeyReference;
|
||||
}
|
||||
/**
|
||||
* An API Gateway ApiKey.
|
||||
*
|
||||
* An ApiKey can be distributed to API clients that are connecting to
|
||||
* WebSocket APIs that require API key authentication. The key is used
|
||||
* to authenticate WebSocket connections and associate them with usage plans
|
||||
* for throttling and quota management.
|
||||
* @resource AWS::ApiGateway::ApiKey
|
||||
*/
|
||||
export declare class ApiKey extends ApiKeyBase {
|
||||
/**
|
||||
* Uniquely identifies this class.
|
||||
*/
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* Import an ApiKey by its Id
|
||||
*/
|
||||
static fromApiKeyId(scope: Construct, id: string, apiKeyId: string): IApiKey;
|
||||
readonly keyId: string;
|
||||
readonly keyArn: string;
|
||||
constructor(scope: Construct, id: string, props?: ApiKeyProps);
|
||||
}
|
||||
/**
|
||||
* RateLimitedApiKey properties.
|
||||
*/
|
||||
export interface RateLimitedApiKeyProps extends ApiKeyProps {
|
||||
/**
|
||||
* API Stages to be associated with the RateLimitedApiKey.
|
||||
*
|
||||
* @default none
|
||||
*/
|
||||
readonly apiStages?: UsagePlanPerApiStage[];
|
||||
/**
|
||||
* Number of requests clients can make in a given time period.
|
||||
* @default none
|
||||
*/
|
||||
readonly quota?: QuotaSettings;
|
||||
/**
|
||||
* Overall throttle settings for the API.
|
||||
* @default none
|
||||
*/
|
||||
readonly throttle?: ThrottleSettings;
|
||||
}
|
||||
/**
|
||||
* An API Gateway ApiKey, for which a rate limiting configuration can be specified.
|
||||
*
|
||||
* @resource AWS::ApiGateway::ApiKey
|
||||
*/
|
||||
export declare class RateLimitedApiKey extends ApiKeyBase {
|
||||
/** Uniquely identifies this class. */
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
readonly keyId: string;
|
||||
readonly keyArn: string;
|
||||
constructor(scope: Construct, id: string, props?: RateLimitedApiKeyProps);
|
||||
}
|
||||
export {};
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api-key.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api-key.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
164
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api.d.ts
generated
vendored
Normal file
164
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api.d.ts
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { WebSocketRouteOptions } from './route';
|
||||
import { WebSocketRoute } from './route';
|
||||
import type { IGrantable } from '../../../aws-iam';
|
||||
import { Grant } from '../../../aws-iam';
|
||||
import type { ApiReference, IApiRef } from '../apigatewayv2.generated';
|
||||
import type { IApi, IpAddressType } from '../common/api';
|
||||
import { ApiBase } from '../common/base';
|
||||
/**
|
||||
* Represents a reference to an HTTP API
|
||||
*/
|
||||
export interface IWebSocketApiRef extends IApiRef {
|
||||
/**
|
||||
* Indicates that this is a WebSocket API
|
||||
*
|
||||
* Will always return true, but is necessary to prevent accidental structural
|
||||
* equality in TypeScript.
|
||||
*/
|
||||
readonly isWebsocketApi: boolean;
|
||||
}
|
||||
/**
|
||||
* Represents a WebSocket API
|
||||
*/
|
||||
export interface IWebSocketApi extends IApi, IWebSocketApiRef {
|
||||
}
|
||||
/**
|
||||
* Represents the currently available API Key Selection Expressions
|
||||
*/
|
||||
export declare class WebSocketApiKeySelectionExpression {
|
||||
readonly customApiKeySelector: string;
|
||||
/**
|
||||
* The API will extract the key value from the `x-api-key` header in the user request.
|
||||
*/
|
||||
static readonly HEADER_X_API_KEY: WebSocketApiKeySelectionExpression;
|
||||
/**
|
||||
* The API will extract the key value from the `usageIdentifierKey` attribute in the `context` map,
|
||||
* returned by the Lambda Authorizer.
|
||||
* See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html
|
||||
*/
|
||||
static readonly AUTHORIZER_USAGE_IDENTIFIER_KEY: WebSocketApiKeySelectionExpression;
|
||||
/**
|
||||
* @param customApiKeySelector The expression used by API Gateway
|
||||
*/
|
||||
constructor(customApiKeySelector: string);
|
||||
}
|
||||
/**
|
||||
* Props for WebSocket API
|
||||
*/
|
||||
export interface WebSocketApiProps {
|
||||
/**
|
||||
* Name for the WebSocket API resource
|
||||
* @default - id of the WebSocketApi construct.
|
||||
*/
|
||||
readonly apiName?: string;
|
||||
/**
|
||||
* An API key selection expression. Providing this option will require an API Key be provided to access the API.
|
||||
* @default - Key is not required to access these APIs
|
||||
*/
|
||||
readonly apiKeySelectionExpression?: WebSocketApiKeySelectionExpression;
|
||||
/**
|
||||
* The description of the API.
|
||||
* @default - none
|
||||
*/
|
||||
readonly description?: string;
|
||||
/**
|
||||
* The route selection expression for the API
|
||||
* @default '$request.body.action'
|
||||
*/
|
||||
readonly routeSelectionExpression?: string;
|
||||
/**
|
||||
* Options to configure a '$connect' route
|
||||
*
|
||||
* @default - no '$connect' route configured
|
||||
*/
|
||||
readonly connectRouteOptions?: WebSocketRouteOptions;
|
||||
/**
|
||||
* Options to configure a '$disconnect' route
|
||||
*
|
||||
* @default - no '$disconnect' route configured
|
||||
*/
|
||||
readonly disconnectRouteOptions?: WebSocketRouteOptions;
|
||||
/**
|
||||
* Options to configure a '$default' route
|
||||
*
|
||||
* @default - no '$default' route configured
|
||||
*/
|
||||
readonly defaultRouteOptions?: WebSocketRouteOptions;
|
||||
/**
|
||||
* The IP address types that can invoke the API.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-ip-address-type.html
|
||||
*
|
||||
* @default undefined - AWS default is IPV4
|
||||
*/
|
||||
readonly ipAddressType?: IpAddressType;
|
||||
/**
|
||||
* Avoid validating models when creating a deployment.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly disableSchemaValidation?: boolean;
|
||||
}
|
||||
/**
|
||||
* Attributes for importing a WebSocketApi into the CDK
|
||||
*/
|
||||
export interface WebSocketApiAttributes {
|
||||
/**
|
||||
* The identifier of the WebSocketApi
|
||||
*/
|
||||
readonly webSocketId: string;
|
||||
/**
|
||||
* The endpoint URL of the WebSocketApi
|
||||
* @default - throw san error if apiEndpoint is accessed.
|
||||
*/
|
||||
readonly apiEndpoint?: string;
|
||||
}
|
||||
/**
|
||||
* Create a new API Gateway WebSocket API endpoint.
|
||||
* @resource AWS::ApiGatewayV2::Api
|
||||
*/
|
||||
export declare class WebSocketApi extends ApiBase implements IWebSocketApi {
|
||||
/** Uniquely identifies this class. */
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* Import an existing WebSocket API into this CDK app.
|
||||
*/
|
||||
static fromWebSocketApiAttributes(scope: Construct, id: string, attrs: WebSocketApiAttributes): IWebSocketApi;
|
||||
readonly isWebsocketApi = true;
|
||||
readonly apiId: string;
|
||||
readonly apiEndpoint: string;
|
||||
/**
|
||||
* A human friendly name for this WebSocket API. Note that this is different from `webSocketApiId`.
|
||||
*/
|
||||
readonly webSocketApiName?: string;
|
||||
constructor(scope: Construct, id: string, props?: WebSocketApiProps);
|
||||
/**
|
||||
* Add a new route
|
||||
*/
|
||||
addRoute(routeKey: string, options: WebSocketRouteOptions): WebSocketRoute;
|
||||
/**
|
||||
* Grant access to the API Gateway management API for this WebSocket API to an IAM
|
||||
* principal (Role/Group/User).
|
||||
* [disable-awslint:no-grants]
|
||||
*
|
||||
* @param identity The principal
|
||||
*/
|
||||
grantManageConnections(identity: IGrantable): Grant;
|
||||
/**
|
||||
* Get the "execute-api" ARN.
|
||||
*
|
||||
* @deprecated Use `arnForExecuteApiV2()` instead.
|
||||
*/
|
||||
arnForExecuteApi(method?: string, path?: string, stage?: string): string;
|
||||
/**
|
||||
* Get the "execute-api" ARN.
|
||||
*
|
||||
* @default - The default behavior applies when no specific route, or stage is provided.
|
||||
* In this case, the ARN will cover all routes, and all stages of this API.
|
||||
* Specifically, if 'route' is not specified, it defaults to '*', representing all routes.
|
||||
* If 'stage' is not specified, it also defaults to '*', representing all stages.
|
||||
*/
|
||||
arnForExecuteApiV2(route?: string, stage?: string): string;
|
||||
get apiRef(): ApiReference;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
133
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/authorizer.d.ts
generated
vendored
Normal file
133
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/authorizer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IWebSocketApi } from './api';
|
||||
import type { IWebSocketRoute } from './route';
|
||||
import { Resource } from '../../../core';
|
||||
import type { IAuthorizer } from '../common';
|
||||
import type { AuthorizerReference } from '../index';
|
||||
/**
|
||||
* Supported Authorizer types
|
||||
*/
|
||||
export declare enum WebSocketAuthorizerType {
|
||||
/** Lambda Authorizer */
|
||||
LAMBDA = "REQUEST",
|
||||
/** IAM Authorizer */
|
||||
IAM = "AWS_IAM"
|
||||
}
|
||||
/**
|
||||
* Properties to initialize an instance of `WebSocketAuthorizer`.
|
||||
*/
|
||||
export interface WebSocketAuthorizerProps {
|
||||
/**
|
||||
* Name of the authorizer
|
||||
* @default - id of the WebSocketAuthorizer construct.
|
||||
*/
|
||||
readonly authorizerName?: string;
|
||||
/**
|
||||
* WebSocket Api to attach the authorizer to
|
||||
*/
|
||||
readonly webSocketApi: IWebSocketApi;
|
||||
/**
|
||||
* The type of authorizer
|
||||
*/
|
||||
readonly type: WebSocketAuthorizerType;
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
readonly identitySource: string[];
|
||||
/**
|
||||
* The authorizer's Uniform Resource Identifier (URI).
|
||||
*
|
||||
* For REQUEST authorizers, this must be a well-formed Lambda function URI.
|
||||
*
|
||||
* @default - required for Request authorizer types
|
||||
*/
|
||||
readonly authorizerUri?: string;
|
||||
}
|
||||
/**
|
||||
* An authorizer for WebSocket APIs
|
||||
*/
|
||||
export interface IWebSocketAuthorizer extends IAuthorizer {
|
||||
}
|
||||
/**
|
||||
* Reference to an WebSocket authorizer
|
||||
*/
|
||||
export interface WebSocketAuthorizerAttributes {
|
||||
/**
|
||||
* Id of the Authorizer
|
||||
*/
|
||||
readonly authorizerId: string;
|
||||
/**
|
||||
* Type of authorizer
|
||||
*
|
||||
* Possible values are:
|
||||
* - CUSTOM - Lambda Authorizer
|
||||
* - NONE - No Authorization
|
||||
*/
|
||||
readonly authorizerType: string;
|
||||
}
|
||||
/**
|
||||
* An authorizer for WebSocket Apis
|
||||
* @resource AWS::ApiGatewayV2::Authorizer
|
||||
*/
|
||||
export declare class WebSocketAuthorizer extends Resource implements IWebSocketAuthorizer {
|
||||
/**
|
||||
* Uniquely identifies this class.
|
||||
*/
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* Import an existing WebSocket Authorizer into this CDK app.
|
||||
*/
|
||||
static fromWebSocketAuthorizerAttributes(scope: Construct, id: string, attrs: WebSocketAuthorizerAttributes): IWebSocketRouteAuthorizer;
|
||||
readonly authorizerId: string;
|
||||
private readonly apiId;
|
||||
constructor(scope: Construct, id: string, props: WebSocketAuthorizerProps);
|
||||
get authorizerRef(): AuthorizerReference;
|
||||
}
|
||||
/**
|
||||
* Input to the bind() operation, that binds an authorizer to a route.
|
||||
*/
|
||||
export interface WebSocketRouteAuthorizerBindOptions {
|
||||
/**
|
||||
* The route to which the authorizer is being bound.
|
||||
*/
|
||||
readonly route: IWebSocketRoute;
|
||||
/**
|
||||
* The scope for any constructs created as part of the bind.
|
||||
*/
|
||||
readonly scope: Construct;
|
||||
}
|
||||
/**
|
||||
* Results of binding an authorizer to an WebSocket route.
|
||||
*/
|
||||
export interface WebSocketRouteAuthorizerConfig {
|
||||
/**
|
||||
* The authorizer id
|
||||
*
|
||||
* @default - No authorizer id (useful for AWS_IAM route authorizer)
|
||||
*/
|
||||
readonly authorizerId?: string;
|
||||
/**
|
||||
* The type of authorization
|
||||
*
|
||||
* Possible values are:
|
||||
* - CUSTOM - Lambda Authorizer
|
||||
* - NONE - No Authorization
|
||||
*/
|
||||
readonly authorizationType: string;
|
||||
}
|
||||
/**
|
||||
* An authorizer that can attach to an WebSocket Route.
|
||||
*/
|
||||
export interface IWebSocketRouteAuthorizer {
|
||||
/**
|
||||
* Bind this authorizer to a specified WebSocket route.
|
||||
*/
|
||||
bind(options: WebSocketRouteAuthorizerBindOptions): WebSocketRouteAuthorizerConfig;
|
||||
}
|
||||
/**
|
||||
* Explicitly configure no authorizers on specific WebSocket API routes.
|
||||
*/
|
||||
export declare class WebSocketNoneAuthorizer implements IWebSocketRouteAuthorizer {
|
||||
bind(_options: WebSocketRouteAuthorizerBindOptions): WebSocketRouteAuthorizerConfig;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/authorizer.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/authorizer.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/index.d.ts
generated
vendored
Normal file
7
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export * from './api';
|
||||
export * from './route';
|
||||
export * from './stage';
|
||||
export * from './integration';
|
||||
export * from './authorizer';
|
||||
export * from './usage-plan';
|
||||
export * from './api-key';
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/index.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
266
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/integration.d.ts
generated
vendored
Normal file
266
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/integration.d.ts
generated
vendored
Normal file
@@ -0,0 +1,266 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IWebSocketApi, IWebSocketApiRef } from './api';
|
||||
import type { IWebSocketRoute } from './route';
|
||||
import type { IntegrationReference } from '.././index';
|
||||
import type { IRole } from '../../../aws-iam';
|
||||
import type { Duration } from '../../../core';
|
||||
import { Resource } from '../../../core';
|
||||
import type { IIntegration } from '../common';
|
||||
/**
|
||||
* Represents an Integration for an WebSocket API.
|
||||
*/
|
||||
export interface IWebSocketIntegration extends IIntegration {
|
||||
/** The WebSocket API associated with this integration */
|
||||
readonly webSocketApi: IWebSocketApi;
|
||||
}
|
||||
/**
|
||||
* WebSocket Integration Types
|
||||
*/
|
||||
export declare enum WebSocketIntegrationType {
|
||||
/**
|
||||
* AWS Proxy Integration Type
|
||||
*/
|
||||
AWS_PROXY = "AWS_PROXY",
|
||||
/**
|
||||
* Mock Integration Type
|
||||
*/
|
||||
MOCK = "MOCK",
|
||||
/**
|
||||
* AWS Integration Type
|
||||
*/
|
||||
AWS = "AWS"
|
||||
}
|
||||
/**
|
||||
* Integration content handling
|
||||
*/
|
||||
export declare enum ContentHandling {
|
||||
/**
|
||||
* Converts a request payload from a base64-encoded string to a binary blob.
|
||||
*/
|
||||
CONVERT_TO_BINARY = "CONVERT_TO_BINARY",
|
||||
/**
|
||||
* Converts a request payload from a binary blob to a base64-encoded string.
|
||||
*/
|
||||
CONVERT_TO_TEXT = "CONVERT_TO_TEXT"
|
||||
}
|
||||
/**
|
||||
* Integration Passthrough Behavior
|
||||
*/
|
||||
export declare enum PassthroughBehavior {
|
||||
/**
|
||||
* Passes the request body for unmapped content types through to the
|
||||
* integration back end without transformation.
|
||||
*/
|
||||
WHEN_NO_MATCH = "WHEN_NO_MATCH",
|
||||
/**
|
||||
* Rejects unmapped content types with an HTTP 415 'Unsupported Media Type'
|
||||
* response
|
||||
*/
|
||||
NEVER = "NEVER",
|
||||
/**
|
||||
* Allows pass-through when the integration has NO content types mapped to
|
||||
* templates. However if there is at least one content type defined,
|
||||
* unmapped content types will be rejected with the same 415 response.
|
||||
*/
|
||||
WHEN_NO_TEMPLATES = "WHEN_NO_TEMPLATES"
|
||||
}
|
||||
/**
|
||||
* The integration properties
|
||||
*/
|
||||
export interface WebSocketIntegrationProps {
|
||||
/**
|
||||
* The WebSocket API to which this integration should be bound.
|
||||
*/
|
||||
readonly webSocketApi: IWebSocketApiRef;
|
||||
/**
|
||||
* Integration type
|
||||
*/
|
||||
readonly integrationType: WebSocketIntegrationType;
|
||||
/**
|
||||
* Integration URI.
|
||||
*/
|
||||
readonly integrationUri: string;
|
||||
/**
|
||||
* Specifies the integration's HTTP method type.
|
||||
*
|
||||
* @default - No HTTP method required.
|
||||
*/
|
||||
readonly integrationMethod?: string;
|
||||
/**
|
||||
* Specifies how to handle response payload content type conversions.
|
||||
*
|
||||
* @default - The response payload will be passed through from the integration response to
|
||||
* the route response or method response without modification.
|
||||
*/
|
||||
readonly contentHandling?: ContentHandling;
|
||||
/**
|
||||
* Specifies the IAM role required for the integration.
|
||||
*
|
||||
* @default - No IAM role required.
|
||||
*/
|
||||
readonly credentialsRole?: IRole;
|
||||
/**
|
||||
* The request parameters that API Gateway sends with the backend request.
|
||||
* Specify request parameters as key-value pairs (string-to-string
|
||||
* mappings), with a destination as the key and a source as the value.
|
||||
*
|
||||
* @default - No request parameters required.
|
||||
*/
|
||||
readonly requestParameters?: {
|
||||
[dest: string]: string;
|
||||
};
|
||||
/**
|
||||
* A map of Apache Velocity templates that are applied on the request
|
||||
* payload.
|
||||
*
|
||||
* ```
|
||||
* { "application/json": "{ \"statusCode\": 200 }" }
|
||||
* ```
|
||||
*
|
||||
* @default - No request templates required.
|
||||
*/
|
||||
readonly requestTemplates?: {
|
||||
[contentType: string]: string;
|
||||
};
|
||||
/**
|
||||
* The template selection expression for the integration.
|
||||
*
|
||||
* @default - No template selection expression required.
|
||||
*/
|
||||
readonly templateSelectionExpression?: string;
|
||||
/**
|
||||
* The maximum amount of time an integration will run before it returns without a response.
|
||||
* Must be between 50 milliseconds and 29 seconds.
|
||||
*
|
||||
* @default Duration.seconds(29)
|
||||
*/
|
||||
readonly timeout?: Duration;
|
||||
/**
|
||||
* Specifies the pass-through behavior for incoming requests based on the
|
||||
* Content-Type header in the request, and the available mapping templates
|
||||
* specified as the requestTemplates property on the Integration resource.
|
||||
* There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and
|
||||
* NEVER.
|
||||
*
|
||||
* @default - No passthrough behavior required.
|
||||
*/
|
||||
readonly passthroughBehavior?: PassthroughBehavior;
|
||||
}
|
||||
/**
|
||||
* The integration for an API route.
|
||||
* @resource AWS::ApiGatewayV2::Integration
|
||||
*/
|
||||
export declare class WebSocketIntegration extends Resource implements IWebSocketIntegration {
|
||||
/** Uniquely identifies this class. */
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
readonly integrationId: string;
|
||||
private readonly _webSocketApi;
|
||||
constructor(scope: Construct, id: string, props: WebSocketIntegrationProps);
|
||||
get webSocketApi(): IWebSocketApi;
|
||||
get integrationRef(): IntegrationReference;
|
||||
}
|
||||
/**
|
||||
* Options to the WebSocketRouteIntegration during its bind operation.
|
||||
*/
|
||||
export interface WebSocketRouteIntegrationBindOptions {
|
||||
/**
|
||||
* The route to which this is being bound.
|
||||
*/
|
||||
readonly route: IWebSocketRoute;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
readonly scope: Construct;
|
||||
}
|
||||
/**
|
||||
* The interface that various route integration classes will inherit.
|
||||
*/
|
||||
export declare abstract class WebSocketRouteIntegration {
|
||||
private readonly id;
|
||||
private integration?;
|
||||
/**
|
||||
* Initialize an integration for a route on websocket api.
|
||||
* @param id id of the underlying `WebSocketIntegration` construct.
|
||||
*/
|
||||
constructor(id: string);
|
||||
/**
|
||||
* Internal method called when binding this integration to the route.
|
||||
* @internal
|
||||
*/
|
||||
_bindToRoute(options: WebSocketRouteIntegrationBindOptions): {
|
||||
readonly integrationId: string;
|
||||
};
|
||||
/**
|
||||
* Bind this integration to the route.
|
||||
*/
|
||||
abstract bind(options: WebSocketRouteIntegrationBindOptions): WebSocketRouteIntegrationConfig;
|
||||
}
|
||||
/**
|
||||
* Config returned back as a result of the bind.
|
||||
*/
|
||||
export interface WebSocketRouteIntegrationConfig {
|
||||
/**
|
||||
* Integration type.
|
||||
*/
|
||||
readonly type: WebSocketIntegrationType;
|
||||
/**
|
||||
* Integration URI
|
||||
*/
|
||||
readonly uri: string;
|
||||
/**
|
||||
* Integration method
|
||||
*
|
||||
* @default - No integration method.
|
||||
*/
|
||||
readonly method?: string;
|
||||
/**
|
||||
* Specifies how to handle response payload content type conversions.
|
||||
*
|
||||
* @default - The response payload will be passed through from the integration response to
|
||||
* the route response or method response without modification.
|
||||
*/
|
||||
readonly contentHandling?: ContentHandling;
|
||||
/**
|
||||
* Credentials role
|
||||
*
|
||||
* @default - No role provided.
|
||||
*/
|
||||
readonly credentialsRole?: IRole;
|
||||
/**
|
||||
* Request template
|
||||
*
|
||||
* @default - No request template provided.
|
||||
*/
|
||||
readonly requestTemplates?: {
|
||||
[contentType: string]: string;
|
||||
};
|
||||
/**
|
||||
* Request parameters
|
||||
*
|
||||
* @default - No request parameters provided.
|
||||
*/
|
||||
readonly requestParameters?: {
|
||||
[dest: string]: string;
|
||||
};
|
||||
/**
|
||||
* Template selection expression
|
||||
*
|
||||
* @default - No template selection expression.
|
||||
*/
|
||||
readonly templateSelectionExpression?: string;
|
||||
/**
|
||||
* The maximum amount of time an integration will run before it returns without a response.
|
||||
* Must be between 50 milliseconds and 29 seconds.
|
||||
*
|
||||
* @default Duration.seconds(29)
|
||||
*/
|
||||
readonly timeout?: Duration;
|
||||
/**
|
||||
* Integration passthrough behaviors.
|
||||
*
|
||||
* @default - No pass through bahavior.
|
||||
*/
|
||||
readonly passthroughBehavior?: PassthroughBehavior;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/integration.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/integration.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
78
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/route.d.ts
generated
vendored
Normal file
78
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/route.d.ts
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
import { Construct } from 'constructs';
|
||||
import type { IWebSocketApi } from './api';
|
||||
import type { IWebSocketRouteAuthorizer } from './authorizer';
|
||||
import type { WebSocketRouteIntegration } from './integration';
|
||||
import type { RouteReference } from '.././index';
|
||||
import { Resource } from '../../../core';
|
||||
import type { IRoute } from '../common';
|
||||
/**
|
||||
* Represents a Route for an WebSocket API.
|
||||
*/
|
||||
export interface IWebSocketRoute extends IRoute {
|
||||
/**
|
||||
* The WebSocket API associated with this route.
|
||||
*/
|
||||
readonly webSocketApi: IWebSocketApi;
|
||||
/**
|
||||
* The key to this route.
|
||||
* @attribute
|
||||
*/
|
||||
readonly routeKey: string;
|
||||
}
|
||||
/**
|
||||
* Options used to add route to the API
|
||||
*/
|
||||
export interface WebSocketRouteOptions {
|
||||
/**
|
||||
* The integration to be configured on this route.
|
||||
*/
|
||||
readonly integration: WebSocketRouteIntegration;
|
||||
/**
|
||||
* The authorize to this route. You can only set authorizer to a $connect route.
|
||||
*
|
||||
* @default - No Authorizer
|
||||
*/
|
||||
readonly authorizer?: IWebSocketRouteAuthorizer;
|
||||
/**
|
||||
* Should the route send a response to the client
|
||||
* @default false
|
||||
*/
|
||||
readonly returnResponse?: boolean;
|
||||
}
|
||||
/**
|
||||
* Properties to initialize a new Route
|
||||
*/
|
||||
export interface WebSocketRouteProps extends WebSocketRouteOptions {
|
||||
/**
|
||||
* The API the route is associated with.
|
||||
*/
|
||||
readonly webSocketApi: IWebSocketApi;
|
||||
/**
|
||||
* The key to this route.
|
||||
*/
|
||||
readonly routeKey: string;
|
||||
/**
|
||||
* Whether the route requires an API Key to be provided
|
||||
* @default false
|
||||
*/
|
||||
readonly apiKeyRequired?: boolean;
|
||||
}
|
||||
/**
|
||||
* Route class that creates the Route for API Gateway WebSocket API
|
||||
* @resource AWS::ApiGatewayV2::Route
|
||||
*/
|
||||
export declare class WebSocketRoute extends Resource implements IWebSocketRoute {
|
||||
/**
|
||||
* Uniquely identifies this class.
|
||||
*/
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
readonly routeId: string;
|
||||
readonly webSocketApi: IWebSocketApi;
|
||||
readonly routeKey: string;
|
||||
/**
|
||||
* Integration response ID
|
||||
*/
|
||||
readonly integrationResponseId?: string;
|
||||
constructor(scope: Construct, id: string, props: WebSocketRouteProps);
|
||||
get routeRef(): RouteReference;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/route.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/route.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
83
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/stage.d.ts
generated
vendored
Normal file
83
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/stage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IWebSocketApi } from './api';
|
||||
import { AccessLogFormat } from '../../../aws-apigateway';
|
||||
import type { IGrantable } from '../../../aws-iam';
|
||||
import { Grant } from '../../../aws-iam';
|
||||
import type { StageOptions, IApi, IStage, StageAttributes } from '../common';
|
||||
import { StageBase } from '../common/base';
|
||||
/**
|
||||
* Represents the WebSocketStage
|
||||
*/
|
||||
export interface IWebSocketStage extends IStage {
|
||||
/**
|
||||
* The API this stage is associated to.
|
||||
*/
|
||||
readonly 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
|
||||
*/
|
||||
readonly callbackUrl: string;
|
||||
}
|
||||
/**
|
||||
* Properties to initialize an instance of `WebSocketStage`.
|
||||
*/
|
||||
export interface WebSocketStageProps extends StageOptions {
|
||||
/**
|
||||
* The WebSocket API to which this stage is associated.
|
||||
*/
|
||||
readonly webSocketApi: IWebSocketApi;
|
||||
/**
|
||||
* The name of the stage.
|
||||
*/
|
||||
readonly stageName: string;
|
||||
}
|
||||
/**
|
||||
* The attributes used to import existing WebSocketStage
|
||||
*/
|
||||
export interface WebSocketStageAttributes extends StageAttributes {
|
||||
/**
|
||||
* The API to which this stage is associated
|
||||
*/
|
||||
readonly api: IWebSocketApi;
|
||||
}
|
||||
/**
|
||||
* Represents a stage where an instance of the API is deployed.
|
||||
* @resource AWS::ApiGatewayV2::Stage
|
||||
*/
|
||||
export declare class WebSocketStage extends StageBase implements IWebSocketStage {
|
||||
/** Uniquely identifies this class. */
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* Import an existing stage into this CDK app.
|
||||
*/
|
||||
static fromWebSocketStageAttributes(scope: Construct, id: string, attrs: WebSocketStageAttributes): IWebSocketStage;
|
||||
protected readonly baseApi: IApi;
|
||||
readonly stageName: string;
|
||||
readonly api: IWebSocketApi;
|
||||
constructor(scope: Construct, id: string, props: WebSocketStageProps);
|
||||
/**
|
||||
* The websocket URL to this stage.
|
||||
*/
|
||||
get url(): string;
|
||||
/**
|
||||
* The callback URL to this stage.
|
||||
*/
|
||||
get callbackUrl(): string;
|
||||
/**
|
||||
* Grant access to the API Gateway management API for this WebSocket API Stage to an IAM
|
||||
* principal (Role/Group/User).
|
||||
* [disable-awslint:no-grants]
|
||||
*
|
||||
* @param identity The principal
|
||||
*/
|
||||
grantManagementApiAccess(identity: IGrantable): Grant;
|
||||
/**
|
||||
* CLF Log format for WebSocket API Stage.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-logging.html
|
||||
*/
|
||||
defaultAccessLogFormat(): AccessLogFormat;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/stage.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/stage.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
164
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/usage-plan.d.ts
generated
vendored
Normal file
164
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/usage-plan.d.ts
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
import type { Construct } from 'constructs';
|
||||
import type { IWebSocketApi } from './api';
|
||||
import type { IWebSocketStage } from './stage';
|
||||
import type { IApiKeyRef, IUsagePlanRef, UsagePlanReference } from '../../../aws-apigateway/lib';
|
||||
import type { IResource } from '../../../core';
|
||||
import { Resource } from '../../../core';
|
||||
import type { ThrottleSettings } from '../common';
|
||||
/**
|
||||
* Time period for which quota settings apply.
|
||||
*/
|
||||
export declare enum Period {
|
||||
/**
|
||||
* The quota resets every day.
|
||||
*/
|
||||
DAY = "DAY",
|
||||
/**
|
||||
* The quota resets every week.
|
||||
*/
|
||||
WEEK = "WEEK",
|
||||
/**
|
||||
* The quota resets every month.
|
||||
*/
|
||||
MONTH = "MONTH"
|
||||
}
|
||||
/**
|
||||
* Specifies the maximum number of requests that clients can make to API Gateway APIs.
|
||||
*/
|
||||
export interface QuotaSettings {
|
||||
/**
|
||||
* The maximum number of requests that users can make within the specified time period.
|
||||
* @default none
|
||||
*/
|
||||
readonly limit?: number;
|
||||
/**
|
||||
* For the initial time period, the number of requests to subtract from the specified limit.
|
||||
* @default none
|
||||
*/
|
||||
readonly offset?: number;
|
||||
/**
|
||||
* The time period for which the maximum limit of requests applies.
|
||||
* @default none
|
||||
*/
|
||||
readonly period?: Period;
|
||||
}
|
||||
/**
|
||||
* Represents the API stages that a usage plan applies to.
|
||||
*/
|
||||
export interface UsagePlanPerApiStage {
|
||||
/**
|
||||
* The WebSocket API to associate with the usage plan.
|
||||
* @default none
|
||||
*/
|
||||
readonly api?: IWebSocketApi;
|
||||
/**
|
||||
*
|
||||
* [disable-awslint:ref-via-interface]
|
||||
* @default none
|
||||
*/
|
||||
readonly stage?: IWebSocketStage;
|
||||
}
|
||||
/**
|
||||
* Properties for defining an API Gateway Usage Plan for WebSocket APIs.
|
||||
*/
|
||||
export interface UsagePlanProps {
|
||||
/**
|
||||
* API Stages to be associated with the usage plan.
|
||||
* @default none
|
||||
*/
|
||||
readonly apiStages?: UsagePlanPerApiStage[];
|
||||
/**
|
||||
* Represents usage plan purpose.
|
||||
* @default none
|
||||
*/
|
||||
readonly description?: string;
|
||||
/**
|
||||
* Number of requests clients can make in a given time period.
|
||||
* @default none
|
||||
*/
|
||||
readonly quota?: QuotaSettings;
|
||||
/**
|
||||
* Overall throttle settings for the API.
|
||||
* @default none
|
||||
*/
|
||||
readonly throttle?: ThrottleSettings;
|
||||
/**
|
||||
* Name for this usage plan.
|
||||
* @default none
|
||||
*/
|
||||
readonly usagePlanName?: string;
|
||||
}
|
||||
/**
|
||||
* Options to the UsagePlan.addApiKey() method
|
||||
*/
|
||||
export interface AddApiKeyOptions {
|
||||
/**
|
||||
* Override the CloudFormation logical id of the AWS::ApiGateway::UsagePlanKey resource
|
||||
* @default - autogenerated by the CDK
|
||||
*/
|
||||
readonly overrideLogicalId?: string;
|
||||
}
|
||||
/**
|
||||
* A UsagePlan, either managed by this CDK app, or imported.
|
||||
*/
|
||||
export interface IUsagePlan extends IResource, IUsagePlanRef {
|
||||
/**
|
||||
* Id of the usage plan
|
||||
* @attribute
|
||||
*/
|
||||
readonly usagePlanId: string;
|
||||
/**
|
||||
* Adds an ApiKey.
|
||||
*
|
||||
* @param apiKey the api key to associate with this usage plan
|
||||
* @param options options that control the behaviour of this method
|
||||
*/
|
||||
addApiKey(apiKey: IApiKeyRef, options?: AddApiKeyOptions): void;
|
||||
}
|
||||
declare abstract class UsagePlanBase extends Resource implements IUsagePlan {
|
||||
/**
|
||||
* Id of the usage plan
|
||||
* @attribute
|
||||
*/
|
||||
abstract readonly usagePlanId: string;
|
||||
/**
|
||||
* Adds an ApiKey.
|
||||
*
|
||||
* @param apiKey the api key to associate with this usage plan
|
||||
* @param options options that control the behaviour of this method
|
||||
*/
|
||||
addApiKey(apiKey: IApiKeyRef, options?: AddApiKeyOptions): void;
|
||||
get usagePlanRef(): UsagePlanReference;
|
||||
}
|
||||
/**
|
||||
* A UsagePlan.
|
||||
*
|
||||
* @resource AWS::ApiGateway::UsagePlan
|
||||
*/
|
||||
export declare class UsagePlan extends UsagePlanBase {
|
||||
/** Uniquely identifies this class. */
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* Import an externally defined usage plan using its ARN.
|
||||
*
|
||||
* @param scope the construct that will "own" the imported usage plan.
|
||||
* @param id the id of the imported usage plan in the construct tree.
|
||||
* @param usagePlanId the id of an existing usage plan.
|
||||
*/
|
||||
static fromUsagePlanId(scope: Construct, id: string, usagePlanId: string): IUsagePlan;
|
||||
/**
|
||||
* @attribute
|
||||
*/
|
||||
readonly usagePlanId: string;
|
||||
private readonly apiStages;
|
||||
constructor(scope: Construct, id: string, props?: UsagePlanProps);
|
||||
/**
|
||||
* Adds an apiStage.
|
||||
*/
|
||||
addApiStage(apiStage: UsagePlanPerApiStage): void;
|
||||
private renderApiStages;
|
||||
private createStage;
|
||||
private renderQuota;
|
||||
private renderThrottle;
|
||||
}
|
||||
export {};
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/usage-plan.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-apigatewayv2/lib/websocket/usage-plan.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user