class DrawCloud::Vpc

Attributes

cidr[RW]
name[RW]

Public Class Methods

new(name, cidr, options={}, &block) click to toggle source
Calls superclass method DrawCloud::Base::new
# File lib/draw_cloud/vpc.rb, line 24
def initialize(name, cidr, options={}, &block)
  @name = name
  @cidr = cidr
  super(options, &block)
end

Public Instance Methods

gateway!() click to toggle source
# File lib/draw_cloud/vpc.rb, line 34
def gateway!
  if gateways.empty?
    gateways << InternetGateway.new("InternetGateway", :parent => self)
  end
  gateways.first
end
load_into_config(config) click to toggle source
Calls superclass method DrawCloud::Base#load_into_config
# File lib/draw_cloud/vpc.rb, line 41
def load_into_config(config)
  config.cf_add_resource resource_name, self
  super(config)
end
to_h() click to toggle source
# File lib/draw_cloud/vpc.rb, line 46
def to_h
  h = {
    "Type" => "AWS::EC2::VPC",
    "Properties" => {
      "CidrBlock" => cidr,
      "InstanceTenancy" => "default",
    }
  }
  add_standard_properties(h)
end
vpc() click to toggle source
# File lib/draw_cloud/vpc.rb, line 30
def vpc
  self
end