com.amazonaws.services.cloudfront.model.DistributionConfig Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudfront Show documentation
/*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.cloudfront.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* A distribution configuration.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DistributionConfig implements Serializable, Cloneable {
/**
*
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
*
* If the value of CallerReference
is new (regardless of the content of the
* DistributionConfig
object), CloudFront creates a new distribution.
*
*
* If CallerReference
is a value that you already sent in a previous request to create a distribution,
* CloudFront returns a DistributionAlreadyExists
error.
*
*/
private String callerReference;
/**
*
* A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
*
*/
private Aliases aliases;
/**
*
* 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 (http://www.example.com
) instead of an object in
* your distribution (http://www.example.com/product-description.html
). Specifying a default root
* object avoids exposing the contents of your distribution.
*
*
* Specify only the object name, for example, index.html
. Don't add a /
before the object
* name.
*
*
* If you don't want to specify a default root object when you create a distribution, include an empty
* DefaultRootObject
element.
*
*
* To delete the default root object from an existing distribution, update the distribution configuration and
* include an empty DefaultRootObject
element.
*
*
* To replace the default root object, update the distribution configuration and specify the new object.
*
*
* For more information about the default root object, see Creating a
* Default Root Object in the Amazon CloudFront Developer Guide.
*
*/
private String defaultRootObject;
/**
*
* A complex type that contains information about origins for this distribution.
*
*/
private Origins origins;
/**
*
* A complex type that contains information about origin groups for this distribution.
*
*/
private OriginGroups originGroups;
/**
*
* A complex type that describes the default cache behavior if you don't specify a CacheBehavior
* element or if files don't match any of the values of PathPattern
in CacheBehavior
* elements. You must create exactly one default cache behavior.
*
*/
private DefaultCacheBehavior defaultCacheBehavior;
/**
*
* A complex type that contains zero or more CacheBehavior
elements.
*
*/
private CacheBehaviors cacheBehaviors;
/**
*
* A complex type that controls the following:
*
*
* -
*
* Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before
* returning the response to the viewer.
*
*
* -
*
* How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
*
*
*
*
* For more information about custom error pages, see Customizing
* Error Responses in the Amazon CloudFront Developer Guide.
*
*/
private CustomErrorResponses customErrorResponses;
/**
*
* An optional comment to describe the distribution. The comment cannot be longer than 128 characters.
*
*/
private String comment;
/**
*
* A complex type that controls whether access logs are written for the distribution.
*
*
* For more information about logging, see Access Logs in the
* Amazon CloudFront Developer Guide.
*
*/
private LoggingConfig logging;
/**
*
* The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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. Viewers who
* are in or near regions that are excluded from your specified price class may encounter slower performance.
*
*
* For more information about price classes, see Choosing the Price
* Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For information about
* CloudFront pricing, including how price classes (such as Price Class 100) map to CloudFront regions, see Amazon CloudFront Pricing.
*
*/
private String priceClass;
/**
*
* From this field, you can enable or disable the selected distribution.
*
*/
private Boolean enabled;
/**
*
* A complex type that determines the distribution’s SSL/TLS configuration for communicating with viewers.
*
*/
private ViewerCertificate viewerCertificate;
/**
*
* A complex type that identifies ways in which you want to restrict distribution of your content.
*
*/
private Restrictions restrictions;
/**
*
* A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this 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
.
*
*
* AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to
* CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP
* addresses that requests originate from or the values of query strings, CloudFront responds to requests either
* with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to
* return a custom error page when a request is blocked. For more information about AWS WAF, see the AWS WAF Developer Guide.
*
*/
private String webACLId;
/**
*
* (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The
* default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier
* HTTP version.
*
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name
* Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve
* performance by optimizing for HTTP/2. For more information, do an Internet search for "http/2 optimization."
*
*/
private String httpVersion;
/**
*
* If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify
* true
. 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.
*
*
* In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However,
* if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom
* policy that includes the IpAddress
parameter to restrict the IP addresses that can access your
* content, don't enable IPv6. If you want to restrict access to some content by IP address and not restrict access
* to other content (or restrict access but not by IP address), you can create two distributions. For more
* information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide.
*
*
* If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution,
* you need to create a second alias resource record set when both of the following are true:
*
*
* -
*
* You enable IPv6 for the distribution
*
*
* -
*
* You're using alternate domain names in the URLs for your objects
*
*
*
*
* For more information, see Routing
* Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53
* Developer Guide.
*
*
* If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't
* need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address
* format of the viewer request.
*
*/
private Boolean isIPV6Enabled;
/**
* Default constructor for DistributionConfig object. Callers should use the setter or fluent setter (with...)
* methods to initialize the object after creating it.
*/
public DistributionConfig() {
}
/**
* Constructs a new DistributionConfig object. Callers should use the setter or fluent setter (with...) methods to
* initialize any additional object members.
*
* @param callerReference
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
* If the value of CallerReference
is new (regardless of the content of the
* DistributionConfig
object), CloudFront creates a new distribution.
*
*
* If CallerReference
is a value that you already sent in a previous request to create a
* distribution, CloudFront returns a DistributionAlreadyExists
error.
* @param enabled
* From this field, you can enable or disable the selected distribution.
*/
public DistributionConfig(String callerReference, Boolean enabled) {
setCallerReference(callerReference);
setEnabled(enabled);
}
/**
*
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
*
* If the value of CallerReference
is new (regardless of the content of the
* DistributionConfig
object), CloudFront creates a new distribution.
*
*
* If CallerReference
is a value that you already sent in a previous request to create a distribution,
* CloudFront returns a DistributionAlreadyExists
error.
*
*
* @param callerReference
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
* If the value of CallerReference
is new (regardless of the content of the
* DistributionConfig
object), CloudFront creates a new distribution.
*
*
* If CallerReference
is a value that you already sent in a previous request to create a
* distribution, CloudFront returns a DistributionAlreadyExists
error.
*/
public void setCallerReference(String callerReference) {
this.callerReference = callerReference;
}
/**
*
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
*
* If the value of CallerReference
is new (regardless of the content of the
* DistributionConfig
object), CloudFront creates a new distribution.
*
*
* If CallerReference
is a value that you already sent in a previous request to create a distribution,
* CloudFront returns a DistributionAlreadyExists
error.
*
*
* @return A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
* If the value of CallerReference
is new (regardless of the content of the
* DistributionConfig
object), CloudFront creates a new distribution.
*
*
* If CallerReference
is a value that you already sent in a previous request to create a
* distribution, CloudFront returns a DistributionAlreadyExists
error.
*/
public String getCallerReference() {
return this.callerReference;
}
/**
*
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
*
* If the value of CallerReference
is new (regardless of the content of the
* DistributionConfig
object), CloudFront creates a new distribution.
*
*
* If CallerReference
is a value that you already sent in a previous request to create a distribution,
* CloudFront returns a DistributionAlreadyExists
error.
*
*
* @param callerReference
* A unique value (for example, a date-time stamp) that ensures that the request can't be replayed.
*
* If the value of CallerReference
is new (regardless of the content of the
* DistributionConfig
object), CloudFront creates a new distribution.
*
*
* If CallerReference
is a value that you already sent in a previous request to create a
* distribution, CloudFront returns a DistributionAlreadyExists
error.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withCallerReference(String callerReference) {
setCallerReference(callerReference);
return this;
}
/**
*
* A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
*
*
* @param aliases
* A complex type that contains information about CNAMEs (alternate domain names), if any, for this
* distribution.
*/
public void setAliases(Aliases aliases) {
this.aliases = aliases;
}
/**
*
* A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
*
*
* @return A complex type that contains information about CNAMEs (alternate domain names), if any, for this
* distribution.
*/
public Aliases getAliases() {
return this.aliases;
}
/**
*
* A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
*
*
* @param aliases
* A complex type that contains information about CNAMEs (alternate domain names), if any, for this
* distribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withAliases(Aliases aliases) {
setAliases(aliases);
return this;
}
/**
*
* 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 (http://www.example.com
) instead of an object in
* your distribution (http://www.example.com/product-description.html
). Specifying a default root
* object avoids exposing the contents of your distribution.
*
*
* Specify only the object name, for example, index.html
. Don't add a /
before the object
* name.
*
*
* If you don't want to specify a default root object when you create a distribution, include an empty
* DefaultRootObject
element.
*
*
* To delete the default root object from an existing distribution, update the distribution configuration and
* include an empty DefaultRootObject
element.
*
*
* To replace the default root object, update the distribution configuration and specify the new object.
*
*
* For more information about the default root object, see Creating a
* Default Root Object in the Amazon CloudFront Developer Guide.
*
*
* @param defaultRootObject
* 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 (http://www.example.com
) instead of
* an object in your distribution (http://www.example.com/product-description.html
). Specifying
* a default root object avoids exposing the contents of your distribution.
*
* Specify only the object name, for example, index.html
. Don't add a /
before the
* object name.
*
*
* If you don't want to specify a default root object when you create a distribution, include an empty
* DefaultRootObject
element.
*
*
* To delete the default root object from an existing distribution, update the distribution configuration and
* include an empty DefaultRootObject
element.
*
*
* To replace the default root object, update the distribution configuration and specify the new object.
*
*
* For more information about the default root object, see Creating
* a Default Root Object in the Amazon CloudFront Developer Guide.
*/
public void setDefaultRootObject(String defaultRootObject) {
this.defaultRootObject = defaultRootObject;
}
/**
*
* 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 (http://www.example.com
) instead of an object in
* your distribution (http://www.example.com/product-description.html
). Specifying a default root
* object avoids exposing the contents of your distribution.
*
*
* Specify only the object name, for example, index.html
. Don't add a /
before the object
* name.
*
*
* If you don't want to specify a default root object when you create a distribution, include an empty
* DefaultRootObject
element.
*
*
* To delete the default root object from an existing distribution, update the distribution configuration and
* include an empty DefaultRootObject
element.
*
*
* To replace the default root object, update the distribution configuration and specify the new object.
*
*
* For more information about the default root object, see Creating a
* Default Root Object in the Amazon CloudFront Developer Guide.
*
*
* @return 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 (http://www.example.com
) instead
* of an object in your distribution (http://www.example.com/product-description.html
).
* Specifying a default root object avoids exposing the contents of your distribution.
*
* Specify only the object name, for example, index.html
. Don't add a /
before the
* object name.
*
*
* If you don't want to specify a default root object when you create a distribution, include an empty
* DefaultRootObject
element.
*
*
* To delete the default root object from an existing distribution, update the distribution configuration
* and include an empty DefaultRootObject
element.
*
*
* To replace the default root object, update the distribution configuration and specify the new object.
*
*
* For more information about the default root object, see Creating
* a Default Root Object in the Amazon CloudFront Developer Guide.
*/
public String getDefaultRootObject() {
return this.defaultRootObject;
}
/**
*
* 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 (http://www.example.com
) instead of an object in
* your distribution (http://www.example.com/product-description.html
). Specifying a default root
* object avoids exposing the contents of your distribution.
*
*
* Specify only the object name, for example, index.html
. Don't add a /
before the object
* name.
*
*
* If you don't want to specify a default root object when you create a distribution, include an empty
* DefaultRootObject
element.
*
*
* To delete the default root object from an existing distribution, update the distribution configuration and
* include an empty DefaultRootObject
element.
*
*
* To replace the default root object, update the distribution configuration and specify the new object.
*
*
* For more information about the default root object, see Creating a
* Default Root Object in the Amazon CloudFront Developer Guide.
*
*
* @param defaultRootObject
* 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 (http://www.example.com
) instead of
* an object in your distribution (http://www.example.com/product-description.html
). Specifying
* a default root object avoids exposing the contents of your distribution.
*
* Specify only the object name, for example, index.html
. Don't add a /
before the
* object name.
*
*
* If you don't want to specify a default root object when you create a distribution, include an empty
* DefaultRootObject
element.
*
*
* To delete the default root object from an existing distribution, update the distribution configuration and
* include an empty DefaultRootObject
element.
*
*
* To replace the default root object, update the distribution configuration and specify the new object.
*
*
* For more information about the default root object, see Creating
* a Default Root Object in the Amazon CloudFront Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withDefaultRootObject(String defaultRootObject) {
setDefaultRootObject(defaultRootObject);
return this;
}
/**
*
* A complex type that contains information about origins for this distribution.
*
*
* @param origins
* A complex type that contains information about origins for this distribution.
*/
public void setOrigins(Origins origins) {
this.origins = origins;
}
/**
*
* A complex type that contains information about origins for this distribution.
*
*
* @return A complex type that contains information about origins for this distribution.
*/
public Origins getOrigins() {
return this.origins;
}
/**
*
* A complex type that contains information about origins for this distribution.
*
*
* @param origins
* A complex type that contains information about origins for this distribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withOrigins(Origins origins) {
setOrigins(origins);
return this;
}
/**
*
* A complex type that contains information about origin groups for this distribution.
*
*
* @param originGroups
* A complex type that contains information about origin groups for this distribution.
*/
public void setOriginGroups(OriginGroups originGroups) {
this.originGroups = originGroups;
}
/**
*
* A complex type that contains information about origin groups for this distribution.
*
*
* @return A complex type that contains information about origin groups for this distribution.
*/
public OriginGroups getOriginGroups() {
return this.originGroups;
}
/**
*
* A complex type that contains information about origin groups for this distribution.
*
*
* @param originGroups
* A complex type that contains information about origin groups for this distribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withOriginGroups(OriginGroups originGroups) {
setOriginGroups(originGroups);
return this;
}
/**
*
* A complex type that describes the default cache behavior if you don't specify a CacheBehavior
* element or if files don't match any of the values of PathPattern
in CacheBehavior
* elements. You must create exactly one default cache behavior.
*
*
* @param defaultCacheBehavior
* A complex type that describes the default cache behavior if you don't specify a CacheBehavior
* element or if files don't match any of the values of PathPattern
in
* CacheBehavior
elements. You must create exactly one default cache behavior.
*/
public void setDefaultCacheBehavior(DefaultCacheBehavior defaultCacheBehavior) {
this.defaultCacheBehavior = defaultCacheBehavior;
}
/**
*
* A complex type that describes the default cache behavior if you don't specify a CacheBehavior
* element or if files don't match any of the values of PathPattern
in CacheBehavior
* elements. You must create exactly one default cache behavior.
*
*
* @return A complex type that describes the default cache behavior if you don't specify a
* CacheBehavior
element or if files don't match any of the values of PathPattern
* in CacheBehavior
elements. You must create exactly one default cache behavior.
*/
public DefaultCacheBehavior getDefaultCacheBehavior() {
return this.defaultCacheBehavior;
}
/**
*
* A complex type that describes the default cache behavior if you don't specify a CacheBehavior
* element or if files don't match any of the values of PathPattern
in CacheBehavior
* elements. You must create exactly one default cache behavior.
*
*
* @param defaultCacheBehavior
* A complex type that describes the default cache behavior if you don't specify a CacheBehavior
* element or if files don't match any of the values of PathPattern
in
* CacheBehavior
elements. You must create exactly one default cache behavior.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withDefaultCacheBehavior(DefaultCacheBehavior defaultCacheBehavior) {
setDefaultCacheBehavior(defaultCacheBehavior);
return this;
}
/**
*
* A complex type that contains zero or more CacheBehavior
elements.
*
*
* @param cacheBehaviors
* A complex type that contains zero or more CacheBehavior
elements.
*/
public void setCacheBehaviors(CacheBehaviors cacheBehaviors) {
this.cacheBehaviors = cacheBehaviors;
}
/**
*
* A complex type that contains zero or more CacheBehavior
elements.
*
*
* @return A complex type that contains zero or more CacheBehavior
elements.
*/
public CacheBehaviors getCacheBehaviors() {
return this.cacheBehaviors;
}
/**
*
* A complex type that contains zero or more CacheBehavior
elements.
*
*
* @param cacheBehaviors
* A complex type that contains zero or more CacheBehavior
elements.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withCacheBehaviors(CacheBehaviors cacheBehaviors) {
setCacheBehaviors(cacheBehaviors);
return this;
}
/**
*
* A complex type that controls the following:
*
*
* -
*
* Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before
* returning the response to the viewer.
*
*
* -
*
* How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
*
*
*
*
* For more information about custom error pages, see Customizing
* Error Responses in the Amazon CloudFront Developer Guide.
*
*
* @param customErrorResponses
* A complex type that controls the following:
*
* -
*
* Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before
* returning the response to the viewer.
*
*
* -
*
* How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
*
*
*
*
* For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide.
*/
public void setCustomErrorResponses(CustomErrorResponses customErrorResponses) {
this.customErrorResponses = customErrorResponses;
}
/**
*
* A complex type that controls the following:
*
*
* -
*
* Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before
* returning the response to the viewer.
*
*
* -
*
* How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
*
*
*
*
* For more information about custom error pages, see Customizing
* Error Responses in the Amazon CloudFront Developer Guide.
*
*
* @return A complex type that controls the following:
*
* -
*
* Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before
* returning the response to the viewer.
*
*
* -
*
* How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
*
*
*
*
* For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide.
*/
public CustomErrorResponses getCustomErrorResponses() {
return this.customErrorResponses;
}
/**
*
* A complex type that controls the following:
*
*
* -
*
* Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before
* returning the response to the viewer.
*
*
* -
*
* How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
*
*
*
*
* For more information about custom error pages, see Customizing
* Error Responses in the Amazon CloudFront Developer Guide.
*
*
* @param customErrorResponses
* A complex type that controls the following:
*
* -
*
* Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before
* returning the response to the viewer.
*
*
* -
*
* How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
*
*
*
*
* For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withCustomErrorResponses(CustomErrorResponses customErrorResponses) {
setCustomErrorResponses(customErrorResponses);
return this;
}
/**
*
* An optional comment to describe the distribution. The comment cannot be longer than 128 characters.
*
*
* @param comment
* An optional comment to describe the distribution. The comment cannot be longer than 128 characters.
*/
public void setComment(String comment) {
this.comment = comment;
}
/**
*
* An optional comment to describe the distribution. The comment cannot be longer than 128 characters.
*
*
* @return An optional comment to describe the distribution. The comment cannot be longer than 128 characters.
*/
public String getComment() {
return this.comment;
}
/**
*
* An optional comment to describe the distribution. The comment cannot be longer than 128 characters.
*
*
* @param comment
* An optional comment to describe the distribution. The comment cannot be longer than 128 characters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withComment(String comment) {
setComment(comment);
return this;
}
/**
*
* A complex type that controls whether access logs are written for the distribution.
*
*
* For more information about logging, see Access Logs in the
* Amazon CloudFront Developer Guide.
*
*
* @param logging
* A complex type that controls whether access logs are written for the distribution.
*
* For more information about logging, see Access Logs
* in the Amazon CloudFront Developer Guide.
*/
public void setLogging(LoggingConfig logging) {
this.logging = logging;
}
/**
*
* A complex type that controls whether access logs are written for the distribution.
*
*
* For more information about logging, see Access Logs in the
* Amazon CloudFront Developer Guide.
*
*
* @return A complex type that controls whether access logs are written for the distribution.
*
* For more information about logging, see Access Logs
* in the Amazon CloudFront Developer Guide.
*/
public LoggingConfig getLogging() {
return this.logging;
}
/**
*
* A complex type that controls whether access logs are written for the distribution.
*
*
* For more information about logging, see Access Logs in the
* Amazon CloudFront Developer Guide.
*
*
* @param logging
* A complex type that controls whether access logs are written for the distribution.
*
* For more information about logging, see Access Logs
* in the Amazon CloudFront Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withLogging(LoggingConfig logging) {
setLogging(logging);
return this;
}
/**
*
* The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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. Viewers who
* are in or near regions that are excluded from your specified price class may encounter slower performance.
*
*
* For more information about price classes, see Choosing the Price
* Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For information about
* CloudFront pricing, including how price classes (such as Price Class 100) map to CloudFront regions, see Amazon CloudFront Pricing.
*
*
* @param priceClass
* The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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.
* Viewers who are in or near regions that are excluded from your specified price class may encounter slower
* performance.
*
*
* For more information about price classes, see Choosing the
* Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For
* information about CloudFront pricing, including how price classes (such as Price Class 100) map to
* CloudFront regions, see Amazon CloudFront Pricing.
* @see PriceClass
*/
public void setPriceClass(String priceClass) {
this.priceClass = priceClass;
}
/**
*
* The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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. Viewers who
* are in or near regions that are excluded from your specified price class may encounter slower performance.
*
*
* For more information about price classes, see Choosing the Price
* Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For information about
* CloudFront pricing, including how price classes (such as Price Class 100) map to CloudFront regions, see Amazon CloudFront Pricing.
*
*
* @return The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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.
* Viewers who are in or near regions that are excluded from your specified price class may encounter slower
* performance.
*
*
* For more information about price classes, see Choosing the
* Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For
* information about CloudFront pricing, including how price classes (such as Price Class 100) map to
* CloudFront regions, see Amazon CloudFront
* Pricing.
* @see PriceClass
*/
public String getPriceClass() {
return this.priceClass;
}
/**
*
* The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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. Viewers who
* are in or near regions that are excluded from your specified price class may encounter slower performance.
*
*
* For more information about price classes, see Choosing the Price
* Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For information about
* CloudFront pricing, including how price classes (such as Price Class 100) map to CloudFront regions, see Amazon CloudFront Pricing.
*
*
* @param priceClass
* The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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.
* Viewers who are in or near regions that are excluded from your specified price class may encounter slower
* performance.
*
*
* For more information about price classes, see Choosing the
* Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For
* information about CloudFront pricing, including how price classes (such as Price Class 100) map to
* CloudFront regions, see Amazon CloudFront Pricing.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PriceClass
*/
public DistributionConfig withPriceClass(String priceClass) {
setPriceClass(priceClass);
return this;
}
/**
*
* The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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. Viewers who
* are in or near regions that are excluded from your specified price class may encounter slower performance.
*
*
* For more information about price classes, see Choosing the Price
* Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For information about
* CloudFront pricing, including how price classes (such as Price Class 100) map to CloudFront regions, see Amazon CloudFront Pricing.
*
*
* @param priceClass
* The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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.
* Viewers who are in or near regions that are excluded from your specified price class may encounter slower
* performance.
*
*
* For more information about price classes, see Choosing the
* Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For
* information about CloudFront pricing, including how price classes (such as Price Class 100) map to
* CloudFront regions, see Amazon CloudFront Pricing.
* @see PriceClass
*/
public void setPriceClass(PriceClass priceClass) {
withPriceClass(priceClass);
}
/**
*
* The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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. Viewers who
* are in or near regions that are excluded from your specified price class may encounter slower performance.
*
*
* For more information about price classes, see Choosing the Price
* Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For information about
* CloudFront pricing, including how price classes (such as Price Class 100) map to CloudFront regions, see Amazon CloudFront Pricing.
*
*
* @param priceClass
* The price class that corresponds with the maximum price that you want to pay for CloudFront service. 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.
* Viewers who are in or near regions that are excluded from your specified price class may encounter slower
* performance.
*
*
* For more information about price classes, see Choosing the
* Price Class for a CloudFront Distribution in the Amazon CloudFront Developer Guide. For
* information about CloudFront pricing, including how price classes (such as Price Class 100) map to
* CloudFront regions, see Amazon CloudFront Pricing.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PriceClass
*/
public DistributionConfig withPriceClass(PriceClass priceClass) {
this.priceClass = priceClass.toString();
return this;
}
/**
*
* From this field, you can enable or disable the selected distribution.
*
*
* @param enabled
* From this field, you can enable or disable the selected distribution.
*/
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
/**
*
* From this field, you can enable or disable the selected distribution.
*
*
* @return From this field, you can enable or disable the selected distribution.
*/
public Boolean getEnabled() {
return this.enabled;
}
/**
*
* From this field, you can enable or disable the selected distribution.
*
*
* @param enabled
* From this field, you can enable or disable the selected distribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withEnabled(Boolean enabled) {
setEnabled(enabled);
return this;
}
/**
*
* From this field, you can enable or disable the selected distribution.
*
*
* @return From this field, you can enable or disable the selected distribution.
*/
public Boolean isEnabled() {
return this.enabled;
}
/**
*
* A complex type that determines the distribution’s SSL/TLS configuration for communicating with viewers.
*
*
* @param viewerCertificate
* A complex type that determines the distribution’s SSL/TLS configuration for communicating with viewers.
*/
public void setViewerCertificate(ViewerCertificate viewerCertificate) {
this.viewerCertificate = viewerCertificate;
}
/**
*
* A complex type that determines the distribution’s SSL/TLS configuration for communicating with viewers.
*
*
* @return A complex type that determines the distribution’s SSL/TLS configuration for communicating with viewers.
*/
public ViewerCertificate getViewerCertificate() {
return this.viewerCertificate;
}
/**
*
* A complex type that determines the distribution’s SSL/TLS configuration for communicating with viewers.
*
*
* @param viewerCertificate
* A complex type that determines the distribution’s SSL/TLS configuration for communicating with viewers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withViewerCertificate(ViewerCertificate viewerCertificate) {
setViewerCertificate(viewerCertificate);
return this;
}
/**
*
* A complex type that identifies ways in which you want to restrict distribution of your content.
*
*
* @param restrictions
* A complex type that identifies ways in which you want to restrict distribution of your content.
*/
public void setRestrictions(Restrictions restrictions) {
this.restrictions = restrictions;
}
/**
*
* A complex type that identifies ways in which you want to restrict distribution of your content.
*
*
* @return A complex type that identifies ways in which you want to restrict distribution of your content.
*/
public Restrictions getRestrictions() {
return this.restrictions;
}
/**
*
* A complex type that identifies ways in which you want to restrict distribution of your content.
*
*
* @param restrictions
* A complex type that identifies ways in which you want to restrict distribution of your content.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withRestrictions(Restrictions restrictions) {
setRestrictions(restrictions);
return this;
}
/**
*
* A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this 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
.
*
*
* AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to
* CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP
* addresses that requests originate from or the values of query strings, CloudFront responds to requests either
* with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to
* return a custom error page when a request is blocked. For more information about AWS WAF, see the AWS WAF Developer Guide.
*
*
* @param webACLId
* A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this 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
.
*
* AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded
* to CloudFront, and lets you control access to your content. Based on conditions that you specify, such as
* the IP addresses that requests originate from or the values of query strings, CloudFront responds to
* requests either with the requested content or with an HTTP 403 status code (Forbidden). You can also
* configure CloudFront to return a custom error page when a request is blocked. For more information about
* AWS WAF, see the AWS
* WAF Developer Guide.
*/
public void setWebACLId(String webACLId) {
this.webACLId = webACLId;
}
/**
*
* A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this 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
.
*
*
* AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to
* CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP
* addresses that requests originate from or the values of query strings, CloudFront responds to requests either
* with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to
* return a custom error page when a request is blocked. For more information about AWS WAF, see the AWS WAF Developer Guide.
*
*
* @return A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this 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
.
*
* AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are
* forwarded to CloudFront, and lets you control access to your content. Based on conditions that you
* specify, such as the IP addresses that requests originate from or the values of query strings, CloudFront
* responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). You
* can also configure CloudFront to return a custom error page when a request is blocked. For more
* information about AWS WAF, see the AWS WAF Developer
* Guide.
*/
public String getWebACLId() {
return this.webACLId;
}
/**
*
* A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this 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
.
*
*
* AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to
* CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP
* addresses that requests originate from or the values of query strings, CloudFront responds to requests either
* with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to
* return a custom error page when a request is blocked. For more information about AWS WAF, see the AWS WAF Developer Guide.
*
*
* @param webACLId
* A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this 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
.
*
* AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded
* to CloudFront, and lets you control access to your content. Based on conditions that you specify, such as
* the IP addresses that requests originate from or the values of query strings, CloudFront responds to
* requests either with the requested content or with an HTTP 403 status code (Forbidden). You can also
* configure CloudFront to return a custom error page when a request is blocked. For more information about
* AWS WAF, see the AWS
* WAF Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withWebACLId(String webACLId) {
setWebACLId(webACLId);
return this;
}
/**
*
* (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The
* default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier
* HTTP version.
*
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name
* Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve
* performance by optimizing for HTTP/2. For more information, do an Internet search for "http/2 optimization."
*
*
* @param httpVersion
* (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront.
* The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use
* an earlier HTTP version.
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server
* Name Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can
* improve performance by optimizing for HTTP/2. For more information, do an Internet search for
* "http/2 optimization."
* @see HttpVersion
*/
public void setHttpVersion(String httpVersion) {
this.httpVersion = httpVersion;
}
/**
*
* (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The
* default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier
* HTTP version.
*
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name
* Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve
* performance by optimizing for HTTP/2. For more information, do an Internet search for "http/2 optimization."
*
*
* @return (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront.
* The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use
* an earlier HTTP version.
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server
* Name Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can
* improve performance by optimizing for HTTP/2. For more information, do an Internet search for
* "http/2 optimization."
* @see HttpVersion
*/
public String getHttpVersion() {
return this.httpVersion;
}
/**
*
* (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The
* default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier
* HTTP version.
*
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name
* Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve
* performance by optimizing for HTTP/2. For more information, do an Internet search for "http/2 optimization."
*
*
* @param httpVersion
* (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront.
* The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use
* an earlier HTTP version.
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server
* Name Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can
* improve performance by optimizing for HTTP/2. For more information, do an Internet search for
* "http/2 optimization."
* @return Returns a reference to this object so that method calls can be chained together.
* @see HttpVersion
*/
public DistributionConfig withHttpVersion(String httpVersion) {
setHttpVersion(httpVersion);
return this;
}
/**
*
* (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The
* default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier
* HTTP version.
*
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name
* Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve
* performance by optimizing for HTTP/2. For more information, do an Internet search for "http/2 optimization."
*
*
* @param httpVersion
* (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront.
* The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use
* an earlier HTTP version.
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server
* Name Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can
* improve performance by optimizing for HTTP/2. For more information, do an Internet search for
* "http/2 optimization."
* @see HttpVersion
*/
public void setHttpVersion(HttpVersion httpVersion) {
withHttpVersion(httpVersion);
}
/**
*
* (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront. The
* default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use an earlier
* HTTP version.
*
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server Name
* Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can improve
* performance by optimizing for HTTP/2. For more information, do an Internet search for "http/2 optimization."
*
*
* @param httpVersion
* (Optional) Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront.
* The default value for new web distributions is http2. Viewers that don't support HTTP/2 automatically use
* an earlier HTTP version.
*
* For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support Server
* Name Identification (SNI).
*
*
* In general, configuring CloudFront to communicate with viewers using HTTP/2 reduces latency. You can
* improve performance by optimizing for HTTP/2. For more information, do an Internet search for
* "http/2 optimization."
* @return Returns a reference to this object so that method calls can be chained together.
* @see HttpVersion
*/
public DistributionConfig withHttpVersion(HttpVersion httpVersion) {
this.httpVersion = httpVersion.toString();
return this;
}
/**
*
* If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify
* true
. 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.
*
*
* In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However,
* if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom
* policy that includes the IpAddress
parameter to restrict the IP addresses that can access your
* content, don't enable IPv6. If you want to restrict access to some content by IP address and not restrict access
* to other content (or restrict access but not by IP address), you can create two distributions. For more
* information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide.
*
*
* If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution,
* you need to create a second alias resource record set when both of the following are true:
*
*
* -
*
* You enable IPv6 for the distribution
*
*
* -
*
* You're using alternate domain names in the URLs for your objects
*
*
*
*
* For more information, see Routing
* Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53
* Developer Guide.
*
*
* If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't
* need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address
* format of the viewer request.
*
*
* @param isIPV6Enabled
* If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify
* true
. 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.
*
* In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content.
* However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're
* using a custom policy that includes the IpAddress
parameter to restrict the IP addresses that
* can access your content, don't enable IPv6. If you want to restrict access to some content by IP address
* and not restrict access to other content (or restrict access but not by IP address), you can create two
* distributions. For more information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide.
*
*
* If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront
* distribution, you need to create a second alias resource record set when both of the following are true:
*
*
* -
*
* You enable IPv6 for the distribution
*
*
* -
*
* You're using alternate domain names in the URLs for your objects
*
*
*
*
* For more information, see Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon
* Route 53 Developer Guide.
*
*
* If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you
* don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the
* IP address format of the viewer request.
*/
public void setIsIPV6Enabled(Boolean isIPV6Enabled) {
this.isIPV6Enabled = isIPV6Enabled;
}
/**
*
* If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify
* true
. 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.
*
*
* In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However,
* if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom
* policy that includes the IpAddress
parameter to restrict the IP addresses that can access your
* content, don't enable IPv6. If you want to restrict access to some content by IP address and not restrict access
* to other content (or restrict access but not by IP address), you can create two distributions. For more
* information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide.
*
*
* If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution,
* you need to create a second alias resource record set when both of the following are true:
*
*
* -
*
* You enable IPv6 for the distribution
*
*
* -
*
* You're using alternate domain names in the URLs for your objects
*
*
*
*
* For more information, see Routing
* Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53
* Developer Guide.
*
*
* If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't
* need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address
* format of the viewer request.
*
*
* @return If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution,
* specify true
. 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.
*
* In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content.
* However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're
* using a custom policy that includes the IpAddress
parameter to restrict the IP addresses
* that can access your content, don't enable IPv6. If you want to restrict access to some content by IP
* address and not restrict access to other content (or restrict access but not by IP address), you can
* create two distributions. For more information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide.
*
*
* If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront
* distribution, you need to create a second alias resource record set when both of the following are true:
*
*
* -
*
* You enable IPv6 for the distribution
*
*
* -
*
* You're using alternate domain names in the URLs for your objects
*
*
*
*
* For more information, see Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon
* Route 53 Developer Guide.
*
*
* If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you
* don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the
* IP address format of the viewer request.
*/
public Boolean getIsIPV6Enabled() {
return this.isIPV6Enabled;
}
/**
*
* If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify
* true
. 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.
*
*
* In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However,
* if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom
* policy that includes the IpAddress
parameter to restrict the IP addresses that can access your
* content, don't enable IPv6. If you want to restrict access to some content by IP address and not restrict access
* to other content (or restrict access but not by IP address), you can create two distributions. For more
* information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide.
*
*
* If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution,
* you need to create a second alias resource record set when both of the following are true:
*
*
* -
*
* You enable IPv6 for the distribution
*
*
* -
*
* You're using alternate domain names in the URLs for your objects
*
*
*
*
* For more information, see Routing
* Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53
* Developer Guide.
*
*
* If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't
* need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address
* format of the viewer request.
*
*
* @param isIPV6Enabled
* If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify
* true
. 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.
*
* In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content.
* However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're
* using a custom policy that includes the IpAddress
parameter to restrict the IP addresses that
* can access your content, don't enable IPv6. If you want to restrict access to some content by IP address
* and not restrict access to other content (or restrict access but not by IP address), you can create two
* distributions. For more information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide.
*
*
* If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront
* distribution, you need to create a second alias resource record set when both of the following are true:
*
*
* -
*
* You enable IPv6 for the distribution
*
*
* -
*
* You're using alternate domain names in the URLs for your objects
*
*
*
*
* For more information, see Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon
* Route 53 Developer Guide.
*
*
* If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you
* don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the
* IP address format of the viewer request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DistributionConfig withIsIPV6Enabled(Boolean isIPV6Enabled) {
setIsIPV6Enabled(isIPV6Enabled);
return this;
}
/**
*
* If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify
* true
. 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.
*
*
* In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However,
* if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom
* policy that includes the IpAddress
parameter to restrict the IP addresses that can access your
* content, don't enable IPv6. If you want to restrict access to some content by IP address and not restrict access
* to other content (or restrict access but not by IP address), you can create two distributions. For more
* information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide.
*
*
* If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront distribution,
* you need to create a second alias resource record set when both of the following are true:
*
*
* -
*
* You enable IPv6 for the distribution
*
*
* -
*
* You're using alternate domain names in the URLs for your objects
*
*
*
*
* For more information, see Routing
* Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon Route 53
* Developer Guide.
*
*
* If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you don't
* need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address
* format of the viewer request.
*
*
* @return If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution,
* specify true
. 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.
*
* In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content.
* However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're
* using a custom policy that includes the IpAddress
parameter to restrict the IP addresses
* that can access your content, don't enable IPv6. If you want to restrict access to some content by IP
* address and not restrict access to other content (or restrict access but not by IP address), you can
* create two distributions. For more information, see Creating a Signed URL Using a Custom Policy in the Amazon CloudFront Developer Guide.
*
*
* If you're using an Amazon Route 53 alias resource record set to route traffic to your CloudFront
* distribution, you need to create a second alias resource record set when both of the following are true:
*
*
* -
*
* You enable IPv6 for the distribution
*
*
* -
*
* You're using alternate domain names in the URLs for your objects
*
*
*
*
* For more information, see Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name in the Amazon
* Route 53 Developer Guide.
*
*
* If you created a CNAME resource record set, either with Amazon Route 53 or with another DNS service, you
* don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the
* IP address format of the viewer request.
*/
public Boolean isIPV6Enabled() {
return this.isIPV6Enabled;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getCallerReference() != null)
sb.append("CallerReference: ").append(getCallerReference()).append(",");
if (getAliases() != null)
sb.append("Aliases: ").append(getAliases()).append(",");
if (getDefaultRootObject() != null)
sb.append("DefaultRootObject: ").append(getDefaultRootObject()).append(",");
if (getOrigins() != null)
sb.append("Origins: ").append(getOrigins()).append(",");
if (getOriginGroups() != null)
sb.append("OriginGroups: ").append(getOriginGroups()).append(",");
if (getDefaultCacheBehavior() != null)
sb.append("DefaultCacheBehavior: ").append(getDefaultCacheBehavior()).append(",");
if (getCacheBehaviors() != null)
sb.append("CacheBehaviors: ").append(getCacheBehaviors()).append(",");
if (getCustomErrorResponses() != null)
sb.append("CustomErrorResponses: ").append(getCustomErrorResponses()).append(",");
if (getComment() != null)
sb.append("Comment: ").append("***Sensitive Data Redacted***").append(",");
if (getLogging() != null)
sb.append("Logging: ").append(getLogging()).append(",");
if (getPriceClass() != null)
sb.append("PriceClass: ").append(getPriceClass()).append(",");
if (getEnabled() != null)
sb.append("Enabled: ").append(getEnabled()).append(",");
if (getViewerCertificate() != null)
sb.append("ViewerCertificate: ").append(getViewerCertificate()).append(",");
if (getRestrictions() != null)
sb.append("Restrictions: ").append(getRestrictions()).append(",");
if (getWebACLId() != null)
sb.append("WebACLId: ").append(getWebACLId()).append(",");
if (getHttpVersion() != null)
sb.append("HttpVersion: ").append(getHttpVersion()).append(",");
if (getIsIPV6Enabled() != null)
sb.append("IsIPV6Enabled: ").append(getIsIPV6Enabled());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DistributionConfig == false)
return false;
DistributionConfig other = (DistributionConfig) obj;
if (other.getCallerReference() == null ^ this.getCallerReference() == null)
return false;
if (other.getCallerReference() != null && other.getCallerReference().equals(this.getCallerReference()) == false)
return false;
if (other.getAliases() == null ^ this.getAliases() == null)
return false;
if (other.getAliases() != null && other.getAliases().equals(this.getAliases()) == false)
return false;
if (other.getDefaultRootObject() == null ^ this.getDefaultRootObject() == null)
return false;
if (other.getDefaultRootObject() != null && other.getDefaultRootObject().equals(this.getDefaultRootObject()) == false)
return false;
if (other.getOrigins() == null ^ this.getOrigins() == null)
return false;
if (other.getOrigins() != null && other.getOrigins().equals(this.getOrigins()) == false)
return false;
if (other.getOriginGroups() == null ^ this.getOriginGroups() == null)
return false;
if (other.getOriginGroups() != null && other.getOriginGroups().equals(this.getOriginGroups()) == false)
return false;
if (other.getDefaultCacheBehavior() == null ^ this.getDefaultCacheBehavior() == null)
return false;
if (other.getDefaultCacheBehavior() != null && other.getDefaultCacheBehavior().equals(this.getDefaultCacheBehavior()) == false)
return false;
if (other.getCacheBehaviors() == null ^ this.getCacheBehaviors() == null)
return false;
if (other.getCacheBehaviors() != null && other.getCacheBehaviors().equals(this.getCacheBehaviors()) == false)
return false;
if (other.getCustomErrorResponses() == null ^ this.getCustomErrorResponses() == null)
return false;
if (other.getCustomErrorResponses() != null && other.getCustomErrorResponses().equals(this.getCustomErrorResponses()) == false)
return false;
if (other.getComment() == null ^ this.getComment() == null)
return false;
if (other.getComment() != null && other.getComment().equals(this.getComment()) == false)
return false;
if (other.getLogging() == null ^ this.getLogging() == null)
return false;
if (other.getLogging() != null && other.getLogging().equals(this.getLogging()) == false)
return false;
if (other.getPriceClass() == null ^ this.getPriceClass() == null)
return false;
if (other.getPriceClass() != null && other.getPriceClass().equals(this.getPriceClass()) == false)
return false;
if (other.getEnabled() == null ^ this.getEnabled() == null)
return false;
if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false)
return false;
if (other.getViewerCertificate() == null ^ this.getViewerCertificate() == null)
return false;
if (other.getViewerCertificate() != null && other.getViewerCertificate().equals(this.getViewerCertificate()) == false)
return false;
if (other.getRestrictions() == null ^ this.getRestrictions() == null)
return false;
if (other.getRestrictions() != null && other.getRestrictions().equals(this.getRestrictions()) == false)
return false;
if (other.getWebACLId() == null ^ this.getWebACLId() == null)
return false;
if (other.getWebACLId() != null && other.getWebACLId().equals(this.getWebACLId()) == false)
return false;
if (other.getHttpVersion() == null ^ this.getHttpVersion() == null)
return false;
if (other.getHttpVersion() != null && other.getHttpVersion().equals(this.getHttpVersion()) == false)
return false;
if (other.getIsIPV6Enabled() == null ^ this.getIsIPV6Enabled() == null)
return false;
if (other.getIsIPV6Enabled() != null && other.getIsIPV6Enabled().equals(this.getIsIPV6Enabled()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCallerReference() == null) ? 0 : getCallerReference().hashCode());
hashCode = prime * hashCode + ((getAliases() == null) ? 0 : getAliases().hashCode());
hashCode = prime * hashCode + ((getDefaultRootObject() == null) ? 0 : getDefaultRootObject().hashCode());
hashCode = prime * hashCode + ((getOrigins() == null) ? 0 : getOrigins().hashCode());
hashCode = prime * hashCode + ((getOriginGroups() == null) ? 0 : getOriginGroups().hashCode());
hashCode = prime * hashCode + ((getDefaultCacheBehavior() == null) ? 0 : getDefaultCacheBehavior().hashCode());
hashCode = prime * hashCode + ((getCacheBehaviors() == null) ? 0 : getCacheBehaviors().hashCode());
hashCode = prime * hashCode + ((getCustomErrorResponses() == null) ? 0 : getCustomErrorResponses().hashCode());
hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode());
hashCode = prime * hashCode + ((getLogging() == null) ? 0 : getLogging().hashCode());
hashCode = prime * hashCode + ((getPriceClass() == null) ? 0 : getPriceClass().hashCode());
hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
hashCode = prime * hashCode + ((getViewerCertificate() == null) ? 0 : getViewerCertificate().hashCode());
hashCode = prime * hashCode + ((getRestrictions() == null) ? 0 : getRestrictions().hashCode());
hashCode = prime * hashCode + ((getWebACLId() == null) ? 0 : getWebACLId().hashCode());
hashCode = prime * hashCode + ((getHttpVersion() == null) ? 0 : getHttpVersion().hashCode());
hashCode = prime * hashCode + ((getIsIPV6Enabled() == null) ? 0 : getIsIPV6Enabled().hashCode());
return hashCode;
}
@Override
public DistributionConfig clone() {
try {
return (DistributionConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}