Class: AWSCDK::ECS::ExternalServiceAttributes

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

Overview

The properties to import from the service using the External launch type.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster:, service_arn: nil, service_name: nil) ⇒ ExternalServiceAttributes

Returns a new instance of ExternalServiceAttributes.

Parameters:

  • cluster (AWSCDK::ECS::ICluster)

    The cluster that hosts the service.

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

    The service ARN.

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

    The name of the service.



10
11
12
13
14
15
16
17
# File 'ecs/external_service_attributes.rb', line 10

def initialize(cluster:, service_arn: nil, service_name: nil)
  @cluster = cluster
  Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLklDbHVzdGVyIn0=")), "cluster")
  @service_arn = service_arn
  Jsii::Type.check_type(@service_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "serviceArn") unless @service_arn.nil?
  @service_name = service_name
  Jsii::Type.check_type(@service_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "serviceName") unless @service_name.nil?
end

Instance Attribute Details

#clusterAWSCDK::ECS::ICluster (readonly)

The cluster that hosts the service.



22
23
24
# File 'ecs/external_service_attributes.rb', line 22

def cluster
  @cluster
end

#service_arnString? (readonly)

Note:

Default: - either this, or serviceName, is required

The service ARN.

Returns:

  • (String, nil)


27
28
29
# File 'ecs/external_service_attributes.rb', line 27

def service_arn
  @service_arn
end

#service_nameString? (readonly)

Note:

Default: - either this, or serviceArn, is required

The name of the service.

Returns:

  • (String, nil)


32
33
34
# File 'ecs/external_service_attributes.rb', line 32

def service_name
  @service_name
end

Class Method Details

.jsii_propertiesObject



34
35
36
37
38
39
40
# File 'ecs/external_service_attributes.rb', line 34

def self.jsii_properties
  {
    :cluster => "cluster",
    :service_arn => "serviceArn",
    :service_name => "serviceName",
  }
end

Instance Method Details

#to_jsiiObject



42
43
44
45
46
47
48
49
50
# File 'ecs/external_service_attributes.rb', line 42

def to_jsii
  result = {}
  result.merge!({
    "cluster" => @cluster,
    "serviceArn" => @service_arn,
    "serviceName" => @service_name,
  })
  result.compact
end