@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)",
date="2023-03-28T21:34:27.887Z")
public abstract class ServiceDiscovery
extends software.amazon.jsii.JsiiObject
Example:
Mesh mesh; Vpc vpc = new Vpc(this, "vpc"); PrivateDnsNamespace namespace = PrivateDnsNamespace.Builder.create(this, "test-namespace") .vpc(vpc) .name("domain.local") .build(); Service service = namespace.createService("Svc"); VirtualNode node = mesh.addVirtualNode("virtual-node", VirtualNodeBaseProps.builder() .serviceDiscovery(ServiceDiscovery.cloudMap(service)) .listeners(List.of(VirtualNodeListener.http(HttpVirtualNodeListenerOptions.builder() .port(8081) .healthCheck(HealthCheck.http(HttpHealthCheckOptions.builder() .healthyThreshold(3) .interval(Duration.seconds(5)) // minimum .path("/health-check-path") .timeout(Duration.seconds(2)) // minimum .unhealthyThreshold(2) .build())) .build()))) .accessLog(AccessLog.fromFilePath("/dev/stdout")) .build());
Modifier | Constructor and Description |
---|---|
protected |
ServiceDiscovery() |
protected |
ServiceDiscovery(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ServiceDiscovery(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
abstract ServiceDiscoveryConfig |
bind(Construct scope)
Binds the current object when adding Service Discovery to a VirtualNode.
|
static ServiceDiscovery |
cloudMap(IService service)
Returns Cloud Map based service discovery.
|
static ServiceDiscovery |
cloudMap(IService service,
java.util.Map<java.lang.String,java.lang.String> instanceAttributes)
Returns Cloud Map based service discovery.
|
static ServiceDiscovery |
dns(java.lang.String hostname)
Returns DNS based service discovery.
|
static ServiceDiscovery |
dns(java.lang.String hostname,
DnsResponseType responseType)
Returns DNS based service discovery.
|
protected ServiceDiscovery(software.amazon.jsii.JsiiObjectRef objRef)
protected ServiceDiscovery(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
protected ServiceDiscovery()
public static ServiceDiscovery cloudMap(IService service, java.util.Map<java.lang.String,java.lang.String> instanceAttributes)
service
- The AWS Cloud Map Service to use for service discovery. This parameter is required.instanceAttributes
- A string map that contains attributes with values that you can use to filter instances by any custom attribute that you specified when you registered the instance.public static ServiceDiscovery cloudMap(IService service)
service
- The AWS Cloud Map Service to use for service discovery. This parameter is required.public static ServiceDiscovery dns(java.lang.String hostname, DnsResponseType responseType)
hostname
- This parameter is required.responseType
- Specifies the DNS response type for the virtual node.public static ServiceDiscovery dns(java.lang.String hostname)
hostname
- This parameter is required.public abstract ServiceDiscoveryConfig bind(Construct scope)
scope
- This parameter is required.