Define a CloudMap Service.
import { Service } from 'aws-cdk-lib/aws-servicediscovery';Or use the module namespace:
import * as servicediscovery from 'aws-cdk-lib/aws-servicediscovery';
// servicediscovery.ServiceConfiguration passed to the constructor as ServiceProps.
namespaceRequiredINamespaceThe namespace that you want to use for DNS configuration.
DnsServicePropsdiscoveryTypeOptionalinherited from DnsServicePropsDiscoveryTypeControls how instances within this service can be discovered.
Default: DNS_AND_API
dnsRecordTypeOptionalinherited from DnsServicePropsDnsRecordTypeThe DNS type of the record that you want AWS Cloud Map to create. Supported record types include A, AAAA, A and AAAA (A_AAAA), CNAME, and SRV.
Default: A
dnsTtlOptionalinherited from DnsServicePropsDurationThe amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
Default: Duration.minutes(1)
loadBalancerOptionalinherited from DnsServicePropsbooleanWhether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance. Setting this to `true` correctly configures the `routingPolicy` and performs some additional validation.
Default: false
routingPolicyOptionalinherited from DnsServicePropsRoutingPolicyThe 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.
Default: WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise
BaseServicePropscustomHealthCheckOptionalinherited from BaseServicePropsHealthCheckCustomConfigStructure containing failure threshold for a custom health checker. Only one of healthCheckConfig or healthCheckCustomConfig can be specified. See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html
Default: none
descriptionOptionalinherited from BaseServicePropsstringA description of the service.
Default: none
healthCheckOptionalinherited from BaseServicePropsHealthCheckConfigSettings for an optional health check. 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.
Default: none
nameOptionalinherited from BaseServicePropsstringA name for the Service.
Default: CloudFormation-generated name
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-servicediscovery