Class ServiceDiscovery
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.appmesh.ServiceDiscovery
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:46.152Z")
@Stability(Stable)
public abstract class ServiceDiscovery
extends software.amazon.jsii.JsiiObject
Provides the Service Discovery method a VirtualNode uses.
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());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
ServiceDiscovery
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
ServiceDiscovery
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionabstract ServiceDiscoveryConfig
Binds the current object when adding Service Discovery to a VirtualNode.static ServiceDiscovery
Returns Cloud Map based service discovery.static ServiceDiscovery
Returns Cloud Map based service discovery.static ServiceDiscovery
Returns DNS based service discovery.static ServiceDiscovery
dns
(String hostname, DnsResponseType responseType) Returns DNS based service discovery.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ServiceDiscovery
protected ServiceDiscovery(software.amazon.jsii.JsiiObjectRef objRef) -
ServiceDiscovery
protected ServiceDiscovery(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ServiceDiscovery
@Stability(Stable) protected ServiceDiscovery()
-
-
Method Details
-
cloudMap
@Stability(Stable) @NotNull public static ServiceDiscovery cloudMap(@NotNull IService service, @Nullable Map<String, String> instanceAttributes) Returns Cloud Map based service discovery.- Parameters:
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.
-
cloudMap
Returns Cloud Map based service discovery.- Parameters:
service
- The AWS Cloud Map Service to use for service discovery. This parameter is required.
-
dns
@Stability(Stable) @NotNull public static ServiceDiscovery dns(@NotNull String hostname, @Nullable DnsResponseType responseType) Returns DNS based service discovery.- Parameters:
hostname
- This parameter is required.responseType
- Specifies the DNS response type for the virtual node.
-
dns
Returns DNS based service discovery.- Parameters:
hostname
- This parameter is required.
-
bind
Binds the current object when adding Service Discovery to a VirtualNode.- Parameters:
scope
- This parameter is required.
-