aws-cdk-lib.aws_servicediscovery.BaseServiceProps

interface BaseServiceProps

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

Basic props needed to create a service in a given namespace.

Used by HttpNamespace.createService

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

Properties

NameTypeDescription
customHealthCheck?HealthCheckCustomConfigStructure containing failure threshold for a custom health checker.
description?stringA description of the service.
healthCheck?HealthCheckConfigSettings for an optional health check.
name?stringA name for the Service.

customHealthCheck?

Type: HealthCheckCustomConfig (optional, default: none)

Structure containing failure threshold for a custom health checker.

Only one of healthCheckConfig or healthCheckCustomConfig can be specified. See: https://docs.aws.amazon.com/cloud-map/latest/api/API_HealthCheckCustomConfig.html


description?

Type: string (optional, default: none)

A description of the service.


healthCheck?

Type: HealthCheckConfig (optional, default: none)

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. If you use healthCheck, you can only register IP instances to this service.


name?

Type: string (optional, default: CloudFormation-generated name)

A name for the Service.