@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.131Z") @Stability(value=Stable) public interface DistributionProps extends software.amazon.jsii.JsiiSerializable
Example:
// Adding an existing Lambda@Edge function created in a different stack
// to a CloudFront distribution.
Bucket s3Bucket;
IVersion functionVersion = Version.fromVersionArn(this, "Version", "arn:aws:lambda:us-east-1:123456789012:function:functionName:1");
Distribution.Builder.create(this, "distro")
.defaultBehavior(BehaviorOptions.builder()
.origin(new S3Origin(s3Bucket))
.edgeLambdas(List.of(EdgeLambda.builder()
.functionVersion(functionVersion)
.eventType(LambdaEdgeEventType.VIEWER_REQUEST)
.build()))
.build())
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
DistributionProps.Builder
A builder for
DistributionProps |
static class |
DistributionProps.Jsii$Proxy
An implementation for
DistributionProps |
| Modifier and Type | Method and Description |
|---|---|
static DistributionProps.Builder |
builder() |
default Map<String,BehaviorOptions> |
getAdditionalBehaviors()
Additional behaviors for the distribution, mapped by the pathPattern that specifies which requests to apply the behavior to.
|
default ICertificate |
getCertificate()
A certificate to associate with the distribution.
|
default String |
getComment()
Any comments you want to include about the distribution.
|
BehaviorOptions |
getDefaultBehavior()
The default behavior for the distribution.
|
default String |
getDefaultRootObject()
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.
|
default List<String> |
getDomainNames()
Alternative domain names for this distribution.
|
default Boolean |
getEnabled()
Enable or disable the distribution.
|
default Boolean |
getEnableIpv6()
Whether CloudFront will respond to IPv6 DNS requests with an IPv6 address.
|
default Boolean |
getEnableLogging()
Enable access logging for the distribution.
|
default List<ErrorResponse> |
getErrorResponses()
How CloudFront should handle requests that are not successful (e.g., PageNotFound).
|
default GeoRestriction |
getGeoRestriction()
Controls the countries in which your content is distributed.
|
default HttpVersion |
getHttpVersion()
Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront.
|
default IBucket |
getLogBucket()
The Amazon S3 bucket to store the access logs in.
|
default String |
getLogFilePrefix()
An optional string that you want CloudFront to prefix to the access log filenames for this distribution.
|
default Boolean |
getLogIncludesCookies()
Specifies whether you want CloudFront to include cookies in access logs.
|
default SecurityPolicyProtocol |
getMinimumProtocolVersion()
The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections.
|
default PriceClass |
getPriceClass()
The price class that corresponds with the maximum price that you want to pay for CloudFront service.
|
default SSLMethod |
getSslSupportMethod()
The SSL method CloudFront will use for your distribution.
|
default String |
getWebAclId()
Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution.
|
@Stability(value=Stable) @NotNull BehaviorOptions getDefaultBehavior()
@Stability(value=Stable) @Nullable default Map<String,BehaviorOptions> getAdditionalBehaviors()
Default: - no additional behaviors are added.
@Stability(value=Stable) @Nullable default ICertificate getCertificate()
The certificate must be located in N. Virginia (us-east-1).
Default: - the CloudFront wildcard certificate (*.cloudfront.net) will be used.
@Stability(value=Stable) @Nullable default String getComment()
Default: - no comment
@Stability(value=Stable) @Nullable default String getDefaultRootObject()
Default: - no default root object
@Stability(value=Stable) @Nullable default List<String> getDomainNames()
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.
Default: - The distribution will only support the default generated name (e.g., d111111abcdef8.cloudfront.net)
@Stability(value=Stable) @Nullable default Boolean getEnabled()
Default: true
@Stability(value=Stable) @Nullable default Boolean getEnableIpv6()
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.
Default: true
@Stability(value=Stable) @Nullable default Boolean getEnableLogging()
Default: - false, unless `logBucket` is specified.
@Stability(value=Stable) @Nullable default List<ErrorResponse> getErrorResponses()
Default: - No custom error responses.
@Stability(value=Stable) @Nullable default GeoRestriction getGeoRestriction()
Default: - No geographic restrictions
@Stability(value=Stable) @Nullable default HttpVersion getHttpVersion()
For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support server name identification (SNI).
Default: HttpVersion.HTTP2
@Stability(value=Stable) @Nullable default IBucket getLogBucket()
Default: - A bucket is created if `enableLogging` is true
@Stability(value=Stable) @Nullable default String getLogFilePrefix()
Default: - no prefix
@Stability(value=Stable) @Nullable default Boolean getLogIncludesCookies()
Default: false
@Stability(value=Stable) @Nullable default SecurityPolicyProtocol getMinimumProtocolVersion()
CloudFront serves your objects only to browsers or devices that support at least the SSL version that you specify.
Default: - SecurityPolicyProtocol.TLS_V1_2_2021 if the '
@Stability(value=Stable) @Nullable default PriceClass getPriceClass()
If you specify PriceClass_All, CloudFront responds to requests for your objects from all CloudFront edge locations. If you specify a price class other than PriceClass_All, CloudFront serves your objects from the CloudFront edge location that has the lowest latency among the edge locations in your price class.
Default: PriceClass.PRICE_CLASS_ALL
@Stability(value=Stable) @Nullable default SSLMethod getSslSupportMethod()
Server Name Indication (SNI) - is an extension to the TLS computer networking protocol by which a client indicates which hostname it is attempting to connect to at the start of the handshaking process. This allows a server to present multiple certificates on the same IP address and TCP port number and hence allows multiple secure (HTTPS) websites (or any other service over TLS) to be served by the same IP address without requiring all those sites to use the same certificate.
CloudFront can use SNI to host multiple distributions on the same IP - which a large majority of clients will support.
If your clients cannot support SNI however - CloudFront can use dedicated IPs for your distribution - but there is a prorated monthly charge for using this feature. By default, we use SNI - but you can optionally enable dedicated IPs (VIP).
See the CloudFront SSL for more details about pricing : https://aws.amazon.com/cloudfront/custom-ssl-domains/
Default: SSLMethod.SNI
@Stability(value=Stable) @Nullable default String getWebAclId()
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.
Default: - No AWS Web Application Firewall web access control list (web ACL).
@Stability(value=Stable) static DistributionProps.Builder builder()
DistributionProps.Builder of DistributionPropsCopyright © 2022. All rights reserved.