Class: Awscli::EC2::Vpc

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

Overview

> Spot

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Vpc

Returns a new instance of Vpc.



734
735
736
# File 'lib/awscli/ec2.rb', line 734

def initialize(connection)
  @conn = connection
end

Instance Method Details

#create(options) ⇒ Object



742
743
744
745
# File 'lib/awscli/ec2.rb', line 742

def create(options)
  vpc = @conn.vpcs.create(options)
  puts "Created VPC: #{vpc.id}"
end

#delete(vpc_id) ⇒ Object



747
748
749
750
751
752
# File 'lib/awscli/ec2.rb', line 747

def delete(vpc_id)
  vpc = @conn.vpcs.get(vpc_id)
  abort "cannot find vpc: #{vpc_id}" unless vpc
  vpc.destroy
  puts "Deleted VPC : #{vpc_id}"
end

#listObject



738
739
740
# File 'lib/awscli/ec2.rb', line 738

def list
  @conn.vpcs.table
end