Class: AWSCDK::ECS::PortMap

Inherits:
Jsii::Object
  • Object
show all
Defined in:
ecs/port_map.rb

Overview

PortMap ValueObjectClass having by ContainerDefinition.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(networkmode, pm) ⇒ PortMap

Returns a new instance of PortMap.

Parameters:



10
11
12
13
14
15
# File 'ecs/port_map.rb', line 10

def initialize(networkmode, pm)
  pm = pm.is_a?(Hash) ? ::AWSCDK::ECS::PortMapping.new(**pm.transform_keys(&:to_sym)) : pm
  Jsii::Type.check_type(networkmode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLk5ldHdvcmtNb2RlIn0=")), "networkmode")
  Jsii::Type.check_type(pm, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlBvcnRNYXBwaW5nIn0=")), "pm")
  Jsii::Object.instance_method(:initialize).bind(self).call(networkmode, pm)
end

Class Method Details

.jsii_overridable_methodsObject



17
18
19
20
21
22
23
# File 'ecs/port_map.rb', line 17

def self.jsii_overridable_methods
  {
    :networkmode => { kind: :property, name: "networkmode", is_optional: false },
    :portmapping => { kind: :property, name: "portmapping", is_optional: false },
    :validate => { kind: :method, name: "validate", is_optional: false },
  }
end

Instance Method Details

#networkmodeAWSCDK::ECS::NetworkMode

The networking mode to use for the containers in the task.



28
29
30
# File 'ecs/port_map.rb', line 28

def networkmode()
  jsii_get_property("networkmode")
end

#portmappingAWSCDK::ECS::PortMapping

Port mappings allow containers to access ports on the host container instance to send or receive traffic.



35
36
37
# File 'ecs/port_map.rb', line 35

def portmapping()
  jsii_get_property("portmapping")
end

#validatevoid

This method returns an undefined value.

validate invalid portmapping and networkmode parameters.

throw Error when invalid parameters.



44
45
46
# File 'ecs/port_map.rb', line 44

def validate()
  jsii_call_method("validate", [])
end