Class: AWSCDK::CloudFront::CfnContinuousDeploymentPolicy::SingleWeightPolicyConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_front/cfn_continuous_deployment_policy.rb

Overview

Configure a policy that CloudFront uses to route requests to different origins or use different cache settings, based on the weight assigned to each option.

This property is legacy. We recommend that you use TrafficConfig and specify the SingleWeightConfig property instead.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(weight:, session_stickiness_config: nil) ⇒ SingleWeightPolicyConfigProperty

Returns a new instance of SingleWeightPolicyConfigProperty.

Parameters:



796
797
798
799
800
801
# File 'cloud_front/cfn_continuous_deployment_policy.rb', line 796

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_configAWSCDK::IResolvable, ... (readonly)

Enable session stickiness for the associated origin or cache settings.



812
813
814
# File 'cloud_front/cfn_continuous_deployment_policy.rb', line 812

def session_stickiness_config
  @session_stickiness_config
end

#weightNumeric (readonly)

The percentage of requests that CloudFront will use to send to an associated origin or cache settings.



807
808
809
# File 'cloud_front/cfn_continuous_deployment_policy.rb', line 807

def weight
  @weight
end

Class Method Details

.jsii_propertiesObject



814
815
816
817
818
819
# File 'cloud_front/cfn_continuous_deployment_policy.rb', line 814

def self.jsii_properties
  {
    :weight => "weight",
    :session_stickiness_config => "sessionStickinessConfig",
  }
end

Instance Method Details

#to_jsiiObject



821
822
823
824
825
826
827
828
# File 'cloud_front/cfn_continuous_deployment_policy.rb', line 821

def to_jsii
  result = {}
  result.merge!({
    "weight" => @weight,
    "sessionStickinessConfig" => @session_stickiness_config,
  })
  result.compact
end