Class: Awsom::Vpc

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/awsom/vpc.rb

Instance Method Summary collapse

Methods included from Logger

#debug?, #logger, logger, #stderr, stderr

Constructor Details

#initialize(name, cidr:) ⇒ Vpc

Returns a new instance of Vpc.



8
9
10
11
# File 'lib/awsom/vpc.rb', line 8

def initialize(name, cidr:)
  @name = name
  @cidr = cidr
end

Instance Method Details

#createdObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/awsom/vpc.rb', line 19

def created
  id = find_id
  if id
    vpc = vpc(id)
    tag(vpc) if not tagged?(vpc)
    id
  else
    create
  end
end

#idObject



13
14
15
16
17
# File 'lib/awsom/vpc.rb', line 13

def id
  id = find_id
  error "specified vpc #{@name} doesn't exist" if not id
  id
end