Class: AWSCDK::ECS::CfnTaskDefinition::HostEntryProperty

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

Overview

The HostEntry property specifies a hostname and an IP address that are added to the /etc/hosts file of a container through the extraHosts parameter of its ContainerDefinition resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostname: nil, ip_address: nil) ⇒ HostEntryProperty

Returns a new instance of HostEntryProperty.

Parameters:

  • hostname (String, nil) (defaults to: nil)

    The hostname to use in the /etc/hosts entry.

  • ip_address (String, nil) (defaults to: nil)

    The IP address to use in the /etc/hosts entry.



2117
2118
2119
2120
2121
2122
# File 'ecs/cfn_task_definition.rb', line 2117

def initialize(hostname: nil, ip_address: nil)
  @hostname = hostname
  Jsii::Type.check_type(@hostname, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "hostname") unless @hostname.nil?
  @ip_address = ip_address
  Jsii::Type.check_type(@ip_address, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ipAddress") unless @ip_address.nil?
end

Instance Attribute Details

#hostnameString? (readonly)

The hostname to use in the /etc/hosts entry.



2128
2129
2130
# File 'ecs/cfn_task_definition.rb', line 2128

def hostname
  @hostname
end

#ip_addressString? (readonly)

The IP address to use in the /etc/hosts entry.



2133
2134
2135
# File 'ecs/cfn_task_definition.rb', line 2133

def ip_address
  @ip_address
end

Class Method Details

.jsii_propertiesObject



2135
2136
2137
2138
2139
2140
# File 'ecs/cfn_task_definition.rb', line 2135

def self.jsii_properties
  {
    :hostname => "hostname",
    :ip_address => "ipAddress",
  }
end

Instance Method Details

#to_jsiiObject



2142
2143
2144
2145
2146
2147
2148
2149
# File 'ecs/cfn_task_definition.rb', line 2142

def to_jsii
  result = {}
  result.merge!({
    "hostname" => @hostname,
    "ipAddress" => @ip_address,
  })
  result.compact
end