1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
module Fog
module AWS
class Elasticache
class SubnetGroup < Fog::Model
identity :id, :aliases => ['CacheSubnetGroupName', :name]
attribute :description, :aliases => 'CacheSubnetGroupDescription'
attribute :vpc_id, :aliases => 'VpcId'
attribute :subnet_ids, :aliases => 'Subnets'
def ready?
# Just returning true, as Elasticache subnet groups
# seem to not have a status, unlike RDS subnet groups.
true
end
def save
requires :description, :id, :subnet_ids
service.create_cache_subnet_group(id, subnet_ids, description)
reload
end
def destroy
requires :id
service.delete_cache_subnet_group(id)
true
end
end
end
end
end
|