Class: AWSCDK::ECS::CfnService::ServiceRegistryProperty

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

Overview

The details for the service registry.

Each service may be associated with one service registry. Multiple service registries for each service are not supported.

When you add, update, or remove the service registries configuration, Amazon ECS starts a new deployment. New tasks are registered and deregistered to the updated service registry configuration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(container_name: nil, container_port: nil, port: nil, registry_arn: nil) ⇒ ServiceRegistryProperty

Returns a new instance of ServiceRegistryProperty.

Parameters:

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

    The container name value to be used for your service discovery service.

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

    The port value to be used for your service discovery service.

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

    The port value used if your service discovery service specified an SRV record.

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

    The Amazon Resource Name (ARN) of the service registry.



3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
# File 'ecs/cfn_service.rb', line 3122

def initialize(container_name: nil, container_port: nil, port: nil, registry_arn: nil)
  @container_name = container_name
  Jsii::Type.check_type(@container_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerName") unless @container_name.nil?
  @container_port = container_port
  Jsii::Type.check_type(@container_port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "containerPort") unless @container_port.nil?
  @port = port
  Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port") unless @port.nil?
  @registry_arn = registry_arn
  Jsii::Type.check_type(@registry_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "registryArn") unless @registry_arn.nil?
end

Instance Attribute Details

#container_nameString? (readonly)

The container name value to be used for your service discovery service.

It's already specified in the task definition. If the task definition that your service task specifies uses the bridge or host network mode, you must specify a container_name and container_port combination from the task definition. If the task definition that your service task specifies uses the awsvpc network mode and a type SRV DNS record is used, you must specify either a container_name and container_port combination or a port value. However, you can't specify both.



3139
3140
3141
# File 'ecs/cfn_service.rb', line 3139

def container_name
  @container_name
end

#container_portNumeric? (readonly)

The port value to be used for your service discovery service.

It's already specified in the task definition. If the task definition your service task specifies uses the bridge or host network mode, you must specify a container_name and container_port combination from the task definition. If the task definition your service task specifies uses the awsvpc network mode and a type SRV DNS record is used, you must specify either a container_name and container_port combination or a port value. However, you can't specify both.



3146
3147
3148
# File 'ecs/cfn_service.rb', line 3146

def container_port
  @container_port
end

#portNumeric? (readonly)

The port value used if your service discovery service specified an SRV record.

This field might be used if both the awsvpc network mode and SRV records are used.



3153
3154
3155
# File 'ecs/cfn_service.rb', line 3153

def port
  @port
end

#registry_arnString? (readonly)

The Amazon Resource Name (ARN) of the service registry.

The currently supported service registry is AWS Cloud Map . For more information, see CreateService .



3160
3161
3162
# File 'ecs/cfn_service.rb', line 3160

def registry_arn
  @registry_arn
end

Class Method Details

.jsii_propertiesObject



3162
3163
3164
3165
3166
3167
3168
3169
# File 'ecs/cfn_service.rb', line 3162

def self.jsii_properties
  {
    :container_name => "containerName",
    :container_port => "containerPort",
    :port => "port",
    :registry_arn => "registryArn",
  }
end

Instance Method Details

#to_jsiiObject



3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
# File 'ecs/cfn_service.rb', line 3171

def to_jsii
  result = {}
  result.merge!({
    "containerName" => @container_name,
    "containerPort" => @container_port,
    "port" => @port,
    "registryArn" => @registry_arn,
  })
  result.compact
end