Class: AWSCDK::ServiceDiscovery::BaseServiceProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
service_discovery/base_service_props.rb

Overview

Basic props needed to create a service in a given namespace.

Used by HttpNamespace.createService

Direct Known Subclasses

DNSServiceProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(custom_health_check: nil, description: nil, health_check: nil, name: nil) ⇒ BaseServiceProps

Returns a new instance of BaseServiceProps.

Parameters:



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

def initialize(custom_health_check: nil, description: nil, health_check: nil, name: nil)
  @custom_health_check = custom_health_check.is_a?(Hash) ? ::AWSCDK::ServiceDiscovery::HealthCheckCustomConfig.new(**custom_health_check.transform_keys(&:to_sym)) : custom_health_check
  Jsii::Type.check_type(@custom_health_check, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VydmljZWRpc2NvdmVyeS5IZWFsdGhDaGVja0N1c3RvbUNvbmZpZyJ9")), "customHealthCheck") unless @custom_health_check.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @health_check = health_check.is_a?(Hash) ? ::AWSCDK::ServiceDiscovery::HealthCheckConfig.new(**health_check.transform_keys(&:to_sym)) : health_check
  Jsii::Type.check_type(@health_check, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VydmljZWRpc2NvdmVyeS5IZWFsdGhDaGVja0NvbmZpZyJ9")), "healthCheck") unless @health_check.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
end

Instance Attribute Details

#custom_health_checkAWSCDK::ServiceDiscovery::HealthCheckCustomConfig? (readonly)

Note:

Default: none

Structure containing failure threshold for a custom health checker.

Only one of healthCheckConfig or healthCheckCustomConfig can be specified. See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html



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

def custom_health_check
  @custom_health_check
end

#descriptionString? (readonly)

Note:

Default: none

A description of the service.

Returns:

  • (String, nil)


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

def description
  @description
end

#health_checkAWSCDK::ServiceDiscovery::HealthCheckConfig? (readonly)

Note:

Default: none

Settings for an optional health check.

If you specify health check settings, AWS Cloud Map associates the health check with the records that you specify in DnsConfig. Only one of healthCheckConfig or healthCheckCustomConfig can be specified. Not valid for PrivateDnsNamespaces. If you use healthCheck, you can only register IP instances to this service.



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

def health_check
  @health_check
end

#nameString? (readonly)

Note:

Default: CloudFormation-generated name

A name for the Service.

Returns:

  • (String, nil)


51
52
53
# File 'service_discovery/base_service_props.rb', line 51

def name
  @name
end

Class Method Details

.jsii_propertiesObject



53
54
55
56
57
58
59
60
# File 'service_discovery/base_service_props.rb', line 53

def self.jsii_properties
  {
    :custom_health_check => "customHealthCheck",
    :description => "description",
    :health_check => "healthCheck",
    :name => "name",
  }
end

Instance Method Details

#to_jsiiObject



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

def to_jsii
  result = {}
  result.merge!({
    "customHealthCheck" => @custom_health_check,
    "description" => @description,
    "healthCheck" => @health_check,
    "name" => @name,
  })
  result.compact
end