Class: AWSCDK::ECS::ECSTarget
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECS::ECSTarget
- Defined in:
- ecs/ecs_target.rb
Instance Attribute Summary collapse
-
#container_name ⇒ String
readonly
The name of the container.
-
#container_port ⇒ Numeric?
readonly
The port number of the container.
-
#listener ⇒ AWSCDK::ECS::ListenerConfig
readonly
Listener and properties for adding target group to the listener.
-
#new_target_group_id ⇒ String
readonly
ID for a target group to be created.
-
#protocol ⇒ AWSCDK::ECS::Protocol?
readonly
The protocol used for the port mapping.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(container_name:, listener:, new_target_group_id:, container_port: nil, protocol: nil) ⇒ ECSTarget
constructor
A new instance of ECSTarget.
- #to_jsii ⇒ Object
Constructor Details
#initialize(container_name:, listener:, new_target_group_id:, container_port: nil, protocol: nil) ⇒ ECSTarget
Returns a new instance of ECSTarget.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'ecs/ecs_target.rb', line 11 def initialize(container_name:, listener:, new_target_group_id:, container_port: nil, protocol: nil) @container_name = container_name Jsii::Type.check_type(@container_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerName") @listener = listener Jsii::Type.check_type(@listener, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkxpc3RlbmVyQ29uZmlnIn0=")), "listener") @new_target_group_id = new_target_group_id Jsii::Type.check_type(@new_target_group_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "newTargetGroupId") @container_port = container_port Jsii::Type.check_type(@container_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "containerPort") unless @container_port.nil? @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlByb3RvY29sIn0=")), "protocol") unless @protocol.nil? end |
Instance Attribute Details
#container_name ⇒ String (readonly)
The name of the container.
27 28 29 |
# File 'ecs/ecs_target.rb', line 27 def container_name @container_name end |
#container_port ⇒ Numeric? (readonly)
Note:
Default: - Container port of the first added port mapping.
The port number of the container.
Only applicable when using application/network load balancers.
42 43 44 |
# File 'ecs/ecs_target.rb', line 42 def container_port @container_port end |
#listener ⇒ AWSCDK::ECS::ListenerConfig (readonly)
Listener and properties for adding target group to the listener.
31 32 33 |
# File 'ecs/ecs_target.rb', line 31 def listener @listener end |
#new_target_group_id ⇒ String (readonly)
ID for a target group to be created.
35 36 37 |
# File 'ecs/ecs_target.rb', line 35 def new_target_group_id @new_target_group_id end |
#protocol ⇒ AWSCDK::ECS::Protocol? (readonly)
Note:
Default: Protocol.TCP
The protocol used for the port mapping.
Only applicable when using application load balancers.
49 50 51 |
# File 'ecs/ecs_target.rb', line 49 def protocol @protocol end |
Class Method Details
.jsii_properties ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'ecs/ecs_target.rb', line 51 def self.jsii_properties { :container_name => "containerName", :listener => "listener", :new_target_group_id => "newTargetGroupId", :container_port => "containerPort", :protocol => "protocol", } end |
Instance Method Details
#to_jsii ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 |
# File 'ecs/ecs_target.rb', line 61 def to_jsii result = {} result.merge!({ "containerName" => @container_name, "listener" => @listener, "newTargetGroupId" => @new_target_group_id, "containerPort" => @container_port, "protocol" => @protocol, }) result.compact end |