Sha256: be949fcc8013b692b7aa16c53e4ddc2f890376e0dd0bc7bb2e3a9718516b8a26

Contents?: true

Size: 885 Bytes

Versions: 13

Compression:

Stored size: 885 Bytes

Contents

module Awspec::Type
  class Elasticache < Base
    def initialize(id)
      super
      @resource_via_client = find_cache_cluster(id)
      @id = @resource_via_client[:cache_cluster_id] if @resource_via_client
    end

    STATES = %w(
      available creating deleted deleting
      incompatible-network modifying
      rebooting-cache-cluster-nodes restore-failed
      snapshotting
    )

    STATES.each do |state|
      define_method state.tr('-', '_') + '?' do
        @resource_via_client[:cache_cluster_status] == state
      end
    end

    def has_cache_parameter_group?(group_name)
      @resource_via_client[:cache_parameter_group][:cache_parameter_group_name] == group_name
    end

    def vpc_id
      cache_subnet_group = find_cache_subnet_group(@resource_via_client[:cache_subnet_group_name])
      cache_subnet_group[:vpc_id] if cache_subnet_group
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
awspec-0.33.0 lib/awspec/type/elasticache.rb
awspec-0.32.0 lib/awspec/type/elasticache.rb
awspec-0.31.0 lib/awspec/type/elasticache.rb
awspec-0.30.0 lib/awspec/type/elasticache.rb
awspec-0.29.0 lib/awspec/type/elasticache.rb
awspec-0.28.1 lib/awspec/type/elasticache.rb
awspec-0.28.0 lib/awspec/type/elasticache.rb
awspec-0.27.2 lib/awspec/type/elasticache.rb
awspec-0.27.1 lib/awspec/type/elasticache.rb
awspec-0.27.0 lib/awspec/type/elasticache.rb
awspec-0.26.2 lib/awspec/type/elasticache.rb
awspec-0.26.1 lib/awspec/type/elasticache.rb
awspec-0.26.0 lib/awspec/type/elasticache.rb