Class: AWSCDK::ElasticLoadBalancingv2::CfnListenerRule::RuleConditionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
elastic_load_balancingv2/cfn_listener_rule.rb

Overview

Specifies a condition for a listener rule.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field: nil, host_header_config: nil, http_header_config: nil, http_request_method_config: nil, path_pattern_config: nil, query_string_config: nil, regex_values: nil, source_ip_config: nil, values: nil) ⇒ RuleConditionProperty

Returns a new instance of RuleConditionProperty.

Parameters:



1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1638

def initialize(field: nil, host_header_config: nil, http_header_config: nil, http_request_method_config: nil, path_pattern_config: nil, query_string_config: nil, regex_values: nil, source_ip_config: nil, values: nil)
  @field = field
  Jsii::Type.check_type(@field, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "field") unless @field.nil?
  @host_header_config = host_header_config.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::CfnListenerRule::HostHeaderConfigProperty.new(**host_header_config.transform_keys(&:to_sym)) : host_header_config
  Jsii::Type.check_type(@host_header_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLkNmbkxpc3RlbmVyUnVsZS5Ib3N0SGVhZGVyQ29uZmlnUHJvcGVydHkifV19fQ==")), "hostHeaderConfig") unless @host_header_config.nil?
  @http_header_config = http_header_config.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::CfnListenerRule::HttpHeaderConfigProperty.new(**http_header_config.transform_keys(&:to_sym)) : http_header_config
  Jsii::Type.check_type(@http_header_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLkNmbkxpc3RlbmVyUnVsZS5IdHRwSGVhZGVyQ29uZmlnUHJvcGVydHkifV19fQ==")), "httpHeaderConfig") unless @http_header_config.nil?
  @http_request_method_config = http_request_method_config.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::CfnListenerRule::HttpRequestMethodConfigProperty.new(**http_request_method_config.transform_keys(&:to_sym)) : http_request_method_config
  Jsii::Type.check_type(@http_request_method_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLkNmbkxpc3RlbmVyUnVsZS5IdHRwUmVxdWVzdE1ldGhvZENvbmZpZ1Byb3BlcnR5In1dfX0=")), "httpRequestMethodConfig") unless @http_request_method_config.nil?
  @path_pattern_config = path_pattern_config.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::CfnListenerRule::PathPatternConfigProperty.new(**path_pattern_config.transform_keys(&:to_sym)) : path_pattern_config
  Jsii::Type.check_type(@path_pattern_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLkNmbkxpc3RlbmVyUnVsZS5QYXRoUGF0dGVybkNvbmZpZ1Byb3BlcnR5In1dfX0=")), "pathPatternConfig") unless @path_pattern_config.nil?
  @query_string_config = query_string_config.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::CfnListenerRule::QueryStringConfigProperty.new(**query_string_config.transform_keys(&:to_sym)) : query_string_config
  Jsii::Type.check_type(@query_string_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLkNmbkxpc3RlbmVyUnVsZS5RdWVyeVN0cmluZ0NvbmZpZ1Byb3BlcnR5In1dfX0=")), "queryStringConfig") unless @query_string_config.nil?
  @regex_values = regex_values
  Jsii::Type.check_type(@regex_values, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "regexValues") unless @regex_values.nil?
  @source_ip_config = source_ip_config.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::CfnListenerRule::SourceIPConfigProperty.new(**source_ip_config.transform_keys(&:to_sym)) : source_ip_config
  Jsii::Type.check_type(@source_ip_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLkNmbkxpc3RlbmVyUnVsZS5Tb3VyY2VJcENvbmZpZ1Byb3BlcnR5In1dfX0=")), "sourceIpConfig") unless @source_ip_config.nil?
  @values = values
  Jsii::Type.check_type(@values, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "values") unless @values.nil?
end

Instance Attribute Details

#fieldString? (readonly)

The field in the HTTP request. The following are the possible values:.

  • http-header
  • http-request-method
  • host-header
  • path-pattern
  • query-string
  • source-ip


1670
1671
1672
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1670

def field
  @field
end

#host_header_configAWSCDK::IResolvable, ... (readonly)

Information for a host header condition.

Specify only when Field is host-header .



1677
1678
1679
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1677

def host_header_config
  @host_header_config
end

#http_header_configAWSCDK::IResolvable, ... (readonly)

Information for an HTTP header condition.

Specify only when Field is http-header .



1684
1685
1686
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1684

def http_header_config
  @http_header_config
end

#http_request_method_configAWSCDK::IResolvable, ... (readonly)

Information for an HTTP method condition.

Specify only when Field is http-request-method .



1691
1692
1693
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1691

def http_request_method_config
  @http_request_method_config
end

#path_pattern_configAWSCDK::IResolvable, ... (readonly)

Information for a path pattern condition.

Specify only when Field is path-pattern .



1698
1699
1700
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1698

def path_pattern_config
  @path_pattern_config
end

#query_string_configAWSCDK::IResolvable, ... (readonly)

Information for a query string condition.

Specify only when Field is query-string .



1705
1706
1707
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1705

def query_string_config
  @query_string_config
end

#regex_valuesArray<String>? (readonly)

The regular expressions to match against the condition field.

The maximum length of each string is 128 characters. Specify only when Field is http-header , host-header , or path-pattern .



1712
1713
1714
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1712

def regex_values
  @regex_values
end

#source_ip_configAWSCDK::IResolvable, ... (readonly)

Information for a source IP condition.

Specify only when Field is source-ip .



1719
1720
1721
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1719

def source_ip_config
  @source_ip_config
end

#valuesArray<String>? (readonly)

The condition value.

Specify only when Field is host-header or path-pattern . Alternatively, to specify multiple host names or multiple path patterns, use HostHeaderConfig or PathPatternConfig .

If Field is host-header and you're not using HostHeaderConfig , you can specify a single host name (for example, my.example.com). A host name is case insensitive, can be up to 128 characters in length, and can contain any of the following characters.

  • A-Z, a-z, 0-9
  • * .
  • * (matches 0 or more characters)
  • ? (matches exactly 1 character)

If Field is path-pattern and you're not using PathPatternConfig , you can specify a single path pattern (for example, /img/*). A path pattern is case-sensitive, can be up to 128 characters in length, and can contain any of the following characters.

  • A-Z, a-z, 0-9
  • _ - . $ / ~ " ' @ : +
  • & (using &)
  • * (matches 0 or more characters)
  • ? (matches exactly 1 character)


1741
1742
1743
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1741

def values
  @values
end

Class Method Details

.jsii_propertiesObject



1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1743

def self.jsii_properties
  {
    :field => "field",
    :host_header_config => "hostHeaderConfig",
    :http_header_config => "httpHeaderConfig",
    :http_request_method_config => "httpRequestMethodConfig",
    :path_pattern_config => "pathPatternConfig",
    :query_string_config => "queryStringConfig",
    :regex_values => "regexValues",
    :source_ip_config => "sourceIpConfig",
    :values => "values",
  }
end

Instance Method Details

#to_jsiiObject



1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
# File 'elastic_load_balancingv2/cfn_listener_rule.rb', line 1757

def to_jsii
  result = {}
  result.merge!({
    "field" => @field,
    "hostHeaderConfig" => @host_header_config,
    "httpHeaderConfig" => @http_header_config,
    "httpRequestMethodConfig" => @http_request_method_config,
    "pathPatternConfig" => @path_pattern_config,
    "queryStringConfig" => @query_string_config,
    "regexValues" => @regex_values,
    "sourceIpConfig" => @source_ip_config,
    "values" => @values,
  })
  result.compact
end