ServiceProps Struct
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_servicediscovery as servicediscovery } from 'aws-cdk-lib';
declare const namespace: servicediscovery.INamespace;
const serviceProps: servicediscovery.ServiceProps = {
namespace: namespace,
// the properties below are optional
customHealthCheck: {
failureThreshold: 123,
},
description: 'description',
discoveryType: servicediscovery.DiscoveryType.API,
dnsRecordType: servicediscovery.DnsRecordType.A,
dnsTtl: cdk.Duration.minutes(30),
healthCheck: {
failureThreshold: 123,
resourcePath: 'resourcePath',
type: servicediscovery.HealthCheckType.HTTP,
},
loadBalancer: false,
name: 'name',
routingPolicy: servicediscovery.RoutingPolicy.WEIGHTED,
};
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.
namespaceINamespacenamespaceINamespacenamespaceINamespaceNamespaceINamespaceNamespaceINamespacerequired#routingPolicyRoutingPolicyrouting_policyRoutingPolicyroutingPolicyRoutingPolicyRoutingPolicyRoutingPolicyRoutingPolicyRoutingPolicy= WEIGHTED for CNAME records and w…#default
Default: WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise