Module: AWSCDK::ElasticLoadBalancingv2::IApplicationLoadBalancer

Includes:
AWSCDK::EC2::IConnectable, IApplicationLoadBalancerRef, ILoadBalancerV2
Included in:
ApplicationLoadBalancer
Defined in:
elastic_load_balancingv2/i_application_load_balancer.rb

Overview

An application load balancer.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 174

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :load_balancer_ref => { kind: :property, name: "loadBalancerRef", is_optional: false },
    :load_balancer_canonical_hosted_zone_id => { kind: :property, name: "loadBalancerCanonicalHostedZoneId", is_optional: false },
    :load_balancer_dns_name => { kind: :property, name: "loadBalancerDnsName", is_optional: false },
    :connections => { kind: :property, name: "connections", is_optional: false },
    :is_application_load_balancer => { kind: :property, name: "isApplicationLoadBalancer", is_optional: false },
    :listeners => { kind: :property, name: "listeners", is_optional: false },
    :load_balancer_arn => { kind: :property, name: "loadBalancerArn", is_optional: false },
    :metrics => { kind: :property, name: "metrics", is_optional: false },
    :ip_address_type => { kind: :property, name: "ipAddressType", is_optional: true },
    :vpc => { kind: :property, name: "vpc", is_optional: true },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :add_listener => { kind: :method, name: "addListener", is_optional: false },
  }
end

Instance Method Details

#add_listener(id, props) ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationListener

Add a new listener to this load balancer.



167
168
169
170
171
172
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 167

def add_listener(id, props)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  props = props.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::BaseApplicationListenerProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5CYXNlQXBwbGljYXRpb25MaXN0ZW5lclByb3BzIn0=")), "props")
  jsii_call_method("addListener", [id, props])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



157
158
159
160
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 157

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#connectionsAWSCDK::EC2::Connections

The network connections associated with this resource.



67
68
69
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 67

def connections()
  jsii_get_property("connections")
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



28
29
30
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 28

def env()
  jsii_get_property("env")
end

#ip_address_typeAWSCDK::ElasticLoadBalancingv2::IPAddressType?

Note:

Default: IpAddressType.IPV4

The IP Address Type for this load balancer.

If the @aws-cdk/aws-elasticloadbalancingV2:albDualstackWithoutPublicIpv4SecurityGroupRulesDefault feature flag is set (the default for new projects), and add_listener() is called with open: true, the load balancer's security group will automatically include both IPv4 and IPv6 ingress rules when using IpAddressType.DUAL_STACK_WITHOUT_PUBLIC_IPV4.

For existing projects that only have IPv4 rules, you can opt-in to IPv6 ingress rules by enabling the feature flag in your cdk.json file. Note that enabling this feature flag will modify existing security group rules.



117
118
119
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 117

def ip_address_type()
  jsii_get_property("ipAddressType")
end

#is_application_load_balancerBoolean

Indicates that this is an Application Load Balancer.

Will always return true, but is necessary to prevent accidental structural equality in TypeScript.

Returns:

  • (Boolean)


77
78
79
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 77

def is_application_load_balancer()
  jsii_get_property("isApplicationLoadBalancer")
end

#listenersArray<AWSCDK::ElasticLoadBalancingv2::ApplicationListener>

A list of listeners that have been added to the load balancer.

This list is only valid for owned constructs.



86
87
88
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 86

def listeners()
  jsii_get_property("listeners")
end

#load_balancer_arnString

The ARN of this load balancer.

Returns:

  • (String)


93
94
95
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 93

def load_balancer_arn()
  jsii_get_property("loadBalancerArn")
end

#load_balancer_canonical_hosted_zone_idString

The canonical hosted zone ID of this load balancer.

Example value: Z2P70J7EXAMPLE

Returns:

  • (String)


51
52
53
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 51

def load_balancer_canonical_hosted_zone_id()
  jsii_get_property("loadBalancerCanonicalHostedZoneId")
end

#load_balancer_dns_nameString

The DNS name of this load balancer.

Example value: my-load-balancer-424835706.us-west-2.elb.amazonaws.com

Returns:

  • (String)


60
61
62
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 60

def load_balancer_dns_name()
  jsii_get_property("loadBalancerDnsName")
end

#load_balancer_refAWSCDK::Interfaces::AWSElasticloadbalancingv2::LoadBalancerReference

A reference to a LoadBalancer resource.



42
43
44
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 42

def load_balancer_ref()
  jsii_get_property("loadBalancerRef")
end

#metricsAWSCDK::ElasticLoadBalancingv2::IApplicationLoadBalancerMetrics

All metrics available for this load balancer.



100
101
102
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 100

def metrics()
  jsii_get_property("metrics")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


13
14
15
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 13

def node()
  jsii_get_property("node")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



35
36
37
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 35

def stack()
  jsii_get_property("stack")
end

#vpcAWSCDK::EC2::IVPC?

The VPC this load balancer has been created in (if available).

If this interface is the result of an import call to fromApplicationLoadBalancerAttributes, the vpc attribute will be undefined unless specified in the optional properties of that method.

Returns:



127
128
129
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 127

def vpc()
  jsii_get_property("vpc")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



138
139
140
141
142
143
# File 'elastic_load_balancingv2/i_application_load_balancer.rb', line 138

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end