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
customHealthCheckoptionalHealthCheckCustomConfigcustom_health_checkoptionalHealthCheckCustomConfigcustomHealthCheckoptionalHealthCheckCustomConfigCustomHealthCheckoptionalHealthCheckCustomConfigCustomHealthCheckoptionalHealthCheckCustomConfig= none#Only one of healthCheckConfig or healthCheckCustomConfig can be specified. See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string= none#discoveryTypeoptionalDiscoveryTypediscovery_typeoptionalDiscoveryTypediscoveryTypeoptionalDiscoveryTypeDiscoveryTypeoptionalDiscoveryTypeDiscoveryTypeoptionalDiscoveryType= DNS_AND_API#dnsRecordTypeoptionalDnsRecordTypedns_record_typeoptionalDnsRecordTypednsRecordTypeoptionalDnsRecordTypeDnsRecordTypeoptionalDnsRecordTypeDnsRecordTypeoptionalDnsRecordType= A#Supported record types include A, AAAA, A and AAAA (A_AAAA), CNAME, and SRV.
dnsTtloptionalDurationdns_ttloptionalDurationdnsTtloptionalDurationDnsTtloptionalDurationDnsTtloptionalDuration= Duration.minutes(1)#healthCheckoptionalHealthCheckConfighealth_checkoptionalHealthCheckConfighealthCheckoptionalHealthCheckConfigHealthCheckoptionalHealthCheckConfigHealthCheckoptionalHealthCheckConfig= 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.
loadBalanceroptionalbooleanload_balanceroptionalboolloadBalanceroptionalBooleanLoadBalanceroptionalboolLoadBalanceroptional*bool= false#Setting this to true correctly configures the routingPolicy and performs some additional validation.
Default: CloudFormation-generated name
namespaceINamespacenamespaceINamespacenamespaceINamespaceNamespaceINamespaceNamespaceINamespacerequired#routingPolicyoptionalRoutingPolicyrouting_policyoptionalRoutingPolicyroutingPolicyoptionalRoutingPolicyRoutingPolicyoptionalRoutingPolicyRoutingPolicyoptionalRoutingPolicy#Default: WEIGHTED for CNAME records and when loadBalancer is true, MULTIVALUE otherwise