Class: AWSCDK::ServiceDiscovery::DNSServiceProps
- Inherits:
-
BaseServiceProps
- Object
- BaseServiceProps
- AWSCDK::ServiceDiscovery::DNSServiceProps
- Defined in:
- service_discovery/dns_service_props.rb
Overview
Service props needed to create a service in a given namespace.
Used by createService() for PrivateDnsNamespace and PublicDnsNamespace
Direct Known Subclasses
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.
-
#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) ⇒ DNSServiceProps
constructor
A new instance of DNSServiceProps.
- #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) ⇒ DNSServiceProps
Returns a new instance of DNSServiceProps.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'service_discovery/dns_service_props.rb', line 19 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) @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? 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
47 48 49 |
# File 'service_discovery/dns_service_props.rb', line 47 def custom_health_check @custom_health_check end |
#description ⇒ String? (readonly)
Default: none
A description of the service.
52 53 54 |
# File 'service_discovery/dns_service_props.rb', line 52 def description @description end |
#discovery_type ⇒ AWSCDK::ServiceDiscovery::DiscoveryType? (readonly)
Default: DNS_AND_API
Controls how instances within this service can be discovered.
72 73 74 |
# File 'service_discovery/dns_service_props.rb', line 72 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.
80 81 82 |
# File 'service_discovery/dns_service_props.rb', line 80 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.
85 86 87 |
# File 'service_discovery/dns_service_props.rb', line 85 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.
62 63 64 |
# File 'service_discovery/dns_service_props.rb', line 62 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.
93 94 95 |
# File 'service_discovery/dns_service_props.rb', line 93 def load_balancer @load_balancer end |
#name ⇒ String? (readonly)
Default: CloudFormation-generated name
A name for the Service.
67 68 69 |
# File 'service_discovery/dns_service_props.rb', line 67 def name @name 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.
98 99 100 |
# File 'service_discovery/dns_service_props.rb', line 98 def routing_policy @routing_policy end |
Class Method Details
.jsii_properties ⇒ Object
100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'service_discovery/dns_service_props.rb', line 100 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", } end |
Instance Method Details
#to_jsii ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'service_discovery/dns_service_props.rb', line 114 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, }) result.compact end |