Sha256: 65822aa7fa044356ac633e7fdec9fa1e842c030d0640c3d40a101e450b190121

Contents?: true

Size: 969 Bytes

Versions: 26

Compression:

Stored size: 969 Bytes

Contents

module Awspec::Type
  class Elasticache < Base
    def initialize(name)
      super
      @display_name = name
    end

    def resource_via_client
      @resource_via_client ||= find_cache_cluster(@display_name)
    end

    def 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

26 entries across 26 versions & 1 rubygems

Version Path
awspec-0.69.1 lib/awspec/type/elasticache.rb
awspec-0.69.0 lib/awspec/type/elasticache.rb
awspec-0.68.0 lib/awspec/type/elasticache.rb
awspec-0.67.1 lib/awspec/type/elasticache.rb
awspec-0.67.0 lib/awspec/type/elasticache.rb
awspec-0.66.2 lib/awspec/type/elasticache.rb
awspec-0.66.1 lib/awspec/type/elasticache.rb
awspec-0.66.0 lib/awspec/type/elasticache.rb
awspec-0.65.2 lib/awspec/type/elasticache.rb
awspec-0.65.1 lib/awspec/type/elasticache.rb
awspec-0.65.0 lib/awspec/type/elasticache.rb
awspec-0.64.0 lib/awspec/type/elasticache.rb
awspec-0.63.1 lib/awspec/type/elasticache.rb
awspec-0.63.0 lib/awspec/type/elasticache.rb
awspec-0.62.1 lib/awspec/type/elasticache.rb
awspec-0.62.0 lib/awspec/type/elasticache.rb
awspec-0.61.1 lib/awspec/type/elasticache.rb
awspec-0.61.0 lib/awspec/type/elasticache.rb
awspec-0.60.1 lib/awspec/type/elasticache.rb
awspec-0.60.0 lib/awspec/type/elasticache.rb