aws-cdk-lib.aws_servicediscovery.IpInstanceBaseProps

interface IpInstanceBaseProps

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

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
customAttributes?{ [string]: string }Custom attributes of the instance.
instanceId?stringThe id of the instance resource.
ipv4?stringIf the service that you specify contains a template for an A record, the IPv4 address that you want AWS Cloud Map to use for the value of the A record.
ipv6?stringIf the service that you specify contains a template for an AAAA record, the IPv6 address that you want AWS Cloud Map to use for the value of the AAAA record.
port?numberThe port on the endpoint that you want AWS Cloud Map to perform health checks on.

customAttributes?

Type: { [string]: string } (optional, default: none)

Custom attributes of the instance.


instanceId?

Type: string (optional, default: Automatically generated name)

The id of the instance resource.


ipv4?

Type: string (optional, default: none)

If the service that you specify contains a template for an A record, the IPv4 address that you want AWS Cloud Map to use for the value of the A record.


ipv6?

Type: string (optional, default: none)

If the service that you specify contains a template for an AAAA record, the IPv6 address that you want AWS Cloud Map to use for the value of the AAAA record.


port?

Type: number (optional, default: 80)

The port on the endpoint that you want AWS Cloud Map to perform health checks on.

This value is also used for the port value in an SRV record if the service that you specify includes an SRV record. You can also specify a default port that is applied to all instances in the Service configuration.