class Vaws::Aws::SubnetDescriber

Attributes

term_table[R]

Public Class Methods

new() click to toggle source
# File lib/vaws/aws/subnet_describer.rb, line 9
def initialize
  @subnet_client = ::Aws::EC2::Client.new
  @term_table    = ''
end

Public Instance Methods

set_basic_info() click to toggle source
# File lib/vaws/aws/subnet_describer.rb, line 14
def set_basic_info
  rows       = []
  next_token = nil

  begin
    param_args              = {
      max_results: 100
    }
    param_args[:next_token] = next_token if next_token
    resp                    = @subnet_client.describe_subnets(param_args)
    resp.subnets.each do |subnet|
      az        = subnet.availability_zone
      cidr      = subnet.cidr_block
      subnet_id = subnet.subnet_id
      vpc_id    = subnet.vpc_id
      rows << [cidr, subnet_id, az, vpc_id]
    end
    next_token = resp.next_token
  end while next_token
  @term_table = Terminal::Table.new :headings => ['Cidr', 'SubnetId', 'Az', 'VpcId'], :rows => rows.sort
end