Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d/aws_route_table: 'destination_prefix_list_id' attribute set for managed prefix list destinations #17347

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/17347.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-notes:enhancement
data-source/aws_route_table: Add `destination_prefix_list_id` attribute
```
10 changes: 9 additions & 1 deletion aws/data_source_aws_route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ func dataSourceAwsRouteTable() *schema.Resource {
Computed: true,
},

"destination_prefix_list_id": {
Type: schema.TypeString,
Computed: true,
},

///
// Targets.
///
Expand Down Expand Up @@ -246,7 +251,7 @@ func dataSourceRoutesRead(ec2Routes []*ec2.Route) []map[string]interface{} {
continue
}

if r.DestinationPrefixListId != nil {
if r.DestinationPrefixListId != nil && strings.HasPrefix(aws.StringValue(r.GatewayId), "vpce-") {
// Skipping because VPC endpoint routes are handled separately
// See aws_vpc_endpoint
continue
Expand All @@ -260,6 +265,9 @@ func dataSourceRoutesRead(ec2Routes []*ec2.Route) []map[string]interface{} {
if r.DestinationIpv6CidrBlock != nil {
m["ipv6_cidr_block"] = *r.DestinationIpv6CidrBlock
}
if r.DestinationPrefixListId != nil {
m["destination_prefix_list_id"] = *r.DestinationPrefixListId
}
if r.CarrierGatewayId != nil {
m["carrier_gateway_id"] = *r.CarrierGatewayId
}
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/route_table.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ When relevant, routes are also exported with the following attributes:
For destinations:

* `cidr_block` - CIDR block of the route.
* `destination_prefix_list_id` - The ID of a [managed prefix list](ec2_managed_prefix_list.html) destination of the route.
* `ipv6_cidr_block` - IPv6 CIDR block of the route.

For targets:
Expand Down