Sha256: fd8b626e43488a20a9ecd18d71e0160400f84c279bb45c14265df98f011dfef1

Contents?: true

Size: 819 Bytes

Versions: 23

Compression:

Stored size: 819 Bytes

Contents

module Awspec::Type
  class Elasticache < Base
    def initialize(id)
      super
      @resource = find_cache_cluster(id)
      @id = @resource[:cache_cluster_id] if @resource
    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[:cache_cluster_status] == state
      end
    end

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

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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
awspec-0.22.1 lib/awspec/type/elasticache.rb
awspec-0.22.0 lib/awspec/type/elasticache.rb
awspec-0.21.6 lib/awspec/type/elasticache.rb
awspec-0.21.5 lib/awspec/type/elasticache.rb
awspec-0.21.4 lib/awspec/type/elasticache.rb
awspec-0.21.3 lib/awspec/type/elasticache.rb
awspec-0.21.2 lib/awspec/type/elasticache.rb
awspec-0.21.1 lib/awspec/type/elasticache.rb
awspec-0.21.0 lib/awspec/type/elasticache.rb
awspec-0.20.2 lib/awspec/type/elasticache.rb
awspec-0.20.1 lib/awspec/type/elasticache.rb
awspec-0.20.0 lib/awspec/type/elasticache.rb
awspec-0.19.0 lib/awspec/type/elasticache.rb
awspec-0.18.2 lib/awspec/type/elasticache.rb
awspec-0.18.1 lib/awspec/type/elasticache.rb
awspec-0.18.0 lib/awspec/type/elasticache.rb
awspec-0.17.1 lib/awspec/type/elasticache.rb
awspec-0.17.0 lib/awspec/type/elasticache.rb
awspec-0.16.0 lib/awspec/type/elasticache.rb
awspec-0.15.0 lib/awspec/type/elasticache.rb