Class ServiceDiscovery
Provides the Service Discovery method a VirtualNode uses.
Inheritance
Namespace: Amazon.CDK.AWS.AppMesh
Assembly: Amazon.CDK.AWS.AppMesh.dll
Syntax (csharp)
public abstract class ServiceDiscovery : DeputyBase
Syntax (vb)
Public MustInherit Class ServiceDiscovery
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
Mesh mesh;
var vpc = new Vpc(this, "vpc");
var namespace = new PrivateDnsNamespace(this, "test-namespace", new PrivateDnsNamespaceProps {
Vpc = vpc,
Name = "domain.local"
});
var service = namespace.CreateService("Svc");
var node = mesh.AddVirtualNode("virtual-node", new VirtualNodeBaseProps {
ServiceDiscovery = ServiceDiscovery.CloudMap(service),
Listeners = new [] { VirtualNodeListener.Http(new HttpVirtualNodeListenerOptions {
Port = 8081,
HealthCheck = HealthCheck.Http(new HttpHealthCheckOptions {
HealthyThreshold = 3,
Interval = Duration.Seconds(5), // minimum
Path = "/health-check-path",
Timeout = Duration.Seconds(2), // minimum
UnhealthyThreshold = 2
})
}) },
AccessLog = AccessLog.FromFilePath("/dev/stdout")
});
Synopsis
Constructors
ServiceDiscovery() | |
ServiceDiscovery(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
ServiceDiscovery(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(Construct) | Binds the current object when adding Service Discovery to a VirtualNode. |
CloudMap(IService, IDictionary<String, String>) | Returns Cloud Map based service discovery. |
Dns(String, Nullable<DnsResponseType>) | Returns DNS based service discovery. |
Constructors
ServiceDiscovery()
protected ServiceDiscovery()
ServiceDiscovery(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected ServiceDiscovery(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
ServiceDiscovery(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected ServiceDiscovery(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(Construct)
Binds the current object when adding Service Discovery to a VirtualNode.
public abstract IServiceDiscoveryConfig Bind(Construct scope)
Parameters
- scope Construct
Returns
CloudMap(IService, IDictionary<String, String>)
Returns Cloud Map based service discovery.
public static ServiceDiscovery CloudMap(IService service, IDictionary<string, string> instanceAttributes = null)
Parameters
- service IService
The AWS Cloud Map Service to use for service discovery.
- instanceAttributes System.Collections.Generic.IDictionary<System.String, System.String>
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.
Returns
Dns(String, Nullable<DnsResponseType>)
Returns DNS based service discovery.
public static ServiceDiscovery Dns(string hostname, Nullable<DnsResponseType> responseType = null)
Parameters
- hostname System.String
- responseType System.Nullable<DnsResponseType>
Specifies the DNS response type for the virtual node.
Returns