Class DnsServiceProps.Builder
java.lang.Object
software.amazon.awscdk.services.servicediscovery.DnsServiceProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DnsServiceProps>
- Enclosing interface:
DnsServiceProps
@Stability(Stable)
public static final class DnsServiceProps.Builder
extends Object
implements software.amazon.jsii.Builder<DnsServiceProps>
A builder for
DnsServiceProps
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.customHealthCheck
(HealthCheckCustomConfig customHealthCheck) Sets the value ofBaseServiceProps.getCustomHealthCheck()
description
(String description) Sets the value ofBaseServiceProps.getDescription()
discoveryType
(DiscoveryType discoveryType) Sets the value ofDnsServiceProps.getDiscoveryType()
dnsRecordType
(DnsRecordType dnsRecordType) Sets the value ofDnsServiceProps.getDnsRecordType()
Sets the value ofDnsServiceProps.getDnsTtl()
healthCheck
(HealthCheckConfig healthCheck) Sets the value ofBaseServiceProps.getHealthCheck()
loadBalancer
(Boolean loadBalancer) Sets the value ofDnsServiceProps.getLoadBalancer()
Sets the value ofBaseServiceProps.getName()
routingPolicy
(RoutingPolicy routingPolicy) Sets the value ofDnsServiceProps.getRoutingPolicy()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
discoveryType
Sets the value ofDnsServiceProps.getDiscoveryType()
- Parameters:
discoveryType
- Controls how instances within this service can be discovered.- Returns:
this
-
dnsRecordType
Sets the value ofDnsServiceProps.getDnsRecordType()
- Parameters:
dnsRecordType
- 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.- Returns:
this
-
dnsTtl
Sets the value ofDnsServiceProps.getDnsTtl()
- Parameters:
dnsTtl
- The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.- Returns:
this
-
loadBalancer
Sets the value ofDnsServiceProps.getLoadBalancer()
- Parameters:
loadBalancer
- Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance. Setting this totrue
correctly configures theroutingPolicy
and performs some additional validation.- Returns:
this
-
routingPolicy
Sets the value ofDnsServiceProps.getRoutingPolicy()
- Parameters:
routingPolicy
- 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.- Returns:
this
-
customHealthCheck
@Stability(Stable) public DnsServiceProps.Builder customHealthCheck(HealthCheckCustomConfig customHealthCheck) Sets the value ofBaseServiceProps.getCustomHealthCheck()
- Parameters:
customHealthCheck
- 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- Returns:
this
-
description
Sets the value ofBaseServiceProps.getDescription()
- Parameters:
description
- A description of the service.- Returns:
this
-
healthCheck
Sets the value ofBaseServiceProps.getHealthCheck()
- Parameters:
healthCheck
- 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.- Returns:
this
-
name
Sets the value ofBaseServiceProps.getName()
- Parameters:
name
- A name for the Service.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DnsServiceProps>
- Returns:
- a new instance of
DnsServiceProps
- Throws:
NullPointerException
- if any required attribute was not provided
-