Class: CfRdsSubnetGroup

Inherits:
Object
  • Object
show all
Includes:
CfBase
Defined in:
lib/cf_factory/rds/cf_rds_subnet_group.rb

Instance Method Summary collapse

Methods included from CfBase

#generate, #generate_ref, #get_deletion_policy, #get_name, #hash_to_string, #retrieve_attribute, #set_meta_data, #set_quotes, #set_tags

Constructor Details

#initialize(name, description) ⇒ CfRdsSubnetGroup

Returns a new instance of CfRdsSubnetGroup.



6
7
8
9
10
# File 'lib/cf_factory/rds/cf_rds_subnet_group.rb', line 6

def initialize(name, description)
  @name = name
  @description = description
  @subnets = []
end

Instance Method Details

#add_subnet(subnet) ⇒ Object



25
26
27
# File 'lib/cf_factory/rds/cf_rds_subnet_group.rb', line 25

def add_subnet(subnet)
  @subnets << subnet
end

#get_cf_attributesObject



16
17
18
# File 'lib/cf_factory/rds/cf_rds_subnet_group.rb', line 16

def get_cf_attributes
  {}
end

#get_cf_propertiesObject



20
21
22
23
# File 'lib/cf_factory/rds/cf_rds_subnet_group.rb', line 20

def get_cf_properties
  subnet_array = @subnets.collect() {|s| s.generate_ref}.join(",")
  {"DBSubnetGroupDescription" => @description, "SubnetIds" => "[#{subnet_array}]"}
end

#get_cf_typeObject



12
13
14
# File 'lib/cf_factory/rds/cf_rds_subnet_group.rb', line 12

def get_cf_type
  "AWS::RDS::DBSubnetGroup"
end