Class: AWSCDK::CloudFront::CloudFrontWebDistributionProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudFront::CloudFrontWebDistributionProps
- Defined in:
- cloud_front/cloud_front_web_distribution_props.rb
Instance Attribute Summary collapse
-
#comment ⇒ String?
readonly
A comment for this distribution in the CloudFront console.
-
#default_root_object ⇒ String?
readonly
The default object to serve.
-
#enable_ip_v6 ⇒ Boolean?
readonly
If your distribution should have IPv6 enabled.
-
#enabled ⇒ Boolean?
readonly
Enable or disable the distribution.
-
#error_configurations ⇒ Array<AWSCDK::CloudFront::CfnDistribution::CustomErrorResponseProperty>?
readonly
How CloudFront should handle requests that are not successful (eg PageNotFound).
-
#geo_restriction ⇒ AWSCDK::CloudFront::GeoRestriction?
readonly
Controls the countries in which your content is distributed.
-
#http_version ⇒ AWSCDK::CloudFront::HttpVersion?
readonly
The max supported HTTP Versions.
-
#logging_config ⇒ AWSCDK::CloudFront::LoggingConfiguration?
readonly
Optional - if we should enable logging.
-
#origin_configs ⇒ Array<AWSCDK::CloudFront::SourceConfiguration>
readonly
The origin configurations for this distribution.
-
#price_class ⇒ AWSCDK::CloudFront::PriceClass?
readonly
The price class for the distribution (this impacts how many locations CloudFront uses for your distribution, and billing).
-
#viewer_certificate ⇒ AWSCDK::CloudFront::ViewerCertificate?
readonly
Specifies whether you want viewers to use HTTP or HTTPS to request your objects, whether you're using an alternate domain name with HTTPS, and if so, if you're using AWS Certificate Manager (ACM) or a third-party certificate authority.
-
#viewer_protocol_policy ⇒ AWSCDK::CloudFront::ViewerProtocolPolicy?
readonly
The default viewer policy for incoming clients.
-
#web_acl_id ⇒ String?
readonly
Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(origin_configs:, comment: nil, default_root_object: nil, enabled: nil, enable_ip_v6: nil, error_configurations: nil, geo_restriction: nil, http_version: nil, logging_config: nil, price_class: nil, viewer_certificate: nil, viewer_protocol_policy: nil, web_acl_id: nil) ⇒ CloudFrontWebDistributionProps
constructor
A new instance of CloudFrontWebDistributionProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(origin_configs:, comment: nil, default_root_object: nil, enabled: nil, enable_ip_v6: nil, error_configurations: nil, geo_restriction: nil, http_version: nil, logging_config: nil, price_class: nil, viewer_certificate: nil, viewer_protocol_policy: nil, web_acl_id: nil) ⇒ CloudFrontWebDistributionProps
Returns a new instance of CloudFrontWebDistributionProps.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 19 def initialize(origin_configs:, comment: nil, default_root_object: nil, enabled: nil, enable_ip_v6: nil, error_configurations: nil, geo_restriction: nil, http_version: nil, logging_config: nil, price_class: nil, viewer_certificate: nil, viewer_protocol_policy: nil, web_acl_id: nil) @origin_configs = origin_configs.is_a?(Array) ? origin_configs.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CloudFront::SourceConfiguration.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : origin_configs Jsii::Type.check_type(@origin_configs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LlNvdXJjZUNvbmZpZ3VyYXRpb24ifSwia2luZCI6ImFycmF5In19")), "originConfigs") @comment = comment Jsii::Type.check_type(@comment, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comment") unless @comment.nil? @default_root_object = default_root_object Jsii::Type.check_type(@default_root_object, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultRootObject") unless @default_root_object.nil? @enabled = enabled Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil? @enable_ip_v6 = enable_ip_v6 Jsii::Type.check_type(@enable_ip_v6, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableIpV6") unless @enable_ip_v6.nil? @error_configurations = error_configurations.is_a?(Array) ? error_configurations.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CloudFront::CfnDistribution::CustomErrorResponseProperty.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : error_configurations Jsii::Type.check_type(@error_configurations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmbkRpc3RyaWJ1dGlvbi5DdXN0b21FcnJvclJlc3BvbnNlUHJvcGVydHkifSwia2luZCI6ImFycmF5In19")), "errorConfigurations") unless @error_configurations.nil? @geo_restriction = geo_restriction Jsii::Type.check_type(@geo_restriction, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5HZW9SZXN0cmljdGlvbiJ9")), "geoRestriction") unless @geo_restriction.nil? @http_version = http_version Jsii::Type.check_type(@http_version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5IdHRwVmVyc2lvbiJ9")), "httpVersion") unless @http_version.nil? @logging_config = logging_config.is_a?(Hash) ? ::AWSCDK::CloudFront::LoggingConfiguration.new(**logging_config.transform_keys(&:to_sym)) : logging_config Jsii::Type.check_type(@logging_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5Mb2dnaW5nQ29uZmlndXJhdGlvbiJ9")), "loggingConfig") unless @logging_config.nil? @price_class = price_class Jsii::Type.check_type(@price_class, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5QcmljZUNsYXNzIn0=")), "priceClass") unless @price_class.nil? @viewer_certificate = viewer_certificate Jsii::Type.check_type(@viewer_certificate, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5WaWV3ZXJDZXJ0aWZpY2F0ZSJ9")), "viewerCertificate") unless @viewer_certificate.nil? @viewer_protocol_policy = viewer_protocol_policy Jsii::Type.check_type(@viewer_protocol_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWRmcm9udC5WaWV3ZXJQcm90b2NvbFBvbGljeSJ9")), "viewerProtocolPolicy") unless @viewer_protocol_policy.nil? @web_acl_id = web_acl_id Jsii::Type.check_type(@web_acl_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "webACLId") unless @web_acl_id.nil? end |
Instance Attribute Details
#comment ⇒ String? (readonly)
Default: - No comment is added to distribution.
A comment for this distribution in the CloudFront console.
58 59 60 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 58 def comment @comment end |
#default_root_object ⇒ String? (readonly)
Default: - "index.html" is served.
The default object to serve.
63 64 65 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 63 def default_root_object @default_root_object end |
#enable_ip_v6 ⇒ Boolean? (readonly)
Default: true
If your distribution should have IPv6 enabled.
73 74 75 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 73 def enable_ip_v6 @enable_ip_v6 end |
#enabled ⇒ Boolean? (readonly)
Default: true
Enable or disable the distribution.
68 69 70 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 68 def enabled @enabled end |
#error_configurations ⇒ Array<AWSCDK::CloudFront::CfnDistribution::CustomErrorResponseProperty>? (readonly)
Default: - No custom error configuration.
How CloudFront should handle requests that are not successful (eg PageNotFound).
By default, CloudFront does not replace HTTP status codes in the 4xx and 5xx range with custom error messages. CloudFront does not cache HTTP status codes.
81 82 83 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 81 def error_configurations @error_configurations end |
#geo_restriction ⇒ AWSCDK::CloudFront::GeoRestriction? (readonly)
Default: No geo restriction
Controls the countries in which your content is distributed.
86 87 88 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 86 def geo_restriction @geo_restriction end |
#http_version ⇒ AWSCDK::CloudFront::HttpVersion? (readonly)
Default: HttpVersion.HTTP2
The max supported HTTP Versions.
91 92 93 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 91 def http_version @http_version end |
#logging_config ⇒ AWSCDK::CloudFront::LoggingConfiguration? (readonly)
Default: - no logging is enabled by default.
Optional - if we should enable logging.
You can pass an empty object ({}) to have us auto create a bucket for logging. Omission of this property indicates no logging is to be enabled.
99 100 101 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 99 def logging_config @logging_config end |
#origin_configs ⇒ Array<AWSCDK::CloudFront::SourceConfiguration> (readonly)
The origin configurations for this distribution.
Behaviors are a part of the origin.
53 54 55 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 53 def origin_configs @origin_configs end |
#price_class ⇒ AWSCDK::CloudFront::PriceClass? (readonly)
Default: PriceClass.PRICE_CLASS_100 the cheapest option for CloudFront is picked by default.
The price class for the distribution (this impacts how many locations CloudFront uses for your distribution, and billing).
104 105 106 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 104 def price_class @price_class end |
#viewer_certificate ⇒ AWSCDK::CloudFront::ViewerCertificate? (readonly)
Default: ViewerCertificate.fromCloudFrontDefaultCertificate()
Specifies whether you want viewers to use HTTP or HTTPS to request your objects, whether you're using an alternate domain name with HTTPS, and if so, if you're using AWS Certificate Manager (ACM) or a third-party certificate authority.
110 111 112 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 110 def viewer_certificate @viewer_certificate end |
#viewer_protocol_policy ⇒ AWSCDK::CloudFront::ViewerProtocolPolicy? (readonly)
Default: RedirectToHTTPs
The default viewer policy for incoming clients.
115 116 117 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 115 def viewer_protocol_policy @viewer_protocol_policy end |
#web_acl_id ⇒ String? (readonly)
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.
126 127 128 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 126 def web_acl_id @web_acl_id end |
Class Method Details
.jsii_properties ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 128 def self.jsii_properties { :origin_configs => "originConfigs", :comment => "comment", :default_root_object => "defaultRootObject", :enabled => "enabled", :enable_ip_v6 => "enableIpV6", :error_configurations => "errorConfigurations", :geo_restriction => "geoRestriction", :http_version => "httpVersion", :logging_config => "loggingConfig", :price_class => "priceClass", :viewer_certificate => "viewerCertificate", :viewer_protocol_policy => "viewerProtocolPolicy", :web_acl_id => "webACLId", } end |
Instance Method Details
#to_jsii ⇒ Object
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'cloud_front/cloud_front_web_distribution_props.rb', line 146 def to_jsii result = {} result.merge!({ "originConfigs" => @origin_configs, "comment" => @comment, "defaultRootObject" => @default_root_object, "enabled" => @enabled, "enableIpV6" => @enable_ip_v6, "errorConfigurations" => @error_configurations, "geoRestriction" => @geo_restriction, "httpVersion" => @http_version, "loggingConfig" => @logging_config, "priceClass" => @price_class, "viewerCertificate" => @viewer_certificate, "viewerProtocolPolicy" => @viewer_protocol_policy, "webACLId" => @web_acl_id, }) result.compact end |