Class: AWSCDK::CloudFront::CfnResponseHeadersPolicy::ServerTimingHeadersConfigProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudFront::CfnResponseHeadersPolicy::ServerTimingHeadersConfigProperty
- Defined in:
- cloud_front/cfn_response_headers_policy.rb
Overview
A configuration for enabling the Server-Timing header in HTTP responses sent from CloudFront.
Instance Attribute Summary collapse
-
#enabled ⇒ Boolean, AWSCDK::IResolvable
readonly
A Boolean that determines whether CloudFront adds the
Server-Timingheader to HTTP responses that it sends in response to requests that match a cache behavior that's associated with this response headers policy. -
#sampling_rate ⇒ Numeric?
readonly
A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add the
Server-Timingheader to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(enabled:, sampling_rate: nil) ⇒ ServerTimingHeadersConfigProperty
constructor
A new instance of ServerTimingHeadersConfigProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(enabled:, sampling_rate: nil) ⇒ ServerTimingHeadersConfigProperty
Returns a new instance of ServerTimingHeadersConfigProperty.
1326 1327 1328 1329 1330 1331 |
# File 'cloud_front/cfn_response_headers_policy.rb', line 1326 def initialize(enabled:, sampling_rate: nil) @enabled = enabled Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enabled") @sampling_rate = sampling_rate Jsii::Type.check_type(@sampling_rate, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "samplingRate") unless @sampling_rate.nil? end |
Instance Attribute Details
#enabled ⇒ Boolean, AWSCDK::IResolvable (readonly)
A Boolean that determines whether CloudFront adds the Server-Timing header to HTTP responses that it sends in response to requests that match a cache behavior that's associated with this response headers policy.
1337 1338 1339 |
# File 'cloud_front/cfn_response_headers_policy.rb', line 1337 def enabled @enabled end |
#sampling_rate ⇒ Numeric? (readonly)
A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add the Server-Timing header to.
When you set the sampling rate to 100, CloudFront adds the Server-Timing header to the HTTP response for every request that matches the cache behavior that this response headers policy is attached to. When you set it to 50, CloudFront adds the header to 50% of the responses for requests that match the cache behavior. You can set the sampling rate to any number 0–100 with up to four decimal places.
1344 1345 1346 |
# File 'cloud_front/cfn_response_headers_policy.rb', line 1344 def sampling_rate @sampling_rate end |
Class Method Details
.jsii_properties ⇒ Object
1346 1347 1348 1349 1350 1351 |
# File 'cloud_front/cfn_response_headers_policy.rb', line 1346 def self.jsii_properties { :enabled => "enabled", :sampling_rate => "samplingRate", } end |
Instance Method Details
#to_jsii ⇒ Object
1353 1354 1355 1356 1357 1358 1359 1360 |
# File 'cloud_front/cfn_response_headers_policy.rb', line 1353 def to_jsii result = {} result.merge!({ "enabled" => @enabled, "samplingRate" => @sampling_rate, }) result.compact end |