interface HealthCheckConfig
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ServiceDiscovery.HealthCheckConfig |
Java | software.amazon.awscdk.services.servicediscovery.HealthCheckConfig |
Python | aws_cdk.aws_servicediscovery.HealthCheckConfig |
TypeScript (source) | @aws-cdk/aws-servicediscovery » HealthCheckConfig |
Settings for an optional Amazon Route 53 health check.
If you specify settings for a health check, AWS Cloud Map associates the health check with all the records that you specify in DnsConfig. Only valid with a PublicDnsNamespace.
Example
import * as cdk from '@aws-cdk/core';
import * as servicediscovery from '../lib';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'aws-servicediscovery-integ');
const namespace = new servicediscovery.HttpNamespace(stack, 'MyNamespace', {
name: 'covfefe',
});
const service1 = namespace.createService('NonIpService', {
description: 'service registering non-ip instances',
});
service1.registerNonIpInstance('NonIpInstance', {
customAttributes: { arn: 'arn:aws:s3:::mybucket' },
});
const service2 = namespace.createService('IpService', {
description: 'service registering ip instances',
healthCheck: {
type: servicediscovery.HealthCheckType.HTTP,
resourcePath: '/check',
},
});
service2.registerIpInstance('IpInstance', {
ipv4: '54.239.25.192',
});
app.synth();
Properties
Name | Type | Description |
---|---|---|
failure | number | The number of consecutive health checks that an endpoint must pass or fail for Route 53 to change the current status of the endpoint from unhealthy to healthy or vice versa. |
resource | string | The path that you want Route 53 to request when performing health checks. |
type? | Health | The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy. |
failureThreshold?
Type:
number
(optional, default: 1)
The number of consecutive health checks that an endpoint must pass or fail for Route 53 to change the current status of the endpoint from unhealthy to healthy or vice versa.
resourcePath?
Type:
string
(optional, default: '/')
The path that you want Route 53 to request when performing health checks.
Do not use when health check type is TCP.
type?
Type:
Health
(optional, default: HTTP)
The type of health check that you want to create, which indicates how Route 53 determines whether an endpoint is healthy.
Cannot be modified once created. Supported values are HTTP, HTTPS, and TCP.