Class: Awsom::Subnet
Instance Method Summary collapse
- #created ⇒ Object
- #id ⇒ Object
-
#initialize(name, cidr:, az:, vpc_id:) ⇒ Subnet
constructor
A new instance of Subnet.
Methods included from Logger
#debug?, #logger, logger, #stderr, stderr
Constructor Details
#initialize(name, cidr:, az:, vpc_id:) ⇒ Subnet
Returns a new instance of Subnet.
8 9 10 11 12 13 |
# File 'lib/awsom/subnet.rb', line 8 def initialize(name, cidr:, az:, vpc_id:) @vpc_id = vpc_id @name = name @cidr = cidr @az = az end |
Instance Method Details
#created ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/awsom/subnet.rb', line 21 def created id = find_id if id subnet = subnet(id) tag(subnet) if not tagged?(subnet) return id end create end |
#id ⇒ Object
15 16 17 18 19 |
# File 'lib/awsom/subnet.rb', line 15 def id id = find_id error "specified subnet #{@name} doesn't exist in vpc #{@vpc_id}" if not id id end |