Class: Awscli::EC2::Subnet

Inherits:
Object
  • Object
show all
Defined in:
lib/awscli/ec2.rb

Overview

> Vpc

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Subnet

Returns a new instance of Subnet.



756
757
758
# File 'lib/awscli/ec2.rb', line 756

def initialize(connection)
  @conn = connection
end

Instance Method Details

#create(options) ⇒ Object



764
765
766
767
# File 'lib/awscli/ec2.rb', line 764

def create(options)
  subnet = @conn.subnets.create(options)
  puts "Created Subnet: #{subnet.id}"
end

#delete(subnet_id) ⇒ Object



769
770
771
772
773
774
# File 'lib/awscli/ec2.rb', line 769

def delete(subnet_id)
  subnet = @conn.subnets.get(subnet_id)
  abort "Cannot find subnet: #{subnet_id}" unless subnet
  subnet.destroy
  puts "Deleted subnet: #{subnet_id}"
end

#listObject



760
761
762
# File 'lib/awscli/ec2.rb', line 760

def list
  @conn.subnets.table
end