aws-cdk-lib.aws_servicediscovery.HealthCheckType

enum HealthCheckType

LanguageType name
.NETAmazon.CDK.AWS.ServiceDiscovery.HealthCheckType
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsservicediscovery#HealthCheckType
Javasoftware.amazon.awscdk.services.servicediscovery.HealthCheckType
Pythonaws_cdk.aws_servicediscovery.HealthCheckType
TypeScript (source)aws-cdk-lib » aws_servicediscovery » HealthCheckType

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.HttpNamespace(stack, 'MyNamespace', {
  name: 'MyHTTPNamespace',
});

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();

Members

NameDescription
HTTPRoute 53 tries to establish a TCP connection.
HTTPSRoute 53 tries to establish a TCP connection.
TCPRoute 53 tries to establish a TCP connection.

HTTP

Route 53 tries to establish a TCP connection.

If successful, Route 53 submits an HTTP request and waits for an HTTP status code of 200 or greater and less than 400.


HTTPS

Route 53 tries to establish a TCP connection.

If successful, Route 53 submits an HTTPS request and waits for an HTTP status code of 200 or greater and less than 400. If you specify HTTPS for the value of Type, the endpoint must support TLS v1.0 or later.


TCP

Route 53 tries to establish a TCP connection.

If you specify TCP for Type, don't specify a value for ResourcePath.