Sha256: 179693b612334acea41370649849e0bc564a738e55f1aff42e97a60cff235208

Contents?: true

Size: 873 Bytes

Versions: 34

Compression:

Stored size: 873 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

34 entries across 34 versions & 1 rubygems

Version Path
awspec-0.55.0 lib/awspec/type/elasticache.rb
awspec-0.54.0 lib/awspec/type/elasticache.rb
awspec-0.52.4 lib/awspec/type/elasticache.rb
awspec-0.52.3 lib/awspec/type/elasticache.rb
awspec-0.52.2 lib/awspec/type/elasticache.rb
awspec-0.52.1 lib/awspec/type/elasticache.rb
awspec-0.52.0 lib/awspec/type/elasticache.rb
awspec-0.51.0 lib/awspec/type/elasticache.rb
awspec-0.50.0 lib/awspec/type/elasticache.rb
awspec-0.49.0 lib/awspec/type/elasticache.rb
awspec-0.48.0 lib/awspec/type/elasticache.rb
awspec-0.47.0 lib/awspec/type/elasticache.rb
awspec-0.46.0 lib/awspec/type/elasticache.rb
awspec-0.45.0 lib/awspec/type/elasticache.rb
awspec-0.44.0 lib/awspec/type/elasticache.rb
awspec-0.43.0 lib/awspec/type/elasticache.rb
awspec-0.42.0 lib/awspec/type/elasticache.rb
awspec-0.41.0 lib/awspec/type/elasticache.rb
awspec-0.40.0 lib/awspec/type/elasticache.rb
awspec-0.39.0 lib/awspec/type/elasticache.rb