agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

View 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;
}

View 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;

View 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 {};

File diff suppressed because one or more lines are too long

View 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;
}

File diff suppressed because one or more lines are too long

View 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';

File diff suppressed because one or more lines are too long

View 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;
}

File diff suppressed because one or more lines are too long

View 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;
}

File diff suppressed because one or more lines are too long

View 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 {};

File diff suppressed because one or more lines are too long

View 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;
}

File diff suppressed because one or more lines are too long