DnsServiceProps Struct
Service props needed to create a service in a given namespace.
Used by createService() for PrivateDnsNamespace and PublicDnsNamespace
Example
import * as cdk from '../../core';
import * as servicediscovery from '../lib';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-servicediscovery-integ');
const namespace = new servicediscovery.PublicDnsNamespace(stack, 'Namespace', {
name: 'foobar.com',
});
const service = namespace.createService('Service', {
name: 'foo',
dnsRecordType: servicediscovery.DnsRecordType.A,
dnsTtl: cdk.Duration.seconds(30),
healthCheck: {
type: servicediscovery.HealthCheckType.HTTPS,
resourcePath: '/healthcheck',
failureThreshold: 2,
},
});
service.registerIpInstance('IpInstance', {
ipv4: '54.239.25.192',
port: 443,
});
app.synth();
Properties
customHealthCheckHealthCheckCustomConfigcustom_health_checkHealthCheckCustomConfigcustomHealthCheckHealthCheckCustomConfigCustomHealthCheckHealthCheckCustomConfigCustomHealthCheckHealthCheckCustomConfig= none#Only one of healthCheckConfig or healthCheckCustomConfig can be specified. See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html
discoveryTypeDiscoveryTypediscovery_typeDiscoveryTypediscoveryTypeDiscoveryTypeDiscoveryTypeDiscoveryTypeDiscoveryTypeDiscoveryType= DNS_AND_API#dnsRecordTypeDnsRecordTypedns_record_typeDnsRecordTypednsRecordTypeDnsRecordTypeDnsRecordTypeDnsRecordTypeDnsRecordTypeDnsRecordType= A#Supported record types include A, AAAA, A and AAAA (A_AAAA), CNAME, and SRV.
healthCheckHealthCheckConfighealth_checkHealthCheckConfighealthCheckHealthCheckConfigHealthCheckHealthCheckConfigHealthCheckHealthCheckConfig= none#notes
If you specify health check settings, AWS Cloud Map associates the health check with the records that you specify in DnsConfig. Only one of healthCheckConfig or healthCheckCustomConfig can be specified. Not valid for PrivateDnsNamespaces. If you use healthCheck, you can only register IP instances to this service.
Setting this to true correctly configures the routingPolicy and performs some additional validation.
routingPolicyRoutingPolicyrouting_policyRoutingPolicyroutingPolicyRoutingPolicyRoutingPolicyRoutingPolicyRoutingPolicyRoutingPolicy= WEIGHTED for CNAME records and w…#default
Default: WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise