Skip to content

Commit

Permalink
dump: include AWS route table objects
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Nov 1, 2023
1 parent 86f808f commit e02562a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/resources/aws/routetable.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,22 @@ func ListRouteTables(cloud fi.Cloud, vpcID, clusterName string) ([]*resources.Re
return resourceTrackers, nil
}

func dumpRouteTable(op *resources.DumpOperation, r *resources.Resource) error {
data := make(map[string]interface{})
data["id"] = r.ID
data["type"] = r.Type
data["raw"] = r.Obj
op.Dump.Resources = append(op.Dump.Resources, data)
return nil
}

func buildTrackerForRouteTable(rt *ec2.RouteTable, clusterName string) *resources.Resource {
resourceTracker := &resources.Resource{
Name: FindName(rt.Tags),
ID: aws.StringValue(rt.RouteTableId),
Type: ec2.ResourceTypeRouteTable,
Obj: rt,
Dumper: dumpRouteTable,
Deleter: DeleteRouteTable,
Shared: !HasOwnedTag(ec2.ResourceTypeRouteTable+":"+*rt.RouteTableId, rt.Tags, clusterName),
}
Expand Down

0 comments on commit e02562a

Please sign in to comment.