Class: AWSCDK::ServiceDiscovery::IPInstanceBaseProps

Inherits:
BaseInstanceProps
  • Object
show all
Defined in:
service_discovery/ip_instance_base_props.rb

Direct Known Subclasses

IPInstanceProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(custom_attributes: nil, instance_id: nil, ipv4: nil, ipv6: nil, port: nil) ⇒ IPInstanceBaseProps

Returns a new instance of IPInstanceBaseProps.

Parameters:

  • custom_attributes (Hash{String => String}, nil) (defaults to: nil)

    Custom attributes of the instance.

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

    The id of the instance resource.

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

    If the service that you specify contains a template for an A record, the IPv4 address that you want AWS Cloud Map to use for the value of the A record.

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

    If the service that you specify contains a template for an AAAA record, the IPv6 address that you want AWS Cloud Map to use for the value of the AAAA record.

  • port (Numeric, nil) (defaults to: nil)

    The port on the endpoint that you want AWS Cloud Map to perform health checks on.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'service_discovery/ip_instance_base_props.rb', line 11

def initialize(custom_attributes: nil, instance_id: nil, ipv4: nil, ipv6: nil, port: nil)
  @custom_attributes = custom_attributes
  Jsii::Type.check_type(@custom_attributes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "customAttributes") unless @custom_attributes.nil?
  @instance_id = instance_id
  Jsii::Type.check_type(@instance_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceId") unless @instance_id.nil?
  @ipv4 = ipv4
  Jsii::Type.check_type(@ipv4, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ipv4") unless @ipv4.nil?
  @ipv6 = ipv6
  Jsii::Type.check_type(@ipv6, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ipv6") unless @ipv6.nil?
  @port = port
  Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port") unless @port.nil?
end

Instance Attribute Details

#custom_attributesHash{String => String}? (readonly)

Note:

Default: none

Custom attributes of the instance.

Returns:

  • (Hash{String => String}, nil)


28
29
30
# File 'service_discovery/ip_instance_base_props.rb', line 28

def custom_attributes
  @custom_attributes
end

#instance_idString? (readonly)

Note:

Default: Automatically generated name

The id of the instance resource.

Returns:

  • (String, nil)


33
34
35
# File 'service_discovery/ip_instance_base_props.rb', line 33

def instance_id
  @instance_id
end

#ipv4String? (readonly)

Note:

Default: none

If the service that you specify contains a template for an A record, the IPv4 address that you want AWS Cloud Map to use for the value of the A record.

Returns:

  • (String, nil)


38
39
40
# File 'service_discovery/ip_instance_base_props.rb', line 38

def ipv4
  @ipv4
end

#ipv6String? (readonly)

Note:

Default: none

If the service that you specify contains a template for an AAAA record, the IPv6 address that you want AWS Cloud Map to use for the value of the AAAA record.

Returns:

  • (String, nil)


43
44
45
# File 'service_discovery/ip_instance_base_props.rb', line 43

def ipv6
  @ipv6
end

#portNumeric? (readonly)

Note:

Default: 80

The port on the endpoint that you want AWS Cloud Map to perform health checks on.

This value is also used for the port value in an SRV record if the service that you specify includes an SRV record. You can also specify a default port that is applied to all instances in the Service configuration.

Returns:

  • (Numeric, nil)


52
53
54
# File 'service_discovery/ip_instance_base_props.rb', line 52

def port
  @port
end

Class Method Details

.jsii_propertiesObject



54
55
56
57
58
59
60
61
62
# File 'service_discovery/ip_instance_base_props.rb', line 54

def self.jsii_properties
  {
    :custom_attributes => "customAttributes",
    :instance_id => "instanceId",
    :ipv4 => "ipv4",
    :ipv6 => "ipv6",
    :port => "port",
  }
end

Instance Method Details

#to_jsiiObject



64
65
66
67
68
69
70
71
72
73
74
75
# File 'service_discovery/ip_instance_base_props.rb', line 64

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "customAttributes" => @custom_attributes,
    "instanceId" => @instance_id,
    "ipv4" => @ipv4,
    "ipv6" => @ipv6,
    "port" => @port,
  })
  result.compact
end