Class: Serverspec::Type::AWS::EC2::RouteTable

Inherits:
Base
  • Object
show all
Defined in:
lib/resources/ec2/route_table.rb

Overview

The RouteTable class exposes the EC2::RouteTable resources

Instance Method Summary collapse

Constructor Details

#initialize(rtb_id, instance = nil) ⇒ RouteTable

AWS SDK for Ruby v2 Aws::EC2::Client wrapper for initializing a RouteTable resource

Parameters:

  • rtb_id (String)

    The ID of the RouteTable

  • instance (Class) (defaults to: nil)

    Aws::EC2::Client instance

Raises:

  • (RuntimeError)

    if rtbs.nil?

  • (RuntimeError)

    if rtbs.length == 0

  • (RuntimeError)

    if rtbs.length > 1



15
16
17
18
19
20
# File 'lib/resources/ec2/route_table.rb', line 15

def initialize(rtb_id, instance = nil)
  check_init_arg 'rtb_id', 'EC2::RouteTable', rtb_id
  @rtb_id = rtb_id
  @aws = instance.nil? ? Aws::EC2::Client.new : instance
  get_rtb rtb_id
end

Instance Method Details

#associationsArray(Hash)

The associations between the route table and one or more subnets

Returns:

  • (Array(Hash))


42
43
44
# File 'lib/resources/ec2/route_table.rb', line 42

def associations
  @rtb.associations
end

#propagating_vgwsArray(Hash)

Any virtual private gateway (VGW) propagating routes

Returns:

  • (Array(Hash))


54
55
56
# File 'lib/resources/ec2/route_table.rb', line 54

def propagating_vgws
  @rtb.propagating_vgws
end

#routesArray(Hash)

The routes in the route table

Returns:

  • (Array(Hash))


36
37
38
# File 'lib/resources/ec2/route_table.rb', line 36

def routes
  @rtb.routes
end

#tagsArray(Hash)

Any tags assigned to the route table

Returns:

  • (Array(Hash))


48
49
50
# File 'lib/resources/ec2/route_table.rb', line 48

def tags
  @rtb.tags
end

#to_sString

Returns the string representation of EC2::RouteTable

Returns:

  • (String)


24
25
26
# File 'lib/resources/ec2/route_table.rb', line 24

def to_s
  "EC2 RouteTable: #{@rtb_id}"
end

#vpc_idString

The ID of the VPC

Returns:

  • (String)


30
31
32
# File 'lib/resources/ec2/route_table.rb', line 30

def vpc_id
  @rtb.vpc_id
end