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.116.0 (build 0eddcff)",
date="2025-10-29T11:15:32.375Z")
@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
ConstructorsModifierConstructorDescriptionprotectedprotectedServiceDiscovery(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedServiceDiscovery(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionabstract ServiceDiscoveryConfigbind(software.constructs.Construct scope) Binds the current object when adding Service Discovery to a VirtualNode.static ServiceDiscoveryReturns Cloud Map based service discovery.static ServiceDiscoveryReturns Cloud Map based service discovery.static ServiceDiscoveryReturns Cloud Map based service discovery.static ServiceDiscoveryReturns DNS based service discovery.static ServiceDiscoverydns(String hostname, DnsResponseType responseType) Returns DNS based service discovery.static ServiceDiscoverydns(String hostname, DnsResponseType responseType, IpPreference ipPreference) 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, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, @Nullable IpPreference ipPreference) 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.ipPreference- No IP preference is applied to the Virtual Node.
-
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, @Nullable IpPreference ipPreference) Returns DNS based service discovery.- Parameters:
hostname- This parameter is required.responseType- Specifies the DNS response type for the virtual node.ipPreference- No IP preference is applied to the Virtual Node.
-
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
@Stability(Stable) @NotNull public abstract ServiceDiscoveryConfig bind(@NotNull software.constructs.Construct scope) Binds the current object when adding Service Discovery to a VirtualNode.- Parameters:
scope- This parameter is required.
-