java.lang.Object
java.lang.Enum<DiscoveryType>
software.amazon.awscdk.services.servicediscovery.DiscoveryType
All Implemented Interfaces:
Serializable, Comparable<DiscoveryType>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-05T20:26:38.883Z") @Stability(Stable) public enum DiscoveryType extends Enum<DiscoveryType>
Specifies information about the discovery type of a service.

Example:

 import software.amazon.awscdk.services.ec2.*;
 import software.amazon.awscdk.services.elasticloadbalancingv2.*;
 import software.amazon.awscdk.*;
 import software.amazon.awscdk.*;
 App app = new App();
 Stack stack = new Stack(app, "aws-servicediscovery-integ");
 Vpc vpc = Vpc.Builder.create(stack, "Vpc").maxAzs(2).build();
 PrivateDnsNamespace namespace = PrivateDnsNamespace.Builder.create(stack, "Namespace")
         .name("boobar.com")
         .vpc(vpc)
         .build();
 Service service = namespace.createService("Service", DnsServiceProps.builder()
         .dnsRecordType(DnsRecordType.A_AAAA)
         .dnsTtl(Duration.seconds(30))
         .loadBalancer(true)
         .build());
 ApplicationLoadBalancer loadbalancer = ApplicationLoadBalancer.Builder.create(stack, "LB").vpc(vpc).internetFacing(true).build();
 service.registerLoadBalancer("Loadbalancer", loadbalancer);
 Service arnService = namespace.createService("ArnService", DnsServiceProps.builder()
         .discoveryType(DiscoveryType.API)
         .build());
 arnService.registerNonIpInstance("NonIpInstance", NonIpInstanceBaseProps.builder()
         .customAttributes(Map.of("arn", "arn://"))
         .build());
 app.synth();
 
  • Enum Constant Details

    • API

      @Stability(Stable) public static final DiscoveryType API
      Instances are discoverable via API only.
    • DNS_AND_API

      @Stability(Stable) public static final DiscoveryType DNS_AND_API
      Instances are discoverable via DNS or API.
  • Method Details

    • values

      public static DiscoveryType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DiscoveryType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null