Sha256: 0e46c6bd553dc4195befbc78ef2257390e57174529a197808ca7e7e7c82808c7

Contents?: true

Size: 710 Bytes

Versions: 12

Compression:

Stored size: 710 Bytes

Contents

module Awspec::Type
  class EcsContainerInstance < Base
    aws_resource Aws::ECS::Types::ContainerInstance

    attr_accessor :cluster_name

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

    def resource_via_client
      @resource_via_client ||= find_ecs_container_instances(@cluster_name, [@display_name]).first
    end

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

    def cluster_name
      @cluster_name || 'default'
    end

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

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

Version data entries

12 entries across 12 versions & 1 rubygems

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