Method: EcsCmd::Service#initialize

Defined in:
lib/ecs_cmd/service.rb

#initialize(cluster, name, region) ⇒ Service

Returns a new instance of Service.



8
9
10
11
12
13
14
15
# File 'lib/ecs_cmd/service.rb', line 8

def initialize(cluster, name, region)
  @client = Aws::ECS::Client.new(region: region)
  @ec2_client = Aws::EC2::Client.new(region: region)
  @cluster = cluster
  @name = name
  @service_stats = @client.describe_services(cluster: cluster, services: [name])[0]
  raise 'service does not appear to exist' if @service_stats.empty?
end