Sha256: 4a47ae6b240b574fb4ffa2ef7c6c70aafd442240685a49b5925af6861087debe

Contents?: true

Size: 671 Bytes

Versions: 1

Compression:

Stored size: 671 Bytes

Contents

# frozen_string_literal: true

require "aws-sdk-ecs"

module EcsAutoscalingScheduler
  module Aws
    class Ecs
      def initialize(client: ::Aws::ECS::Client.new)
        @client = client
      end

      def all_cluster_names
        cluster_arns = client.list_clusters.cluster_arns
        client.describe_clusters(clusters: cluster_arns).clusters.map(&:cluster_name)
      end

      def all_service_names(cluster:)
        service_arns = client.list_services(cluster: cluster).service_arns
        client.describe_services(cluster: cluster, services: service_arns).services.map(&:service_name)
      end

      private
        attr_reader :client
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ecs_autoscaling_scheduler-0.1.0 lib/ecs_autoscaling_scheduler/aws/ecs.rb