Sha256: 4b684b40b11063087f7c9e4a9e7681556b568e6302088f05d3b49fc988ecd2ea

Contents?: true

Size: 651 Bytes

Versions: 8

Compression:

Stored size: 651 Bytes

Contents

module Awspec::Type
  class EcsContainerInstance < Base
    attr_accessor :cluster

    def initialize(container_instance)
      super
      @display_name = container_instance.split('/').last
    end

    def resource_via_client
      @resource_via_client ||= find_ecs_container_instance(cluster, @display_name)
    end

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

    def cluster
      @cluster || 'default'
    end

    STATES = %w(ACTIVE INACTIVE)

    STATES.each do |state|
      define_method state.downcase + '?' do
        resource_via_client.status == state
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
awspec-0.69.1 lib/awspec/type/ecs_container_instance.rb
awspec-0.69.0 lib/awspec/type/ecs_container_instance.rb
awspec-0.68.0 lib/awspec/type/ecs_container_instance.rb
awspec-0.67.1 lib/awspec/type/ecs_container_instance.rb
awspec-0.67.0 lib/awspec/type/ecs_container_instance.rb
awspec-0.66.2 lib/awspec/type/ecs_container_instance.rb
awspec-0.66.1 lib/awspec/type/ecs_container_instance.rb
awspec-0.66.0 lib/awspec/type/ecs_container_instance.rb