Class: AWSCDK::ServiceDiscovery::IPInstanceProps

Inherits:
IPInstanceBaseProps
  • Object
show all
Defined in:
service_discovery/ip_instance_props.rb

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, service:) ⇒ IPInstanceProps

Returns a new instance of IPInstanceProps.

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.

  • service (AWSCDK::ServiceDiscovery::IService)

    The Cloudmap service this resource is registered to.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'service_discovery/ip_instance_props.rb', line 12

def initialize(custom_attributes: nil, instance_id: nil, ipv4: nil, ipv6: nil, port: nil, service:)
  @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?
  @service = service
  Jsii::Type.check_type(@service, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VydmljZWRpc2NvdmVyeS5JU2VydmljZSJ9")), "service")
end

Instance Attribute Details

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

Note:

Default: none

Custom attributes of the instance.

Returns:

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


31
32
33
# File 'service_discovery/ip_instance_props.rb', line 31

def custom_attributes
  @custom_attributes
end

#instance_idString? (readonly)

Note:

Default: Automatically generated name

The id of the instance resource.

Returns:

  • (String, nil)


36
37
38
# File 'service_discovery/ip_instance_props.rb', line 36

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)


41
42
43
# File 'service_discovery/ip_instance_props.rb', line 41

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)


46
47
48
# File 'service_discovery/ip_instance_props.rb', line 46

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)


55
56
57
# File 'service_discovery/ip_instance_props.rb', line 55

def port
  @port
end

#serviceAWSCDK::ServiceDiscovery::IService (readonly)

The Cloudmap service this resource is registered to.



59
60
61
# File 'service_discovery/ip_instance_props.rb', line 59

def service
  @service
end

Class Method Details

.jsii_propertiesObject



61
62
63
64
65
66
67
68
69
70
# File 'service_discovery/ip_instance_props.rb', line 61

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

Instance Method Details

#to_jsiiObject



72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'service_discovery/ip_instance_props.rb', line 72

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