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

r/aws_route: Call SetId before WaitRouteReady #24024

Merged
merged 13 commits into from
Apr 5, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
d/aws_route: Add 'core_network_arn' argument.
ewbankkit committed Apr 5, 2022
commit 2fe6dfda15eefc332d2e37aa350c9599438818f1
4 changes: 4 additions & 0 deletions .changelog/24024.txt
Original file line number Diff line number Diff line change
@@ -4,4 +4,8 @@ resource/aws_route: Ensure that resource ID is set in case of wait-for-creation

```release-note:enhancement
resource/aws_route: Add `core_network_arn` argument
```

```release-note:enhancement
data-source/aws_route: Add `core_network_arn` argument
```
11 changes: 10 additions & 1 deletion internal/service/ec2/route_data_source.go
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@ func DataSourceRoute() *schema.Resource {
Optional: true,
Computed: true,
},

"destination_prefix_list_id": {
Type: schema.TypeString,
Optional: true,
@@ -48,6 +47,11 @@ func DataSourceRoute() *schema.Resource {
Optional: true,
Computed: true,
},
"core_network_arn": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"egress_only_gateway_id": {
Type: schema.TypeString,
Optional: true,
@@ -132,6 +136,10 @@ func dataSourceRouteRead(d *schema.ResourceData, meta interface{}) error {
continue
}

if v, ok := d.GetOk("core_network_arn"); ok && aws.StringValue(r.CoreNetworkArn) != v.(string) {
continue
}

if v, ok := d.GetOk("egress_only_gateway_id"); ok && aws.StringValue(r.EgressOnlyInternetGatewayId) != v.(string) {
continue
}
@@ -186,6 +194,7 @@ func dataSourceRouteRead(d *schema.ResourceData, meta interface{}) error {
}

d.Set("carrier_gateway_id", route.CarrierGatewayId)
d.Set("core_network_arn", route.CoreNetworkArn)
d.Set("destination_cidr_block", route.DestinationCidrBlock)
d.Set("destination_ipv6_cidr_block", route.DestinationIpv6CidrBlock)
d.Set("destination_prefix_list_id", route.DestinationPrefixListId)
1 change: 1 addition & 0 deletions website/docs/d/route.html.markdown
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ The following arguments are required:
The following arguments are optional:

* `carrier_gateway_id` - (Optional) EC2 Carrier Gateway ID of the Route belonging to the Route Table.
* `core_network_arn` - (Optional) Core network ARN of the Route belonging to the Route Table.
* `destination_cidr_block` - (Optional) CIDR block of the Route belonging to the Route Table.
* `destination_ipv6_cidr_block` - (Optional) IPv6 CIDR block of the Route belonging to the Route Table.
* `destination_prefix_list_id` - (Optional) The ID of a [managed prefix list](ec2_managed_prefix_list.html) destination of the Route belonging to the Route Table.