Class: AWSCDK::ECS::ServiceConnectService

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/service_connect_service.rb

Overview

Interface for service connect Service props.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(port_mapping_name:, discovery_name: nil, dns_name: nil, idle_timeout: nil, ingress_port_override: nil, per_request_timeout: nil, port: nil, tls: nil) ⇒ ServiceConnectService

Returns a new instance of ServiceConnectService.

Parameters:

  • port_mapping_name (String)

    portMappingName specifies which port and protocol combination should be used for this service connect service.

  • discovery_name (String, nil) (defaults to: nil)

    Optionally specifies an intermediate dns name to register in the CloudMap namespace.

  • dns_name (String, nil) (defaults to: nil)

    The terse DNS alias to use for this port mapping in the service connect mesh.

  • idle_timeout (AWSCDK::Duration, nil) (defaults to: nil)

    The amount of time in seconds a connection for Service Connect will stay active while idle.

  • ingress_port_override (Numeric, nil) (defaults to: nil)

    Optional.

  • per_request_timeout (AWSCDK::Duration, nil) (defaults to: nil)

    The amount of time waiting for the upstream to respond with a complete response per request for Service Connect.

  • port (Numeric, nil) (defaults to: nil)

    The port for clients to use to communicate with this service via Service Connect.

  • tls (AWSCDK::ECS::ServiceConnectTLSConfiguration, nil) (defaults to: nil)

    A reference to an object that represents a Transport Layer Security (TLS) configuration.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'ecs/service_connect_service.rb', line 15

def initialize(port_mapping_name:, discovery_name: nil, dns_name: nil, idle_timeout: nil, ingress_port_override: nil, per_request_timeout: nil, port: nil, tls: nil)
  @port_mapping_name = port_mapping_name
  Jsii::Type.check_type(@port_mapping_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "portMappingName")
  @discovery_name = discovery_name
  Jsii::Type.check_type(@discovery_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "discoveryName") unless @discovery_name.nil?
  @dns_name = dns_name
  Jsii::Type.check_type(@dns_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dnsName") unless @dns_name.nil?
  @idle_timeout = idle_timeout
  Jsii::Type.check_type(@idle_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "idleTimeout") unless @idle_timeout.nil?
  @ingress_port_override = ingress_port_override
  Jsii::Type.check_type(@ingress_port_override, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "ingressPortOverride") unless @ingress_port_override.nil?
  @per_request_timeout = per_request_timeout
  Jsii::Type.check_type(@per_request_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "perRequestTimeout") unless @per_request_timeout.nil?
  @port = port
  Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port") unless @port.nil?
  @tls = tls.is_a?(Hash) ? ::AWSCDK::ECS::ServiceConnectTLSConfiguration.new(**tls.transform_keys(&:to_sym)) : tls
  Jsii::Type.check_type(@tls, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLlNlcnZpY2VDb25uZWN0VGxzQ29uZmlndXJhdGlvbiJ9")), "tls") unless @tls.nil?
end

Instance Attribute Details

#discovery_nameString? (readonly)

Note:

Default: - port mapping name

Optionally specifies an intermediate dns name to register in the CloudMap namespace.

This is required if you wish to use the same port mapping name in more than one service.

Returns:

  • (String, nil)


44
45
46
# File 'ecs/service_connect_service.rb', line 44

def discovery_name
  @discovery_name
end

#dns_nameString? (readonly)

Note:

Default: - No alias is created. The service is reachable at portMappingName.namespace:port.

The terse DNS alias to use for this port mapping in the service connect mesh.

Service Connect-enabled clients will be able to reach this service at http://dnsName:port.

Returns:

  • (String, nil)


52
53
54
# File 'ecs/service_connect_service.rb', line 52

def dns_name
  @dns_name
end

#idle_timeoutAWSCDK::Duration? (readonly)

Note:

Default: - Duration.minutes(5) for HTTP/HTTP2/GRPC, Duration.hours(1) for TCP.

The amount of time in seconds a connection for Service Connect will stay active while idle.

A value of 0 can be set to disable idle_timeout.

If idle_timeout is set to a time that is less than per_request_timeout, the connection will close when the idle_timeout is reached and not the per_request_timeout.

Returns:



62
63
64
# File 'ecs/service_connect_service.rb', line 62

def idle_timeout
  @idle_timeout
end

#ingress_port_overrideNumeric? (readonly)

Note:

Default: - none

Optional.

The port on the Service Connect agent container to use for traffic ingress to this service.

Returns:

  • (Numeric, nil)


69
70
71
# File 'ecs/service_connect_service.rb', line 69

def ingress_port_override
  @ingress_port_override
end

#per_request_timeoutAWSCDK::Duration? (readonly)

Note:

Default: - Duration.seconds(15)

The amount of time waiting for the upstream to respond with a complete response per request for Service Connect.

A value of 0 can be set to disable per_request_timeout. Can only be set when the app_protocol for the application container is HTTP/HTTP2/GRPC.

If idle_timeout is set to a time that is less than per_request_timeout, the connection will close when the idle_timeout is reached and not the per_request_timeout.

Returns:



80
81
82
# File 'ecs/service_connect_service.rb', line 80

def per_request_timeout
  @per_request_timeout
end

#portNumeric? (readonly)

Note:

Default: the container port specified by the port mapping in portMappingName.

The port for clients to use to communicate with this service via Service Connect.

Returns:

  • (Numeric, nil)


85
86
87
# File 'ecs/service_connect_service.rb', line 85

def port
  @port
end

#port_mapping_nameString (readonly)

portMappingName specifies which port and protocol combination should be used for this service connect service.

Returns:

  • (String)


37
38
39
# File 'ecs/service_connect_service.rb', line 37

def port_mapping_name
  @port_mapping_name
end

#tlsAWSCDK::ECS::ServiceConnectTLSConfiguration? (readonly)

Note:

Default: - none

A reference to an object that represents a Transport Layer Security (TLS) configuration.



90
91
92
# File 'ecs/service_connect_service.rb', line 90

def tls
  @tls
end

Class Method Details

.jsii_propertiesObject



92
93
94
95
96
97
98
99
100
101
102
103
# File 'ecs/service_connect_service.rb', line 92

def self.jsii_properties
  {
    :port_mapping_name => "portMappingName",
    :discovery_name => "discoveryName",
    :dns_name => "dnsName",
    :idle_timeout => "idleTimeout",
    :ingress_port_override => "ingressPortOverride",
    :per_request_timeout => "perRequestTimeout",
    :port => "port",
    :tls => "tls",
  }
end

Instance Method Details

#to_jsiiObject



105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'ecs/service_connect_service.rb', line 105

def to_jsii
  result = {}
  result.merge!({
    "portMappingName" => @port_mapping_name,
    "discoveryName" => @discovery_name,
    "dnsName" => @dns_name,
    "idleTimeout" => @idle_timeout,
    "ingressPortOverride" => @ingress_port_override,
    "perRequestTimeout" => @per_request_timeout,
    "port" => @port,
    "tls" => @tls,
  })
  result.compact
end