Class: AWSCDK::DocDB::Endpoint

Inherits:
Jsii::Object
  • Object
show all
Defined in:
doc_db/endpoint.rb

Overview

Connection endpoint of a database cluster or instance.

Consists of a combination of hostname and port.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, port) ⇒ Endpoint

Constructs an Endpoint instance.

Parameters:

  • address (String)
    • The hostname or address of the endpoint.
  • port (Numeric)
    • The port number of the endpoint.


14
15
16
17
18
# File 'doc_db/endpoint.rb', line 14

def initialize(address, port)
  Jsii::Type.check_type(address, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "address")
  Jsii::Type.check_type(port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port")
  Jsii::Object.instance_method(:initialize).bind(self).call(address, port)
end

Class Method Details

.jsii_overridable_methodsObject



20
21
22
23
24
25
26
27
# File 'doc_db/endpoint.rb', line 20

def self.jsii_overridable_methods
  {
    :hostname => { kind: :property, name: "hostname", is_optional: false },
    :port => { kind: :property, name: "port", is_optional: false },
    :socket_address => { kind: :property, name: "socketAddress", is_optional: false },
    :port_as_string => { kind: :method, name: "portAsString", is_optional: false },
  }
end

Instance Method Details

#hostnameString

The hostname of the endpoint.

Returns:

  • (String)


32
33
34
# File 'doc_db/endpoint.rb', line 32

def hostname()
  jsii_get_property("hostname")
end

#portNumeric

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.

Returns:

  • (Numeric)


42
43
44
# File 'doc_db/endpoint.rb', line 42

def port()
  jsii_get_property("port")
end

#port_as_stringString

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.

Returns:

  • (String)

    An (un)resolved string representation of the endpoint's port number



60
61
62
# File 'doc_db/endpoint.rb', line 60

def port_as_string()
  jsii_call_method("portAsString", [])
end

#socket_addressString

The combination of HOSTNAME:PORT for this endpoint.

Returns:

  • (String)


49
50
51
# File 'doc_db/endpoint.rb', line 49

def socket_address()
  jsii_get_property("socketAddress")
end