interface DnsServiceProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ServiceDiscovery.DnsServiceProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsservicediscovery#DnsServiceProps |
![]() | software.amazon.awscdk.services.servicediscovery.DnsServiceProps |
![]() | aws_cdk.aws_servicediscovery.DnsServiceProps |
![]() | aws-cdk-lib » aws_servicediscovery » DnsServiceProps |
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
Name | Type | Description |
---|---|---|
custom | Health | Structure containing failure threshold for a custom health checker. |
description? | string | A description of the service. |
discovery | Discovery | Controls how instances within this service can be discovered. |
dns | Dns | The DNS type of the record that you want AWS Cloud Map to create. |
dns | Duration | The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record. |
health | Health | Settings for an optional health check. |
load | boolean | Whether or not this service will have an Elastic LoadBalancer registered to it as an AliasTargetInstance. |
name? | string | A name for the Service. |
routing | Routing | 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. |
customHealthCheck?
Type:
Health
(optional, default: none)
Structure 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
description?
Type:
string
(optional, default: none)
A description of the service.
discoveryType?
Type:
Discovery
(optional, default: DNS_AND_API)
Controls how instances within this service can be discovered.
dnsRecordType?
Type:
Dns
(optional, default: A)
The 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.
dnsTtl?
Type:
Duration
(optional, default: Duration.minutes(1))
The amount of time, in seconds, that you want DNS resolvers to cache the settings for this record.
healthCheck?
Type:
Health
(optional, default: none)
Settings 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.
loadBalancer?
Type:
boolean
(optional, default: false)
Whether 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.
name?
Type:
string
(optional, default: CloudFormation-generated name)
A name for the Service.
routingPolicy?
Type:
Routing
(optional, default: WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise)
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.