Sha256: e3d683053da0926d22da1b1df01f0f7b1669c3f4a5ad4568b8341093fbfc7c04

Contents?: true

Size: 890 Bytes

Versions: 12

Compression:

Stored size: 890 Bytes

Contents

module Awspec::Type
  class EcsCluster < Base
    aws_resource Aws::ECS::Types::Cluster

    def initialize(name)
      super
      @display_name = name
    end

    def resource_via_client
      @resource_via_client ||= find_ecs_cluster(@display_name)
    end

    def id
      @id ||= resource_via_client.cluster_name if resource_via_client
    end

    def active?
      resource_via_client.status == 'ACTIVE'
    end

    def inactive?
      resource_via_client.status == 'INACTIVE'
    end

    def container_instance_arns
      @container_instance_arns ||= list_ecs_container_instances(id)
    end

    def container_instances
      return @container_instances if @container_instances
      arns = container_instance_arns
      @container_instances ||=
        arns.empty? ? [] : find_ecs_container_instances(id, arns).map! { |ci| EcsContainerInstance.new(id, ci) }
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
awspec-0.65.2 lib/awspec/type/ecs_cluster.rb
awspec-0.65.1 lib/awspec/type/ecs_cluster.rb
awspec-0.65.0 lib/awspec/type/ecs_cluster.rb
awspec-0.64.0 lib/awspec/type/ecs_cluster.rb
awspec-0.63.1 lib/awspec/type/ecs_cluster.rb
awspec-0.63.0 lib/awspec/type/ecs_cluster.rb
awspec-0.62.1 lib/awspec/type/ecs_cluster.rb
awspec-0.62.0 lib/awspec/type/ecs_cluster.rb
awspec-0.61.1 lib/awspec/type/ecs_cluster.rb
awspec-0.61.0 lib/awspec/type/ecs_cluster.rb
awspec-0.60.1 lib/awspec/type/ecs_cluster.rb
awspec-0.60.0 lib/awspec/type/ecs_cluster.rb