Skip to content

Commit

Permalink
Fix HealthCheck property on service
Browse files Browse the repository at this point in the history
HealthCheckConfig can be specified for HTTP namespaces after all
  • Loading branch information
SoManyHs committed Mar 12, 2019
1 parent da84cd8 commit e00bb06
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/@aws-cdk/aws-servicediscovery/lib/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ export interface BaseServiceProps {
*/
description?: string;

/**
* 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.
*
* @default none
*/
healthCheck?: HealthCheckConfig;

/**
* Structure containing failure threshold for a custom health checker.
* Only one of healthCheckConfig or healthCheckCustomConfig can be specified.
Expand Down Expand Up @@ -89,15 +98,6 @@ export interface DnsServiceProps extends BaseServiceProps {
*/
dnsTtlSec?: number;

/**
* 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. Public DNS namespaces only. Only one of
* healthCheckConfig or healthCheckCustomConfig can be specified.
*
* @default none
*/
healthCheck?: HealthCheckConfig;

/**
* 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.
Expand Down Expand Up @@ -172,8 +172,8 @@ export class Service extends cdk.Construct implements IService {
throw new Error('Cannot specify both `healthCheckConfig` and `healthCheckCustomConfig`.');
}

if (namespaceType !== NamespaceType.DnsPublic && props.healthCheck) {
throw new Error('Can only use `healthCheckConfig` for a Public DNS namespace.');
if (namespaceType === NamespaceType.DnsPrivate && props.healthCheck) {
throw new Error('Cannot specify `healthCheckConfig` for a Private DNS namespace.');
}

if (props.routingPolicy === RoutingPolicy.Multivalue
Expand Down

0 comments on commit e00bb06

Please sign in to comment.