Skip to content

Latest commit

 

History

History
1404 lines (879 loc) · 55.2 KB

API.md

File metadata and controls

1404 lines (879 loc) · 55.2 KB

API Reference

Constructs

InternalApiGateway

Initializers

import { InternalApiGateway } from 'cdk-internal-gateway'

new InternalApiGateway(scope: Construct, id: string, props: InternalApiGatewayProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props InternalApiGatewayProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { InternalApiGateway } from 'cdk-internal-gateway'

InternalApiGateway.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


InternalService

Initializers

import { InternalService } from 'cdk-internal-gateway'

new InternalService(scope: Construct, id: string, props: InternalServiceProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props InternalServiceProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { InternalService } from 'cdk-internal-gateway'

InternalService.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
domains aws-cdk-lib.aws_apigateway.IDomainName[] List of domains created by the internal service stack and shared with the api gateway stack.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


domainsRequired
public readonly domains: IDomainName[];
  • Type: aws-cdk-lib.aws_apigateway.IDomainName[]

List of domains created by the internal service stack and shared with the api gateway stack.


InternalWebsite

Initializers

import { InternalWebsite } from 'cdk-internal-gateway'

new InternalWebsite(scope: Construct, id: string, props: InternalWebsiteProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props InternalWebsiteProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { InternalWebsite } from 'cdk-internal-gateway'

InternalWebsite.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


Structs

InternalApiGatewayProps

Properties for ApiGateway Includes all properties of RestApiProps except: endpointConfiguration, policy This is done by intention to prevent the user from overriding the required security settings.

Initializer

import { InternalApiGatewayProps } from 'cdk-internal-gateway'

const internalApiGatewayProps: InternalApiGatewayProps = { ... }

Properties

Name Type Description
defaultCorsPreflightOptions aws-cdk-lib.aws_apigateway.CorsOptions Adds a CORS preflight OPTIONS method to this resource and all child resources.
defaultIntegration aws-cdk-lib.aws_apigateway.Integration An integration to use as a default for all methods created within this API unless an integration is specified.
defaultMethodOptions aws-cdk-lib.aws_apigateway.MethodOptions Method options to use as a default for all methods created within this API unless custom options are specified.
cloudWatchRole boolean Automatically configure an AWS CloudWatch role for API Gateway.
deploy boolean Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.
deployOptions aws-cdk-lib.aws_apigateway.StageOptions Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.
description string A description of the RestApi construct.
disableExecuteApiEndpoint boolean Specifies whether clients can invoke the API using the default execute-api endpoint.
domainName aws-cdk-lib.aws_apigateway.DomainNameOptions Configure a custom domain name and map it to this API.
endpointExportName string Export name for the CfnOutput containing the API endpoint.
endpointTypes aws-cdk-lib.aws_apigateway.EndpointType[] A list of the endpoint types of the API.
failOnWarnings boolean Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.
parameters {[ key: string ]: string} Custom header parameters for the request.
policy aws-cdk-lib.aws_iam.PolicyDocument A policy document that contains the permissions for this RestApi.
restApiName string A name for the API Gateway RestApi resource.
retainDeployments boolean Retains old deployment resources when the API changes.
apiKeySourceType aws-cdk-lib.aws_apigateway.ApiKeySourceType The source of the API key for metering requests according to a usage plan.
binaryMediaTypes string[] The list of binary media mime-types that are supported by the RestApi resource, such as "image/png" or "application/octet-stream".
cloneFrom aws-cdk-lib.aws_apigateway.IRestApi The ID of the API Gateway RestApi resource that you want to clone.
endpointConfiguration aws-cdk-lib.aws_apigateway.EndpointConfiguration The EndpointConfiguration property type specifies the endpoint types of a REST API.
minCompressionSize aws-cdk-lib.Size A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.
minimumCompressionSize number A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.
domains aws-cdk-lib.aws_apigateway.IDomainName[] List of custom domains names to be used for the API Gateway.
vpcEndpoint aws-cdk-lib.aws_ec2.IInterfaceVpcEndpoint VPC endpoint id of execute-api vpc endpoint.
apiBasePathMappingPath string Path for custom domain base path mapping that will be attached to the api gateway.
stage string Stage name used for all cloudformation resource names and internal aws resource names.

defaultCorsPreflightOptionsOptional
public readonly defaultCorsPreflightOptions: CorsOptions;
  • Type: aws-cdk-lib.aws_apigateway.CorsOptions
  • Default: CORS is disabled

Adds a CORS preflight OPTIONS method to this resource and all child resources.

You can add CORS at the resource-level using addCorsPreflight.


defaultIntegrationOptional
public readonly defaultIntegration: Integration;
  • Type: aws-cdk-lib.aws_apigateway.Integration
  • Default: Inherited from parent.

An integration to use as a default for all methods created within this API unless an integration is specified.


defaultMethodOptionsOptional
public readonly defaultMethodOptions: MethodOptions;
  • Type: aws-cdk-lib.aws_apigateway.MethodOptions
  • Default: Inherited from parent.

Method options to use as a default for all methods created within this API unless custom options are specified.


cloudWatchRoleOptional
public readonly cloudWatchRole: boolean;
  • Type: boolean
  • Default: false if @aws-cdk/aws-apigateway:disableCloudWatchRole is enabled, true otherwise

Automatically configure an AWS CloudWatch role for API Gateway.


deployOptional
public readonly deploy: boolean;
  • Type: boolean
  • Default: true

Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.

Since API Gateway deployments are immutable, When this option is enabled (by default), an AWS::ApiGateway::Deployment resource will automatically created with a logical ID that hashes the API model (methods, resources and options). This means that when the model changes, the logical ID of this CloudFormation resource will change, and a new deployment will be created.

If this is set, latestDeployment will refer to the Deployment object and deploymentStage will refer to a Stage that points to this deployment. To customize the stage options, use the deployOptions property.

A CloudFormation Output will also be defined with the root URL endpoint of this REST API.


deployOptionsOptional
public readonly deployOptions: StageOptions;
  • Type: aws-cdk-lib.aws_apigateway.StageOptions
  • Default: Based on defaults of StageOptions.

Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.

If deploy is disabled, this value cannot be set.


descriptionOptional
public readonly description: string;
  • Type: string
  • Default: 'Automatically created by the RestApi construct'

A description of the RestApi construct.


disableExecuteApiEndpointOptional
public readonly disableExecuteApiEndpoint: boolean;
  • Type: boolean
  • Default: false

Specifies whether clients can invoke the API using the default execute-api endpoint.

To require that clients use a custom domain name to invoke the API, disable the default endpoint.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html


domainNameOptional
public readonly domainName: DomainNameOptions;
  • Type: aws-cdk-lib.aws_apigateway.DomainNameOptions
  • Default: no domain name is defined, use addDomainName or directly define a DomainName.

Configure a custom domain name and map it to this API.


endpointExportNameOptional
public readonly endpointExportName: string;
  • Type: string
  • Default: when no export name is given, output will be created without export

Export name for the CfnOutput containing the API endpoint.


endpointTypesOptional
public readonly endpointTypes: EndpointType[];
  • Type: aws-cdk-lib.aws_apigateway.EndpointType[]
  • Default: EndpointType.EDGE

A list of the endpoint types of the API.

Use this property when creating an API.


failOnWarningsOptional
public readonly failOnWarnings: boolean;
  • Type: boolean
  • Default: false

Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.


parametersOptional
public readonly parameters: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: No parameters.

Custom header parameters for the request.

https://docs.aws.amazon.com/cli/latest/reference/apigateway/import-rest-api.html


policyOptional
public readonly policy: PolicyDocument;
  • Type: aws-cdk-lib.aws_iam.PolicyDocument
  • Default: No policy.

A policy document that contains the permissions for this RestApi.


restApiNameOptional
public readonly restApiName: string;
  • Type: string
  • Default: ID of the RestApi construct.

A name for the API Gateway RestApi resource.


retainDeploymentsOptional
public readonly retainDeployments: boolean;
  • Type: boolean
  • Default: false

Retains old deployment resources when the API changes.

This allows manually reverting stages to point to old deployments via the AWS Console.


apiKeySourceTypeOptional
public readonly apiKeySourceType: ApiKeySourceType;
  • Type: aws-cdk-lib.aws_apigateway.ApiKeySourceType
  • Default: Metering is disabled.

The source of the API key for metering requests according to a usage plan.


binaryMediaTypesOptional
public readonly binaryMediaTypes: string[];
  • Type: string[]
  • Default: RestApi supports only UTF-8-encoded text payloads.

The list of binary media mime-types that are supported by the RestApi resource, such as "image/png" or "application/octet-stream".


cloneFromOptional
public readonly cloneFrom: IRestApi;
  • Type: aws-cdk-lib.aws_apigateway.IRestApi
  • Default: None.

The ID of the API Gateway RestApi resource that you want to clone.


endpointConfigurationOptional
public readonly endpointConfiguration: EndpointConfiguration;
  • Type: aws-cdk-lib.aws_apigateway.EndpointConfiguration
  • Default: EndpointType.EDGE

The EndpointConfiguration property type specifies the endpoint types of a REST API.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.html


minCompressionSizeOptional
public readonly minCompressionSize: Size;
  • Type: aws-cdk-lib.Size
  • Default: Compression is disabled.

A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.

When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.


minimumCompressionSizeOptional
  • Deprecated: - superseded by minCompressionSize
public readonly minimumCompressionSize: number;
  • Type: number
  • Default: Compression is disabled.

A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.

When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.


domainsRequired
public readonly domains: IDomainName[];
  • Type: aws-cdk-lib.aws_apigateway.IDomainName[]

List of custom domains names to be used for the API Gateway.


vpcEndpointRequired
public readonly vpcEndpoint: IInterfaceVpcEndpoint;
  • Type: aws-cdk-lib.aws_ec2.IInterfaceVpcEndpoint

VPC endpoint id of execute-api vpc endpoint.

This endpoint will be used to forward requests from the load balancer`s target group to the api gateway.


apiBasePathMappingPathOptional
public readonly apiBasePathMappingPath: string;
  • Type: string

Path for custom domain base path mapping that will be attached to the api gateway.


stageOptional
  • Deprecated: use deployOptions.stageName instead
public readonly stage: string;
  • Type: string

Stage name used for all cloudformation resource names and internal aws resource names.


InternalServiceProps

Properties for InternalService.

Initializer

import { InternalServiceProps } from 'cdk-internal-gateway'

const internalServiceProps: InternalServiceProps = { ... }

Properties

Name Type Description
hostedZone aws-cdk-lib.aws_route53.IHostedZone Hosted zone that will be used for the custom domain.
subDomain string Subdomain attached to hosted zone name.
subjectAlternativeNames string[] List of alternative domains attached to the solution.
subnetSelection aws-cdk-lib.aws_ec2.SubnetSelection Subnets attached to the application load balancer.
vpc aws-cdk-lib.aws_ec2.IVpc VPC attached to the application load balancer.
vpcEndpointIPAddresses string[] VPC endpoint ip addresses attached to the load balancer`s target group.
addLoadBalancerRedirect boolean Add load balancer redirect from port 80 to 443.
customDomainSSLPolicy aws-cdk-lib.aws_apigateway.SecurityPolicy SSLPolicy attached to the apigateway custom domain.
enableLoadBalancerAccessLogs boolean Enable or disable access logs for the load balancer to follow AWS best practices for security.
loadBalancerListenerSSLPolicy aws-cdk-lib.aws_elasticloadbalancingv2.SslPolicy SSLPolicy attached to the load balancer listener.
loadBalancerSecurityGroup aws-cdk-lib.aws_ec2.ISecurityGroup Use a custom security group used for the load balancer.

hostedZoneRequired
public readonly hostedZone: IHostedZone;
  • Type: aws-cdk-lib.aws_route53.IHostedZone

Hosted zone that will be used for the custom domain.


subDomainRequired
public readonly subDomain: string;
  • Type: string

Subdomain attached to hosted zone name.


subjectAlternativeNamesRequired
public readonly subjectAlternativeNames: string[];
  • Type: string[]

List of alternative domains attached to the solution.


subnetSelectionRequired
public readonly subnetSelection: SubnetSelection;
  • Type: aws-cdk-lib.aws_ec2.SubnetSelection

Subnets attached to the application load balancer.


vpcRequired
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc

VPC attached to the application load balancer.


vpcEndpointIPAddressesRequired
public readonly vpcEndpointIPAddresses: string[];
  • Type: string[]

VPC endpoint ip addresses attached to the load balancer`s target group.


addLoadBalancerRedirectOptional
public readonly addLoadBalancerRedirect: boolean;
  • Type: boolean
  • Default: true

Add load balancer redirect from port 80 to 443.


customDomainSSLPolicyOptional
public readonly customDomainSSLPolicy: SecurityPolicy;
  • Type: aws-cdk-lib.aws_apigateway.SecurityPolicy
  • Default: apigateway.SslPolicy.TLS_1_2

SSLPolicy attached to the apigateway custom domain.


enableLoadBalancerAccessLogsOptional
public readonly enableLoadBalancerAccessLogs: boolean;
  • Type: boolean
  • Default: true

Enable or disable access logs for the load balancer to follow AWS best practices for security.


loadBalancerListenerSSLPolicyOptional
public readonly loadBalancerListenerSSLPolicy: SslPolicy;
  • Type: aws-cdk-lib.aws_elasticloadbalancingv2.SslPolicy
  • Default: elb.SslPolicy.FORWARD_SECRECY_TLS12_RES_GCM

SSLPolicy attached to the load balancer listener.


loadBalancerSecurityGroupOptional
public readonly loadBalancerSecurityGroup: ISecurityGroup;
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup

Use a custom security group used for the load balancer.

By default, a security group will be created with inbound access to the typical private network CIDR ranges 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and port 443. Any inbound access (0.0.0.0/0) is blocked by default to follow AWS best practices for security. Outbound traffic is allowed to all destinations.


InternalWebsiteProps

Properties for InternalService.

Initializer

import { InternalWebsiteProps } from 'cdk-internal-gateway'

const internalWebsiteProps: InternalWebsiteProps = { ... }

Properties

Name Type Description
defaultCorsPreflightOptions aws-cdk-lib.aws_apigateway.CorsOptions Adds a CORS preflight OPTIONS method to this resource and all child resources.
defaultIntegration aws-cdk-lib.aws_apigateway.Integration An integration to use as a default for all methods created within this API unless an integration is specified.
defaultMethodOptions aws-cdk-lib.aws_apigateway.MethodOptions Method options to use as a default for all methods created within this API unless custom options are specified.
cloudWatchRole boolean Automatically configure an AWS CloudWatch role for API Gateway.
deploy boolean Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.
deployOptions aws-cdk-lib.aws_apigateway.StageOptions Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.
description string A description of the RestApi construct.
disableExecuteApiEndpoint boolean Specifies whether clients can invoke the API using the default execute-api endpoint.
domainName aws-cdk-lib.aws_apigateway.DomainNameOptions Configure a custom domain name and map it to this API.
endpointExportName string Export name for the CfnOutput containing the API endpoint.
endpointTypes aws-cdk-lib.aws_apigateway.EndpointType[] A list of the endpoint types of the API.
failOnWarnings boolean Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.
parameters {[ key: string ]: string} Custom header parameters for the request.
policy aws-cdk-lib.aws_iam.PolicyDocument A policy document that contains the permissions for this RestApi.
restApiName string A name for the API Gateway RestApi resource.
retainDeployments boolean Retains old deployment resources when the API changes.
apiKeySourceType aws-cdk-lib.aws_apigateway.ApiKeySourceType The source of the API key for metering requests according to a usage plan.
binaryMediaTypes string[] The list of binary media mime-types that are supported by the RestApi resource, such as "image/png" or "application/octet-stream".
cloneFrom aws-cdk-lib.aws_apigateway.IRestApi The ID of the API Gateway RestApi resource that you want to clone.
endpointConfiguration aws-cdk-lib.aws_apigateway.EndpointConfiguration The EndpointConfiguration property type specifies the endpoint types of a REST API.
minCompressionSize aws-cdk-lib.Size A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.
minimumCompressionSize number A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.
domains aws-cdk-lib.aws_apigateway.IDomainName[] List of custom domains names to be used for the API Gateway.
vpcEndpoint aws-cdk-lib.aws_ec2.IInterfaceVpcEndpoint VPC endpoint id of execute-api vpc endpoint.
apiBasePathMappingPath string Path for custom domain base path mapping that will be attached to the api gateway.
stage string Stage name used for all cloudformation resource names and internal aws resource names.
sourcePath string Path of website folder containing the website`s sources.
bucketName string Name of s3 bucket to use for the website deployment.
enableSourceDeployment boolean Enable/disable automatic sync of the website`s sources to the S3bucket.
websiteIndexDocument string Name of html index document used for the website.

defaultCorsPreflightOptionsOptional
public readonly defaultCorsPreflightOptions: CorsOptions;
  • Type: aws-cdk-lib.aws_apigateway.CorsOptions
  • Default: CORS is disabled

Adds a CORS preflight OPTIONS method to this resource and all child resources.

You can add CORS at the resource-level using addCorsPreflight.


defaultIntegrationOptional
public readonly defaultIntegration: Integration;
  • Type: aws-cdk-lib.aws_apigateway.Integration
  • Default: Inherited from parent.

An integration to use as a default for all methods created within this API unless an integration is specified.


defaultMethodOptionsOptional
public readonly defaultMethodOptions: MethodOptions;
  • Type: aws-cdk-lib.aws_apigateway.MethodOptions
  • Default: Inherited from parent.

Method options to use as a default for all methods created within this API unless custom options are specified.


cloudWatchRoleOptional
public readonly cloudWatchRole: boolean;
  • Type: boolean
  • Default: false if @aws-cdk/aws-apigateway:disableCloudWatchRole is enabled, true otherwise

Automatically configure an AWS CloudWatch role for API Gateway.


deployOptional
public readonly deploy: boolean;
  • Type: boolean
  • Default: true

Indicates if a Deployment should be automatically created for this API, and recreated when the API model (resources, methods) changes.

Since API Gateway deployments are immutable, When this option is enabled (by default), an AWS::ApiGateway::Deployment resource will automatically created with a logical ID that hashes the API model (methods, resources and options). This means that when the model changes, the logical ID of this CloudFormation resource will change, and a new deployment will be created.

If this is set, latestDeployment will refer to the Deployment object and deploymentStage will refer to a Stage that points to this deployment. To customize the stage options, use the deployOptions property.

A CloudFormation Output will also be defined with the root URL endpoint of this REST API.


deployOptionsOptional
public readonly deployOptions: StageOptions;
  • Type: aws-cdk-lib.aws_apigateway.StageOptions
  • Default: Based on defaults of StageOptions.

Options for the API Gateway stage that will always point to the latest deployment when deploy is enabled.

If deploy is disabled, this value cannot be set.


descriptionOptional
public readonly description: string;
  • Type: string
  • Default: 'Automatically created by the RestApi construct'

A description of the RestApi construct.


disableExecuteApiEndpointOptional
public readonly disableExecuteApiEndpoint: boolean;
  • Type: boolean
  • Default: false

Specifies whether clients can invoke the API using the default execute-api endpoint.

To require that clients use a custom domain name to invoke the API, disable the default endpoint.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html


domainNameOptional
public readonly domainName: DomainNameOptions;
  • Type: aws-cdk-lib.aws_apigateway.DomainNameOptions
  • Default: no domain name is defined, use addDomainName or directly define a DomainName.

Configure a custom domain name and map it to this API.


endpointExportNameOptional
public readonly endpointExportName: string;
  • Type: string
  • Default: when no export name is given, output will be created without export

Export name for the CfnOutput containing the API endpoint.


endpointTypesOptional
public readonly endpointTypes: EndpointType[];
  • Type: aws-cdk-lib.aws_apigateway.EndpointType[]
  • Default: EndpointType.EDGE

A list of the endpoint types of the API.

Use this property when creating an API.


failOnWarningsOptional
public readonly failOnWarnings: boolean;
  • Type: boolean
  • Default: false

Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the RestApi resource.


parametersOptional
public readonly parameters: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: No parameters.

Custom header parameters for the request.

https://docs.aws.amazon.com/cli/latest/reference/apigateway/import-rest-api.html


policyOptional
public readonly policy: PolicyDocument;
  • Type: aws-cdk-lib.aws_iam.PolicyDocument
  • Default: No policy.

A policy document that contains the permissions for this RestApi.


restApiNameOptional
public readonly restApiName: string;
  • Type: string
  • Default: ID of the RestApi construct.

A name for the API Gateway RestApi resource.


retainDeploymentsOptional
public readonly retainDeployments: boolean;
  • Type: boolean
  • Default: false

Retains old deployment resources when the API changes.

This allows manually reverting stages to point to old deployments via the AWS Console.


apiKeySourceTypeOptional
public readonly apiKeySourceType: ApiKeySourceType;
  • Type: aws-cdk-lib.aws_apigateway.ApiKeySourceType
  • Default: Metering is disabled.

The source of the API key for metering requests according to a usage plan.


binaryMediaTypesOptional
public readonly binaryMediaTypes: string[];
  • Type: string[]
  • Default: RestApi supports only UTF-8-encoded text payloads.

The list of binary media mime-types that are supported by the RestApi resource, such as "image/png" or "application/octet-stream".


cloneFromOptional
public readonly cloneFrom: IRestApi;
  • Type: aws-cdk-lib.aws_apigateway.IRestApi
  • Default: None.

The ID of the API Gateway RestApi resource that you want to clone.


endpointConfigurationOptional
public readonly endpointConfiguration: EndpointConfiguration;
  • Type: aws-cdk-lib.aws_apigateway.EndpointConfiguration
  • Default: EndpointType.EDGE

The EndpointConfiguration property type specifies the endpoint types of a REST API.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-restapi-endpointconfiguration.html


minCompressionSizeOptional
public readonly minCompressionSize: Size;
  • Type: aws-cdk-lib.Size
  • Default: Compression is disabled.

A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.

When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.


minimumCompressionSizeOptional
  • Deprecated: - superseded by minCompressionSize
public readonly minimumCompressionSize: number;
  • Type: number
  • Default: Compression is disabled.

A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.

When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.


domainsRequired
public readonly domains: IDomainName[];
  • Type: aws-cdk-lib.aws_apigateway.IDomainName[]

List of custom domains names to be used for the API Gateway.


vpcEndpointRequired
public readonly vpcEndpoint: IInterfaceVpcEndpoint;
  • Type: aws-cdk-lib.aws_ec2.IInterfaceVpcEndpoint

VPC endpoint id of execute-api vpc endpoint.

This endpoint will be used to forward requests from the load balancer`s target group to the api gateway.


apiBasePathMappingPathOptional
public readonly apiBasePathMappingPath: string;
  • Type: string

Path for custom domain base path mapping that will be attached to the api gateway.


stageOptional
  • Deprecated: use deployOptions.stageName instead
public readonly stage: string;
  • Type: string

Stage name used for all cloudformation resource names and internal aws resource names.


sourcePathRequired
public readonly sourcePath: string;
  • Type: string

Path of website folder containing the website`s sources.


bucketNameOptional
public readonly bucketName: string;
  • Type: string

Name of s3 bucket to use for the website deployment.


enableSourceDeploymentOptional
public readonly enableSourceDeployment: boolean;
  • Type: boolean
  • Default: true

Enable/disable automatic sync of the website`s sources to the S3bucket.


websiteIndexDocumentOptional
public readonly websiteIndexDocument: string;
  • Type: string
  • Default: index.html

Name of html index document used for the website.