@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.144Z") @Stability(value=Stable) public enum DiscoveryType extends Enum<DiscoveryType>
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 and Description |
|---|
API
Instances are discoverable via API only.
|
DNS_AND_API
Instances are discoverable via DNS or API.
|
| Modifier and Type | Method and Description |
|---|---|
static DiscoveryType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DiscoveryType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Stability(value=Stable) public static final DiscoveryType API
@Stability(value=Stable) public static final DiscoveryType DNS_AND_API
public static DiscoveryType[] values()
for (DiscoveryType c : DiscoveryType.values()) System.out.println(c);
public static DiscoveryType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.