2
// goamz - Go packages to interact with the Amazon Web Services.
4
// https://wiki.ubuntu.com/goamz
6
// Copyright (c) 2015 Canonical Ltd.
15
// RouteTableAssociation describes an association between a route table and a subnet.
17
// See http://goo.gl/ZgrG5j for more details.
18
type RouteTableAssociation struct {
19
// Id is the route table association id.
20
Id string `xml:"routeTableAssociationId"`
22
// TableId is the route table id for this association.
23
TableId string `xml:"routeTableId"`
25
// SubnetId is the subnet id (only when explicitly associated).
26
SubnetId string `xml:"subnetId"`
28
// IsMain indicates whether this is the main route table.
29
IsMain bool `xml:"main"`
32
// Route describes a single route in a route table.
34
// See http://goo.gl/GlW6ii for more details.
36
// DestinationCIDRBlock is used for destination matching.
37
DestinationCIDRBlock string `xml:"destinationCidrBlock"`
39
// DestinationPrefixListId is the prefix of the AWS service.
40
DestinationPrefixListId string `xml:"destinationPrefixListId"`
42
// GatewayId is the id of an Internet Gateway attached to the VPC.
43
GatewayId string `xml:"gatewayId"`
45
// InstanceId is the id of a NAT instance in the VPC.
46
InstanceId string `xml:"instanceId"`
48
// InstanceOwnerId is the AWS account id of the NAT instance
50
InstanceOwnerId string `xml:"instanceOwnerId"`
52
// InterfaceId is the id of the used Network Interface.
53
InterfaceId string `xml:"networkInterfaceId"`
55
// Origin describes how the route was created.
56
// Values: CreateRouteTable | CreateRoute | EnableVgwRoutePropagation
57
Origin string `xml:"origin"`
59
// State is the state of the route. The blackhole state indicates
60
// the route target isn't available (e.g. IGW isn't attached or
61
// NAT instance not found).
62
State string `xml:"state"`
64
// VPCPeeringConnectionId is the id of the VPC peering connection.
65
VPCPeeringConnectionId string `xml:"vpcPeeringConnectionId"`
68
// RouteTable describes a VPC route table.
70
// See http://goo.gl/h0bwYw for more details.
71
type RouteTable struct {
72
// Id is the id of the Internet Gateway (IGW).
73
Id string `xml:"routeTableId"`
75
// VPCId is the id of the VPC this route table is attached to.
76
VPCId string `xml:"vpcId"`
78
// Associations holds associations between the route table and one
80
Associations []RouteTableAssociation `xml:"associationSet>item"`
82
// Routes holds all route table routes.
83
Routes []Route `xml:"routeSet>item"`
85
// Tags holds any tags associated with the IGW.
86
Tags []Tag `xml:"tagSet>item"`
88
// PropagatingVGWIds holds a list of ids of propagating virtual
90
PropagatingVGWIds []string `xml:"propagatingVgws>gatewayId"`
93
// RouteTablesResp is the response to a RouteTables request.
95
// See http://goo.gl/1JZIfO for more details.
96
type RouteTablesResp struct {
97
RequestId string `xml:"requestId"`
98
Tables []RouteTable `xml:"routeTableSet>item"`
101
// RouteTables describes one or more route tables.
102
// Both parameters are optional, and if specified will limit the
103
// returned tables to the matching ids or filtering rules.
105
// See http://goo.gl/1JZIfO for more details.
106
func (ec2 *EC2) RouteTables(ids []string, filter *Filter) (resp *RouteTablesResp, err error) {
107
params := makeParams("DescribeRouteTables")
108
for i, id := range ids {
109
params["RouteTableId."+strconv.Itoa(i+1)] = id
111
filter.addParams(params)
113
resp = &RouteTablesResp{}
114
err = ec2.query(params, resp)