import { ApiGateways } from '@softchef/cdk-apigateways'
new ApiGateways(scope: Construct, id: string, props: ApiGatewaysProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
ApiGatewaysProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: ApiGatewaysProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
import { ApiGateways } from '@softchef/cdk-apigateways'
ApiGateways.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
distribution |
aws-cdk-lib.aws_cloudfront.Distribution |
CloudFront distribution. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly distribution: Distribution;
- Type: aws-cdk-lib.aws_cloudfront.Distribution
CloudFront distribution.
import { ApiGatewaysProps } from '@softchef/cdk-apigateways'
const apiGatewaysProps: ApiGatewaysProps = { ... }
Name | Type | Description |
---|---|---|
documentation |
Documentation |
Specify the documentation config. |
originApisConfig |
OriginApiConfig[] |
Mix the APIs with specified behaviors. |
stageName |
string |
All of APIs stage name, all stage names must be the same. |
distribution |
DistributionProps |
Specify the CloudFront distribution properties. |
public readonly documentation: Documentation;
- Type: Documentation
Specify the documentation config.
public readonly originApisConfig: OriginApiConfig[];
- Type: OriginApiConfig[]
Mix the APIs with specified behaviors.
public readonly stageName: string;
- Type: string
All of APIs stage name, all stage names must be the same.
public readonly distribution: DistributionProps;
- Type: DistributionProps
Specify the CloudFront distribution properties.
import { CustomPage } from '@softchef/cdk-apigateways'
const customPage: CustomPage = { ... }
Name | Type | Description |
---|---|---|
cssStyles |
string |
Specify css styles to embedded to static page. |
pageTitle |
string |
Specify page title to static page. |
public readonly cssStyles: string;
- Type: string
Specify css styles to embedded to static page.
public readonly pageTitle: string;
- Type: string
Specify page title to static page.
import { DistributionProps } from '@softchef/cdk-apigateways'
const distributionProps: DistributionProps = { ... }
Name | Type | Description |
---|---|---|
certificate |
aws-cdk-lib.aws_certificatemanager.ICertificate |
A certificate to associate with the distribution. |
comment |
string |
Any comments you want to include about the distribution. |
defaultRootObject |
string |
The object that you want CloudFront to request from your origin (for example, index.html) when a viewer requests the root URL for your distribution. If no default object is set, the request goes to the origin's root (e.g., example.com/). |
domainNames |
string[] |
Alternative domain names for this distribution. |
enabled |
boolean |
Enable or disable the distribution. |
enableIpv6 |
boolean |
Whether CloudFront will respond to IPv6 DNS requests with an IPv6 address. |
enableLogging |
boolean |
Enable access logging for the distribution. |
errorResponses |
aws-cdk-lib.aws_cloudfront.ErrorResponse[] |
How CloudFront should handle requests that are not successful (e.g., PageNotFound). |
geoRestriction |
aws-cdk-lib.aws_cloudfront.GeoRestriction |
Controls the countries in which your content is distributed. |
httpVersion |
aws-cdk-lib.aws_cloudfront.HttpVersion |
Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. |
logBucket |
aws-cdk-lib.aws_s3.IBucket |
The Amazon S3 bucket to store the access logs in. |
logFilePrefix |
string |
An optional string that you want CloudFront to prefix to the access log filenames for this distribution. |
logIncludesCookies |
boolean |
Specifies whether you want CloudFront to include cookies in access logs. |
minimumProtocolVersion |
aws-cdk-lib.aws_cloudfront.SecurityPolicyProtocol |
The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections. |
webAclId |
string |
Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution. |
public readonly certificate: ICertificate;
- Type: aws-cdk-lib.aws_certificatemanager.ICertificate
- Default: the CloudFront wildcard certificate (*.cloudfront.net) will be used.
A certificate to associate with the distribution.
The certificate must be located in N. Virginia (us-east-1).
public readonly comment: string;
- Type: string
- Default: no comment
Any comments you want to include about the distribution.
public readonly defaultRootObject: string;
- Type: string
- Default: no default root object
The object that you want CloudFront to request from your origin (for example, index.html) when a viewer requests the root URL for your distribution. If no default object is set, the request goes to the origin's root (e.g., example.com/).
public readonly domainNames: string[];
- Type: string[]
- Default: The distribution will only support the default generated name (e.g., d111111abcdef8.cloudfront.net)
Alternative domain names for this distribution.
If you want to use your own domain name, such as www.example.com, instead of the cloudfront.net domain name, you can add an alternate domain name to your distribution. If you attach a certificate to the distribution, you must add (at least one of) the domain names of the certificate to this list.
public readonly enabled: boolean;
- Type: boolean
- Default: true
Enable or disable the distribution.
public readonly enableIpv6: boolean;
- Type: boolean
- Default: true
Whether CloudFront will respond to IPv6 DNS requests with an IPv6 address.
If you specify false, CloudFront responds to IPv6 DNS requests with the DNS response code NOERROR and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for your distribution.
public readonly enableLogging: boolean;
- Type: boolean
- Default: false, unless
logBucket
is specified.
Enable access logging for the distribution.
public readonly errorResponses: ErrorResponse[];
- Type: aws-cdk-lib.aws_cloudfront.ErrorResponse[]
- Default: No custom error responses.
How CloudFront should handle requests that are not successful (e.g., PageNotFound).
public readonly geoRestriction: GeoRestriction;
- Type: aws-cdk-lib.aws_cloudfront.GeoRestriction
- Default: No geographic restrictions
Controls the countries in which your content is distributed.
public readonly httpVersion: HttpVersion;
- Type: aws-cdk-lib.aws_cloudfront.HttpVersion
- Default: HttpVersion.HTTP2
Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront.
For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support server name identification (SNI).
public readonly logBucket: IBucket;
- Type: aws-cdk-lib.aws_s3.IBucket
- Default: A bucket is created if
enableLogging
is true
The Amazon S3 bucket to store the access logs in.
public readonly logFilePrefix: string;
- Type: string
- Default: no prefix
An optional string that you want CloudFront to prefix to the access log filenames for this distribution.
public readonly logIncludesCookies: boolean;
- Type: boolean
- Default: false
Specifies whether you want CloudFront to include cookies in access logs.
public readonly minimumProtocolVersion: SecurityPolicyProtocol;
- Type: aws-cdk-lib.aws_cloudfront.SecurityPolicyProtocol
- Default: SecurityPolicyProtocol.TLS_V1_2_2021 if the '
The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections.
CloudFront serves your objects only to browsers or devices that support at least the SSL version that you specify.
public readonly webAclId: string;
- Type: string
- Default: No AWS Web Application Firewall web access control list (web ACL).
Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution.
To specify a web ACL created using the latest version of AWS WAF, use the ACL ARN, for example
arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a
.
To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example 473e64fd-f30b-4765-81a0-62ad96dd167a
.
import { Documentation } from '@softchef/cdk-apigateways'
const documentation: Documentation = { ... }
Name | Type | Description |
---|---|---|
customPage |
CustomPage |
Custom documentation page. |
docsPrefix |
string |
Specify the documentation store prefix path. |
file |
string |
Specify the documentation definitions path. |
pannelType |
string |
Specify pannel type, Supports:. |
s3Bucket |
aws-cdk-lib.aws_s3.IBucket |
Specify the documentation bucket to store static web page. |
public readonly customPage: CustomPage;
- Type: CustomPage
Custom documentation page.
public readonly docsPrefix: string;
- Type: string
Specify the documentation store prefix path.
public readonly file: string;
- Type: string
Specify the documentation definitions path.
Support format: Swagger 2.0, OpenAPI 3.0, OpenAPI 3.1
public readonly pannelType: string;
- Type: string
- Default: Redoc
Specify pannel type, Supports:.
Redoc: https://github.com/Redocly/redoc
public readonly s3Bucket: IBucket;
- Type: aws-cdk-lib.aws_s3.IBucket
Specify the documentation bucket to store static web page.
import { OriginApiConfig } from '@softchef/cdk-apigateways'
const originApiConfig: OriginApiConfig = { ... }
Name | Type | Description |
---|---|---|
originApi |
aws-cdk-lib.aws_apigateway.RestApi | @aws-cdk/aws-apigatewayv2-alpha.HttpApi | @softchef/cdk-restapi.RestApi |
The origin api are supported AWS RestApi/HttpApi & @softchef/cdk-restapi. |
path |
string |
The origin api path. |
allowedMethods |
aws-cdk-lib.aws_cloudfront.AllowedMethods |
HTTP methods to allow for this behavior. |
cachedMethods |
aws-cdk-lib.aws_cloudfront.CachedMethods |
HTTP methods to cache for this behavior. |
cachePolicy |
aws-cdk-lib.aws_cloudfront.ICachePolicy |
The cache policy for this behavior. |
compress |
boolean |
Whether you want CloudFront to automatically compress certain files for this cache behavior. |
originApiAuthorizationType |
OriginApiAuthorizationType |
The origin api which authorization type. |
originRequestPolicy |
aws-cdk-lib.aws_cloudfront.IOriginRequestPolicy |
The origin request policy for this behavior. |
responseHeadersPolicy |
aws-cdk-lib.aws_cloudfront.IResponseHeadersPolicy |
The response headers policy for this behavior. |
viewerProtocolPolicy |
aws-cdk-lib.aws_cloudfront.ViewerProtocolPolicy |
The protocol that viewers can use to access the files controlled by this behavior. |
public readonly originApi: RestApi | HttpApi | RestApi;
- Type: aws-cdk-lib.aws_apigateway.RestApi | @aws-cdk/aws-apigatewayv2-alpha.HttpApi | @softchef/cdk-restapi.RestApi
The origin api are supported AWS RestApi/HttpApi & @softchef/cdk-restapi.
public readonly path: string;
- Type: string
The origin api path.
Ex: https://{ApiId}.execute-api.{region}.amazonaws.com/{StageName}/articles, the path is articles.
public readonly allowedMethods: AllowedMethods;
- Type: aws-cdk-lib.aws_cloudfront.AllowedMethods
- Default: AllowedMethods.ALLOW_GET_HEAD
HTTP methods to allow for this behavior.
public readonly cachedMethods: CachedMethods;
- Type: aws-cdk-lib.aws_cloudfront.CachedMethods
- Default: CachedMethods.CACHE_GET_HEAD
HTTP methods to cache for this behavior.
public readonly cachePolicy: ICachePolicy;
- Type: aws-cdk-lib.aws_cloudfront.ICachePolicy
- Default: CachePolicy.CACHING_OPTIMIZED
The cache policy for this behavior.
The cache policy determines what values are included in the cache key, and the time-to-live (TTL) values for the cache.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html.
public readonly compress: boolean;
- Type: boolean
- Default: true
Whether you want CloudFront to automatically compress certain files for this cache behavior.
See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-cloudfront-file-types for file types CloudFront will compress.
public readonly originApiAuthorizationType: OriginApiAuthorizationType;
- Type: OriginApiAuthorizationType
- Default: none
The origin api which authorization type.
public readonly originRequestPolicy: IOriginRequestPolicy;
- Type: aws-cdk-lib.aws_cloudfront.IOriginRequestPolicy
- Default: none
The origin request policy for this behavior.
The origin request policy determines which values (e.g., headers, cookies) are included in requests that CloudFront sends to the origin.
public readonly responseHeadersPolicy: IResponseHeadersPolicy;
- Type: aws-cdk-lib.aws_cloudfront.IResponseHeadersPolicy
- Default: none
The response headers policy for this behavior.
The response headers policy determines which headers are included in responses
public readonly viewerProtocolPolicy: ViewerProtocolPolicy;
- Type: aws-cdk-lib.aws_cloudfront.ViewerProtocolPolicy
- Default: ViewerProtocolPolicy.ALLOW_ALL
The protocol that viewers can use to access the files controlled by this behavior.
Name | Description |
---|---|
NONE |
Open access. |
IAM |
Use AWS IAM permissions. |
COGNITO |
Use an AWS Cognito user pool. |
Open access.
Use AWS IAM permissions.
Use an AWS Cognito user pool.