class Awspec::Type::Elasticache

Constants

STATES

Public Class Methods

new(name) click to toggle source
Calls superclass method
# File lib/awspec/type/elasticache.rb, line 3
def initialize(name)
  super
  @display_name = name
end

Public Instance Methods

has_cache_parameter_group?(group_name) click to toggle source
# File lib/awspec/type/elasticache.rb, line 29
def has_cache_parameter_group?(group_name)
  resource_via_client.cache_parameter_group.cache_parameter_group_name == group_name
end
has_security_group?(sg_id) click to toggle source
# File lib/awspec/type/elasticache.rb, line 33
def has_security_group?(sg_id)
  return true if has_vpc_security_group_id?(sg_id)
  return true if has_vpc_security_group_name?(sg_id)
  return true if has_vpc_security_group_tag_name?(sg_id)
end
id() click to toggle source
# File lib/awspec/type/elasticache.rb, line 12
def id
  @id ||= resource_via_client.cache_cluster_id if resource_via_client
end
resource_via_client() click to toggle source
# File lib/awspec/type/elasticache.rb, line 8
def resource_via_client
  @resource_via_client ||= find_cache_cluster(@display_name)
end
vpc_id() click to toggle source
# File lib/awspec/type/elasticache.rb, line 39
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

Private Instance Methods

has_vpc_security_group_id?(sg_id) click to toggle source
# File lib/awspec/type/elasticache.rb, line 46
def has_vpc_security_group_id?(sg_id)
  resource_security_group_ids.include?(sg_id)
end
has_vpc_security_group_name?(sg_id) click to toggle source
# File lib/awspec/type/elasticache.rb, line 50
def has_vpc_security_group_name?(sg_id)
  res = select_security_group_by_group_name([sg_id])

  return false unless res.count == 1
  has_vpc_security_group_id?(res.first.group_id)
end
has_vpc_security_group_tag_name?(sg_id) click to toggle source
# File lib/awspec/type/elasticache.rb, line 57
def has_vpc_security_group_tag_name?(sg_id)
  res = select_security_group_by_tag_name([sg_id])

  return false unless res.count == 1
  has_vpc_security_group_id?(res.first.group_id)
end
resource_security_group_ids() click to toggle source
# File lib/awspec/type/elasticache.rb, line 64
def resource_security_group_ids
  resource_via_client.security_groups.map(&:security_group_id)
end