Interface IDnsServiceProps
Service props needed to create a service in a given namespace.
Inherited Members
Namespace: Amazon.CDK.AWS.ServiceDiscovery
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IDnsServiceProps : IBaseServiceProps
Syntax (vb)
Public Interface IDnsServiceProps
Inherits IBaseServiceProps
Remarks
Used by createService() for PrivateDnsNamespace and PublicDnsNamespace
ExampleMetadata: lit=aws-servicediscovery/test/integ.service-with-public-dns-namespace.lit.ts infused
Examples
using Amazon.CDK;
using Amazon.CDK;
var app = new App();
var stack = new Stack(app, "aws-servicediscovery-integ");
var namespace = new PublicDnsNamespace(stack, "Namespace", new PublicDnsNamespaceProps {
Name = "foobar.com"
});
var service = namespace.CreateService("Service", new DnsServiceProps {
Name = "foo",
DnsRecordType = DnsRecordType.A,
DnsTtl = Duration.Seconds(30),
HealthCheck = new HealthCheckConfig {
Type = HealthCheckType.HTTPS,
ResourcePath = "/healthcheck",
FailureThreshold = 2
}
});
service.RegisterIpInstance("IpInstance", new IpInstanceBaseProps {
Ipv4 = "54.239.25.192",
Port = 443
});
app.Synth();
Synopsis
Properties
DiscoveryType | Controls how instances within this service can be discovered. |
DnsRecordType | The DNS type of the record that you want AWS Cloud Map to create. |
DnsTtl | The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record. |
LoadBalancer | Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance. |
RoutingPolicy | The routing policy that you want to apply to all DNS records that AWS Cloud Map creates when you register an instance and specify this service. |
Properties
DiscoveryType
Controls how instances within this service can be discovered.
virtual Nullable<DiscoveryType> DiscoveryType { get; }
Property Value
System.Nullable<DiscoveryType>
Remarks
Default: DNS_AND_API
DnsRecordType
The DNS type of the record that you want AWS Cloud Map to create.
virtual Nullable<DnsRecordType> DnsRecordType { get; }
Property Value
System.Nullable<DnsRecordType>
Remarks
Supported record types include A, AAAA, A and AAAA (A_AAAA), CNAME, and SRV.
Default: A
DnsTtl
The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
virtual Duration DnsTtl { get; }
Property Value
Remarks
Default: Duration.minutes(1)
LoadBalancer
Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance.
virtual Nullable<bool> LoadBalancer { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Setting this to true
correctly configures the routingPolicy
and performs some additional validation.
Default: false
RoutingPolicy
The routing policy that you want to apply to all DNS records that AWS Cloud Map creates when you register an instance and specify this service.
virtual Nullable<RoutingPolicy> RoutingPolicy { get; }
Property Value
System.Nullable<RoutingPolicy>
Remarks
Default: WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise