Class: AWSCDK::ElasticLoadBalancing::LoadBalancerProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ElasticLoadBalancing::LoadBalancerProps
- Defined in:
- elastic_load_balancing/load_balancer_props.rb
Overview
Construction properties for a LoadBalancer.
Instance Attribute Summary collapse
-
#access_logging_policy ⇒ AWSCDK::ElasticLoadBalancing::CfnLoadBalancer::AccessLoggingPolicyProperty?
readonly
Enable Loadbalancer access logs Can be used to avoid manual work as aws console Required S3 bucket name , enabled flag Can add interval for pushing log Can set bucket prefix in order to provide folder name inside bucket.
-
#cross_zone ⇒ Boolean?
readonly
Whether cross zone load balancing is enabled.
-
#health_check ⇒ AWSCDK::ElasticLoadBalancing::HealthCheck?
readonly
Health check settings for the load balancing targets.
-
#internet_facing ⇒ Boolean?
readonly
Whether this is an internet-facing Load Balancer.
-
#listeners ⇒ Array<AWSCDK::ElasticLoadBalancing::LoadBalancerListener>?
readonly
What listeners to set up for the load balancer.
-
#subnet_selection ⇒ AWSCDK::EC2::SubnetSelection?
readonly
Which subnets to deploy the load balancer.
-
#targets ⇒ Array<AWSCDK::ElasticLoadBalancing::ILoadBalancerTarget>?
readonly
What targets to load balance to.
-
#vpc ⇒ AWSCDK::EC2::IVPC
readonly
VPC network of the fleet instances.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(vpc:, access_logging_policy: nil, cross_zone: nil, health_check: nil, internet_facing: nil, listeners: nil, subnet_selection: nil, targets: nil) ⇒ LoadBalancerProps
constructor
A new instance of LoadBalancerProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(vpc:, access_logging_policy: nil, cross_zone: nil, health_check: nil, internet_facing: nil, listeners: nil, subnet_selection: nil, targets: nil) ⇒ LoadBalancerProps
Returns a new instance of LoadBalancerProps.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 15 def initialize(vpc:, access_logging_policy: nil, cross_zone: nil, health_check: nil, internet_facing: nil, listeners: nil, subnet_selection: nil, targets: nil) @vpc = vpc Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc") @access_logging_policy = access_logging_policy.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancing::CfnLoadBalancer::AccessLoggingPolicyProperty.new(**access_logging_policy.transform_keys(&:to_sym)) : access_logging_policy Jsii::Type.check_type(@access_logging_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmcuQ2ZuTG9hZEJhbGFuY2VyLkFjY2Vzc0xvZ2dpbmdQb2xpY3lQcm9wZXJ0eSJ9")), "accessLoggingPolicy") unless @access_logging_policy.nil? @cross_zone = cross_zone Jsii::Type.check_type(@cross_zone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "crossZone") unless @cross_zone.nil? @health_check = health_check.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancing::HealthCheck.new(**health_check.transform_keys(&:to_sym)) : health_check Jsii::Type.check_type(@health_check, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmcuSGVhbHRoQ2hlY2sifQ==")), "healthCheck") unless @health_check.nil? @internet_facing = internet_facing Jsii::Type.check_type(@internet_facing, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "internetFacing") unless @internet_facing.nil? @listeners = listeners.is_a?(Array) ? listeners.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancing::LoadBalancerListener.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : listeners Jsii::Type.check_type(@listeners, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZy5Mb2FkQmFsYW5jZXJMaXN0ZW5lciJ9LCJraW5kIjoiYXJyYXkifX0=")), "listeners") unless @listeners.nil? @subnet_selection = subnet_selection.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**subnet_selection.transform_keys(&:to_sym)) : subnet_selection Jsii::Type.check_type(@subnet_selection, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "subnetSelection") unless @subnet_selection.nil? @targets = targets Jsii::Type.check_type(@targets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZy5JTG9hZEJhbGFuY2VyVGFyZ2V0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "targets") unless @targets.nil? end |
Instance Attribute Details
#access_logging_policy ⇒ AWSCDK::ElasticLoadBalancing::CfnLoadBalancer::AccessLoggingPolicyProperty? (readonly)
Default: - disabled
Enable Loadbalancer access logs Can be used to avoid manual work as aws console Required S3 bucket name , enabled flag Can add interval for pushing log Can set bucket prefix in order to provide folder name inside bucket.
42 43 44 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 42 def access_logging_policy @access_logging_policy end |
#cross_zone ⇒ Boolean? (readonly)
Default: true
Whether cross zone load balancing is enabled.
This controls whether the load balancer evenly distributes requests across each availability zone
50 51 52 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 50 def cross_zone @cross_zone end |
#health_check ⇒ AWSCDK::ElasticLoadBalancing::HealthCheck? (readonly)
Default: - None.
Health check settings for the load balancing targets.
Not required but recommended.
57 58 59 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 57 def health_check @health_check end |
#internet_facing ⇒ Boolean? (readonly)
Default: false
Whether this is an internet-facing Load Balancer.
This controls whether the LB has a public IP address assigned. It does not open up the Load Balancer's security groups to public internet access.
65 66 67 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 65 def internet_facing @internet_facing end |
#listeners ⇒ Array<AWSCDK::ElasticLoadBalancing::LoadBalancerListener>? (readonly)
Default: -
What listeners to set up for the load balancer.
Can also be added by .addListener()
72 73 74 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 72 def listeners @listeners end |
#subnet_selection ⇒ AWSCDK::EC2::SubnetSelection? (readonly)
Default: - Public subnets if internetFacing, Private subnets otherwise
Which subnets to deploy the load balancer.
Can be used to define a specific set of subnets to deploy the load balancer to. Useful multiple public or private subnets are covering the same availability zone.
80 81 82 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 80 def subnet_selection @subnet_selection end |
#targets ⇒ Array<AWSCDK::ElasticLoadBalancing::ILoadBalancerTarget>? (readonly)
Default: - None.
What targets to load balance to.
Can also be added by .addTarget()
87 88 89 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 87 def targets @targets end |
#vpc ⇒ AWSCDK::EC2::IVPC (readonly)
VPC network of the fleet instances.
37 38 39 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 37 def vpc @vpc end |
Class Method Details
.jsii_properties ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 89 def self.jsii_properties { :vpc => "vpc", :access_logging_policy => "accessLoggingPolicy", :cross_zone => "crossZone", :health_check => "healthCheck", :internet_facing => "internetFacing", :listeners => "listeners", :subnet_selection => "subnetSelection", :targets => "targets", } end |
Instance Method Details
#to_jsii ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'elastic_load_balancing/load_balancer_props.rb', line 102 def to_jsii result = {} result.merge!({ "vpc" => @vpc, "accessLoggingPolicy" => @access_logging_policy, "crossZone" => @cross_zone, "healthCheck" => @health_check, "internetFacing" => @internet_facing, "listeners" => @listeners, "subnetSelection" => @subnet_selection, "targets" => @targets, }) result.compact end |