Class: AWSCDK::ServiceDiscovery::NonIPInstanceProps

Inherits:
NonIPInstanceBaseProps
  • Object
show all
Defined in:
service_discovery/non_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, service:) ⇒ NonIPInstanceProps

Returns a new instance of NonIPInstanceProps.

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.

  • service (AWSCDK::ServiceDiscovery::IService)

    The Cloudmap service this resource is registered to.



9
10
11
12
13
14
15
16
# File 'service_discovery/non_ip_instance_props.rb', line 9

def initialize(custom_attributes: nil, instance_id: 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?
  @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)


22
23
24
# File 'service_discovery/non_ip_instance_props.rb', line 22

def custom_attributes
  @custom_attributes
end

#instance_idString? (readonly)

Note:

Default: Automatically generated name

The id of the instance resource.

Returns:

  • (String, nil)


27
28
29
# File 'service_discovery/non_ip_instance_props.rb', line 27

def instance_id
  @instance_id
end

#serviceAWSCDK::ServiceDiscovery::IService (readonly)

The Cloudmap service this resource is registered to.



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

def service
  @service
end

Class Method Details

.jsii_propertiesObject



33
34
35
36
37
38
39
# File 'service_discovery/non_ip_instance_props.rb', line 33

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

Instance Method Details

#to_jsiiObject



41
42
43
44
45
46
47
48
49
50
# File 'service_discovery/non_ip_instance_props.rb', line 41

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