Class: AWSCDK::ServiceDiscovery::ServiceProps
- Inherits:
-
DNSServiceProps
- Object
- DNSServiceProps
- AWSCDK::ServiceDiscovery::ServiceProps
- Defined in:
- service_discovery/service_props.rb
Instance Attribute Summary collapse
-
#custom_health_check ⇒ AWSCDK::ServiceDiscovery::HealthCheckCustomConfig?
readonly
Structure containing failure threshold for a custom health checker.
-
#description ⇒ String?
readonly
A description of the service.
-
#discovery_type ⇒ AWSCDK::ServiceDiscovery::DiscoveryType?
readonly
Controls how instances within this service can be discovered.
-
#dns_record_type ⇒ AWSCDK::ServiceDiscovery::DNSRecordType?
readonly
The DNS type of the record that you want AWS Cloud Map to create.
-
#dns_ttl ⇒ AWSCDK::Duration?
readonly
The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
-
#health_check ⇒ AWSCDK::ServiceDiscovery::HealthCheckConfig?
readonly
Settings for an optional health check.
-
#load_balancer ⇒ Boolean?
readonly
Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance.
-
#name ⇒ String?
readonly
A name for the Service.
-
#namespace ⇒ AWSCDK::ServiceDiscovery::INamespace
readonly
The namespace that you want to use for DNS configuration.
-
#routing_policy ⇒ AWSCDK::ServiceDiscovery::RoutingPolicy?
readonly
The routing policy that you want to apply to all DNS records that AWS Cloud Map creates when you register an instance and specify this service.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(custom_health_check: nil, description: nil, health_check: nil, name: nil, discovery_type: nil, dns_record_type: nil, dns_ttl: nil, load_balancer: nil, routing_policy: nil, namespace:) ⇒ ServiceProps
constructor
A new instance of ServiceProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(custom_health_check: nil, description: nil, health_check: nil, name: nil, discovery_type: nil, dns_record_type: nil, dns_ttl: nil, load_balancer: nil, routing_policy: nil, namespace:) ⇒ ServiceProps
Returns a new instance of ServiceProps.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'service_discovery/service_props.rb', line 16 def initialize(custom_health_check: nil, description: nil, health_check: nil, name: nil, discovery_type: nil, dns_record_type: nil, dns_ttl: nil, load_balancer: nil, routing_policy: nil, namespace:) @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? @discovery_type = discovery_type Jsii::Type.check_type(@discovery_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VydmljZWRpc2NvdmVyeS5EaXNjb3ZlcnlUeXBlIn0=")), "discoveryType") unless @discovery_type.nil? @dns_record_type = dns_record_type Jsii::Type.check_type(@dns_record_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VydmljZWRpc2NvdmVyeS5EbnNSZWNvcmRUeXBlIn0=")), "dnsRecordType") unless @dns_record_type.nil? @dns_ttl = dns_ttl Jsii::Type.check_type(@dns_ttl, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "dnsTtl") unless @dns_ttl.nil? @load_balancer = load_balancer Jsii::Type.check_type(@load_balancer, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "loadBalancer") unless @load_balancer.nil? @routing_policy = routing_policy Jsii::Type.check_type(@routing_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VydmljZWRpc2NvdmVyeS5Sb3V0aW5nUG9saWN5In0=")), "routingPolicy") unless @routing_policy.nil? @namespace = namespace Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VydmljZWRpc2NvdmVyeS5JTmFtZXNwYWNlIn0=")), "namespace") end |
Instance Attribute Details
#custom_health_check ⇒ AWSCDK::ServiceDiscovery::HealthCheckCustomConfig? (readonly)
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
46 47 48 |
# File 'service_discovery/service_props.rb', line 46 def custom_health_check @custom_health_check end |
#description ⇒ String? (readonly)
Default: none
A description of the service.
51 52 53 |
# File 'service_discovery/service_props.rb', line 51 def description @description end |
#discovery_type ⇒ AWSCDK::ServiceDiscovery::DiscoveryType? (readonly)
Default: DNS_AND_API
Controls how instances within this service can be discovered.
71 72 73 |
# File 'service_discovery/service_props.rb', line 71 def discovery_type @discovery_type end |
#dns_record_type ⇒ AWSCDK::ServiceDiscovery::DNSRecordType? (readonly)
Default: A
The DNS type of the record that you want AWS Cloud Map to create.
Supported record types include A, AAAA, A and AAAA (A_AAAA), CNAME, and SRV.
79 80 81 |
# File 'service_discovery/service_props.rb', line 79 def dns_record_type @dns_record_type end |
#dns_ttl ⇒ AWSCDK::Duration? (readonly)
Default: Duration.minutes(1)
The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
84 85 86 |
# File 'service_discovery/service_props.rb', line 84 def dns_ttl @dns_ttl end |
#health_check ⇒ AWSCDK::ServiceDiscovery::HealthCheckConfig? (readonly)
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.
61 62 63 |
# File 'service_discovery/service_props.rb', line 61 def health_check @health_check end |
#load_balancer ⇒ Boolean? (readonly)
Default: false
Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance.
Setting this to true correctly configures the routing_policy
and performs some additional validation.
92 93 94 |
# File 'service_discovery/service_props.rb', line 92 def load_balancer @load_balancer end |
#name ⇒ String? (readonly)
Default: CloudFormation-generated name
A name for the Service.
66 67 68 |
# File 'service_discovery/service_props.rb', line 66 def name @name end |
#namespace ⇒ AWSCDK::ServiceDiscovery::INamespace (readonly)
The namespace that you want to use for DNS configuration.
101 102 103 |
# File 'service_discovery/service_props.rb', line 101 def namespace @namespace end |
#routing_policy ⇒ AWSCDK::ServiceDiscovery::RoutingPolicy? (readonly)
Default: WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise
The routing policy that you want to apply to all DNS records that AWS Cloud Map creates when you register an instance and specify this service.
97 98 99 |
# File 'service_discovery/service_props.rb', line 97 def routing_policy @routing_policy end |
Class Method Details
.jsii_properties ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'service_discovery/service_props.rb', line 103 def self.jsii_properties { :custom_health_check => "customHealthCheck", :description => "description", :health_check => "healthCheck", :name => "name", :discovery_type => "discoveryType", :dns_record_type => "dnsRecordType", :dns_ttl => "dnsTtl", :load_balancer => "loadBalancer", :routing_policy => "routingPolicy", :namespace => "namespace", } end |
Instance Method Details
#to_jsii ⇒ Object
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'service_discovery/service_props.rb', line 118 def to_jsii result = {} result.merge!(super) result.merge!({ "customHealthCheck" => @custom_health_check, "description" => @description, "healthCheck" => @health_check, "name" => @name, "discoveryType" => @discovery_type, "dnsRecordType" => @dns_record_type, "dnsTtl" => @dns_ttl, "loadBalancer" => @load_balancer, "routingPolicy" => @routing_policy, "namespace" => @namespace, }) result.compact end |