Class: AWSCDK::CloudFront::CfnContinuousDeploymentPolicy::SingleWeightConfigProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudFront::CfnContinuousDeploymentPolicy::SingleWeightConfigProperty
- Defined in:
- cloud_front/cfn_continuous_deployment_policy.rb
Overview
This configuration determines the percentage of HTTP requests that are sent to the staging distribution.
Instance Attribute Summary collapse
-
#session_stickiness_config ⇒ AWSCDK::IResolvable, ...
readonly
Session stickiness provides the ability to define multiple requests from a single viewer as a single session.
-
#weight ⇒ Numeric
readonly
The percentage of traffic to send to a staging distribution, expressed as a decimal number between 0 and 0.15.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(weight:, session_stickiness_config: nil) ⇒ SingleWeightConfigProperty
constructor
A new instance of SingleWeightConfigProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(weight:, session_stickiness_config: nil) ⇒ SingleWeightConfigProperty
Returns a new instance of SingleWeightConfigProperty.
749 750 751 752 753 754 |
# File 'cloud_front/cfn_continuous_deployment_policy.rb', line 749 def initialize(weight:, session_stickiness_config: nil) @weight = weight Jsii::Type.check_type(@weight, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "weight") @session_stickiness_config = session_stickiness_config.is_a?(Hash) ? ::AWSCDK::CloudFront::CfnContinuousDeploymentPolicy::SessionStickinessConfigProperty.new(**session_stickiness_config.transform_keys(&:to_sym)) : session_stickiness_config Jsii::Type.check_type(@session_stickiness_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZGZyb250LkNmbkNvbnRpbnVvdXNEZXBsb3ltZW50UG9saWN5LlNlc3Npb25TdGlja2luZXNzQ29uZmlnUHJvcGVydHkifV19fQ==")), "sessionStickinessConfig") unless @session_stickiness_config.nil? end |
Instance Attribute Details
#session_stickiness_config ⇒ AWSCDK::IResolvable, ... (readonly)
Session stickiness provides the ability to define multiple requests from a single viewer as a single session.
This prevents the potentially inconsistent experience of sending some of a given user's requests to your staging distribution, while others are sent to your primary distribution. Define the session duration using TTL values.
767 768 769 |
# File 'cloud_front/cfn_continuous_deployment_policy.rb', line 767 def session_stickiness_config @session_stickiness_config end |
#weight ⇒ Numeric (readonly)
The percentage of traffic to send to a staging distribution, expressed as a decimal number between 0 and 0.15. For example, a value of 0.10 means 10% of traffic is sent to the staging distribution.
760 761 762 |
# File 'cloud_front/cfn_continuous_deployment_policy.rb', line 760 def weight @weight end |
Class Method Details
.jsii_properties ⇒ Object
769 770 771 772 773 774 |
# File 'cloud_front/cfn_continuous_deployment_policy.rb', line 769 def self.jsii_properties { :weight => "weight", :session_stickiness_config => "sessionStickinessConfig", } end |
Instance Method Details
#to_jsii ⇒ Object
776 777 778 779 780 781 782 783 |
# File 'cloud_front/cfn_continuous_deployment_policy.rb', line 776 def to_jsii result = {} result.merge!({ "weight" => @weight, "sessionStickinessConfig" => @session_stickiness_config, }) result.compact end |