aws-cdk-lib.aws_docdb.Endpoint

class Endpoint

LanguageType name
.NETAmazon.CDK.AWS.DocDB.Endpoint
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsdocdb#Endpoint
Javasoftware.amazon.awscdk.services.docdb.Endpoint
Pythonaws_cdk.aws_docdb.Endpoint
TypeScript (source)aws-cdk-lib » aws_docdb » Endpoint

Connection endpoint of a database cluster or instance.

Consists of a combination of hostname and port.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_docdb as docdb } from 'aws-cdk-lib';
const endpoint = new docdb.Endpoint('address', 123);

Initializer

new Endpoint(address: string, port: number)

Parameters

  • address string — - The hostname or address of the endpoint.
  • port number — - The port number of the endpoint.

Constructs an Endpoint instance.

Properties

NameTypeDescription
hostnamestringThe hostname of the endpoint.
portnumberThe port number of the endpoint.
socketAddressstringThe combination of HOSTNAME:PORT for this endpoint.

hostname

Type: string

The hostname of the endpoint.


port

Type: number

The port number of the endpoint.

This can potentially be a CDK token. If you need to embed the port in a string (e.g. instance user data script), use Endpoint.portAsString.


socketAddress

Type: string

The combination of HOSTNAME:PORT for this endpoint.

Methods

NameDescription
portAsString()Returns the port number as a string representation that can be used for embedding within other strings.

portAsString()

public portAsString(): string

Returns

  • string

Returns the port number as a string representation that can be used for embedding within other strings.

This is intended to deal with CDK's token system. Numeric CDK tokens are not expanded when their string representation is embedded in a string. This function returns the port either as an unresolved string token or as a resolved string representation of the port value.