Skip to content

Commit

Permalink
r/aws_route: Incorporate relevant changes from hashicorp#16219.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Mar 29, 2021
1 parent 19b8055 commit 8aa6b12
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions aws/data_source_aws_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,16 @@ func dataSourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error {

return nil
}

// Helper: Create an ID for a route
func resourceAwsRouteID(d *schema.ResourceData, r *ec2.Route) string {
routeTableID := d.Get("route_table_id").(string)

if destination := aws.StringValue(r.DestinationCidrBlock); destination != "" {
return tfec2.RouteCreateID(routeTableID, destination)
} else if destination := aws.StringValue(r.DestinationIpv6CidrBlock); destination != "" {
return tfec2.RouteCreateID(routeTableID, destination)
}

return ""
}

0 comments on commit 8aa6b12

Please sign in to comment.