Class: TerraformDSL::AWS::RDS::SubnetGroup

Inherits:
TerraformDSL::AWS::Resource show all
Defined in:
lib/terraformdsl/aws.rb

Instance Attribute Summary collapse

Attributes inherited from TerraformDSL::AWS::Resource

#parent

Instance Method Summary collapse

Methods inherited from TerraformDSL::AWS::Resource

#accept, #set_parent

Constructor Details

#initialize(name, subnets = []) ⇒ SubnetGroup

Returns a new instance of SubnetGroup.



336
337
338
339
340
341
# File 'lib/terraformdsl/aws.rb', line 336

def initialize(name, subnets=[])
  subnets.all? {|x| x.is_a?(Subnet) }  or
    raise TypeError.new("RDS::SubnetGroup(#{name.inspect}): 2nd argument should be an array of Subnet, but got: #{subnets.inspect}")
  @name = name
  @subnets = subnets
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



342
343
344
# File 'lib/terraformdsl/aws.rb', line 342

def name
  @name
end

#subnetsObject (readonly)

Returns the value of attribute subnets.



342
343
344
# File 'lib/terraformdsl/aws.rb', line 342

def subnets
  @subnets
end

Instance Method Details

#attr(attr) ⇒ Object



344
# File 'lib/terraformdsl/aws.rb', line 344

def attr(attr); "${aws_db_subnet_group.#{@name}.#{attr}}"; end