Class ServiceProps.Builder

java.lang.Object
software.amazon.awscdk.services.servicediscovery.ServiceProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<ServiceProps>
Enclosing interface:
ServiceProps

@Stability(Stable) public static final class ServiceProps.Builder extends Object implements software.amazon.jsii.Builder<ServiceProps>
A builder for ServiceProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • namespace

      @Stability(Stable) public ServiceProps.Builder namespace(INamespace namespace)
      Sets the value of ServiceProps.getNamespace()
      Parameters:
      namespace - The namespace that you want to use for DNS configuration. This parameter is required.
      Returns:
      this
    • dnsRecordType

      @Stability(Stable) public ServiceProps.Builder dnsRecordType(DnsRecordType dnsRecordType)
      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

      @Stability(Stable) public ServiceProps.Builder dnsTtl(Duration dnsTtl)
      Sets the value of DnsServiceProps.getDnsTtl()
      Parameters:
      dnsTtl - The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
      Returns:
      this
    • loadBalancer

      @Stability(Stable) public ServiceProps.Builder loadBalancer(Boolean loadBalancer)
      Parameters:
      loadBalancer - Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance. Setting this to true correctly configures the routingPolicy and performs some additional validation.
      Returns:
      this
    • routingPolicy

      @Stability(Stable) public ServiceProps.Builder routingPolicy(RoutingPolicy routingPolicy)
      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 ServiceProps.Builder customHealthCheck(HealthCheckCustomConfig customHealthCheck)
      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

      @Stability(Stable) public ServiceProps.Builder description(String description)
      Parameters:
      description - A description of the service.
      Returns:
      this
    • healthCheck

      @Stability(Stable) public ServiceProps.Builder healthCheck(HealthCheckConfig healthCheck)
      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

      @Stability(Stable) public ServiceProps.Builder name(String name)
      Sets the value of BaseServiceProps.getName()
      Parameters:
      name - A name for the Service.
      Returns:
      this
    • build

      @Stability(Stable) public ServiceProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<ServiceProps>
      Returns:
      a new instance of ServiceProps
      Throws:
      NullPointerException - if any required attribute was not provided