Module: AWSCDK::ElasticLoadBalancingv2::IApplicationListener
- Includes:
- AWSCDK::EC2::IConnectable, IApplicationListenerRef, IListener
- Included in:
- ApplicationListener
- Defined in:
- elastic_load_balancingv2/i_application_listener.rb
Overview
Properties to reference an existing listener.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_action(id, props) ⇒ void
Perform the given action on incoming requests.
-
#add_certificates(id, certificates) ⇒ void
Add one or more certificates to this listener.
-
#add_target_groups(id, props) ⇒ void
Load balance incoming requests to the given target groups.
-
#add_targets(id, props) ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationTargetGroup
Load balance incoming requests to the given load balancing targets.
-
#apply_removal_policy(policy) ⇒ void
Apply the given removal policy to this resource.
-
#connections ⇒ AWSCDK::EC2::Connections
The network connections associated with this resource.
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
-
#is_application_listener ⇒ Boolean
Indicates that this is an ALB listener.
-
#listener_arn ⇒ String
ARN of the listener.
-
#listener_ref ⇒ AWSCDK::Interfaces::AWSElasticloadbalancingv2::ListenerReference
A reference to a Listener resource.
-
#node ⇒ Constructs::Node
The tree node.
-
#register_connectable(connectable, port_range) ⇒ void
Register that a connectable that has been added to this load balancer.
-
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Class Method Details
.jsii_overridable_methods ⇒ Object
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 180 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 }, :listener_ref => { kind: :property, name: "listenerRef", is_optional: false }, :listener_arn => { kind: :property, name: "listenerArn", is_optional: false }, :connections => { kind: :property, name: "connections", is_optional: false }, :is_application_listener => { kind: :property, name: "isApplicationListener", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false }, :add_action => { kind: :method, name: "addAction", is_optional: false }, :add_certificates => { kind: :method, name: "addCertificates", is_optional: false }, :add_target_groups => { kind: :method, name: "addTargetGroups", is_optional: false }, :add_targets => { kind: :method, name: "addTargets", is_optional: false }, :register_connectable => { kind: :method, name: "registerConnectable", is_optional: false }, } end |
Instance Method Details
#add_action(id, props) ⇒ void
This method returns an undefined value.
Perform the given action on incoming requests.
This allows full control of the default action of the load balancer,
including Action chaining, fixed responses and redirect responses. See
the ListenerAction class for all options.
It's possible to add routing conditions to the Action added in this way.
It is not possible to add a default action to an imported IApplicationListener.
In order to add actions to an imported IApplicationListener a priority
must be provided.
116 117 118 119 120 121 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 116 def add_action(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::AddApplicationActionProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5BZGRBcHBsaWNhdGlvbkFjdGlvblByb3BzIn0=")), "props") jsii_call_method("addAction", [id, props]) end |
#add_certificates(id, certificates) ⇒ void
This method returns an undefined value.
Add one or more certificates to this listener.
128 129 130 131 132 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 128 def add_certificates(id, certificates) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") Jsii::Type.check_type(certificates, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lbGFzdGljbG9hZGJhbGFuY2luZ3YyLklMaXN0ZW5lckNlcnRpZmljYXRlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "certificates") jsii_call_method("addCertificates", [id, certificates]) end |
#add_target_groups(id, props) ⇒ void
This method returns an undefined value.
Load balance incoming requests to the given target groups.
It's possible to add conditions to the TargetGroups added in this way. At least one TargetGroup must be added without conditions.
142 143 144 145 146 147 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 142 def add_target_groups(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::AddApplicationTargetGroupsProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5BZGRBcHBsaWNhdGlvblRhcmdldEdyb3Vwc1Byb3BzIn0=")), "props") jsii_call_method("addTargetGroups", [id, props]) end |
#add_targets(id, props) ⇒ AWSCDK::ElasticLoadBalancingv2::ApplicationTargetGroup
Load balance incoming requests to the given load balancing targets.
This method implicitly creates an ApplicationTargetGroup for the targets involved.
It's possible to add conditions to the targets added in this way. At least one set of targets must be added without conditions.
160 161 162 163 164 165 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 160 def add_targets(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::ElasticLoadBalancingv2::AddApplicationTargetsProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5BZGRBcHBsaWNhdGlvblRhcmdldHNQcm9wcyJ9")), "props") jsii_call_method("addTargets", [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).
96 97 98 99 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 96 def apply_removal_policy(policy) Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy") jsii_call_method("applyRemovalPolicy", [policy]) end |
#connections ⇒ AWSCDK::EC2::Connections
The network connections associated with this resource.
56 57 58 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 56 def connections() jsii_get_property("connections") end |
#env ⇒ AWSCDK::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_listener.rb', line 28 def env() jsii_get_property("env") end |
#is_application_listener ⇒ Boolean
Indicates that this is an ALB listener.
Will always return true, but is necessary to prevent accidental structural equality in TypeScript.
66 67 68 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 66 def is_application_listener() jsii_get_property("isApplicationListener") end |
#listener_arn ⇒ String
ARN of the listener.
49 50 51 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 49 def listener_arn() jsii_get_property("listenerArn") end |
#listener_ref ⇒ AWSCDK::Interfaces::AWSElasticloadbalancingv2::ListenerReference
A reference to a Listener resource.
42 43 44 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 42 def listener_ref() jsii_get_property("listenerRef") end |
#node ⇒ Constructs::Node
The tree node.
13 14 15 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 13 def node() jsii_get_property("node") end |
#register_connectable(connectable, port_range) ⇒ void
This method returns an undefined value.
Register that a connectable that has been added to this load balancer.
Don't call this directly. It is called by ApplicationTargetGroup.
174 175 176 177 178 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 174 def register_connectable(connectable, port_range) Jsii::Type.check_type(connectable, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklDb25uZWN0YWJsZSJ9")), "connectable") Jsii::Type.check_type(port_range, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlBvcnQifQ==")), "portRange") jsii_call_method("registerConnectable", [connectable, port_range]) end |
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
35 36 37 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 35 def stack() jsii_get_property("stack") 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.
77 78 79 80 81 82 |
# File 'elastic_load_balancingv2/i_application_listener.rb', line 77 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 |