interface IpInstanceBaseProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ServiceDiscovery.IpInstanceBaseProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsservicediscovery#IpInstanceBaseProps |
![]() | software.amazon.awscdk.services.servicediscovery.IpInstanceBaseProps |
![]() | aws_cdk.aws_servicediscovery.IpInstanceBaseProps |
![]() | 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:::amzn-s3-demo-bucket' },
});
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 |
---|---|---|
custom | { [string]: string } | Custom attributes of the instance. |
instance | string | The id of the instance resource. |
ipv4? | string | 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? | string | 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? | number | The 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.