diff --git a/.changelog/22664.txt b/.changelog/22664.txt new file mode 100644 index 00000000000..5a7cde63858 --- /dev/null +++ b/.changelog/22664.txt @@ -0,0 +1,7 @@ +```release-note:note +resource/aws_route: The `instance_id` argument has been deprecated. All configurations using `instance_id` should be updated to use the `network_interface_id` argument instead +``` + +```release-note:note +resource/aws_route_table: The `instance_id` argument of the `route` configuration block has been deprecated. All configurations using `route` `instance_id` should be updated to use the `route` `network_interface_id` argument instead +``` \ No newline at end of file diff --git a/internal/service/ec2/route.go b/internal/service/ec2/route.go index 91cc643f8f7..445f5b5c720 100644 --- a/internal/service/ec2/route.go +++ b/internal/service/ec2/route.go @@ -110,6 +110,7 @@ func ResourceRoute() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, + Deprecated: "Use network_interface_id instead", ExactlyOneOf: routeValidTargets, }, "local_gateway_id": { diff --git a/internal/service/ec2/route_table.go b/internal/service/ec2/route_table.go index fd40abb9f7c..d479c1a5b72 100644 --- a/internal/service/ec2/route_table.go +++ b/internal/service/ec2/route_table.go @@ -121,8 +121,9 @@ func ResourceRouteTable() *schema.Resource { Optional: true, }, "instance_id": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + Deprecated: "Use network_interface_id instead", }, "local_gateway_id": { Type: schema.TypeString, diff --git a/website/docs/r/route.html.markdown b/website/docs/r/route.html.markdown index 42ca414ded4..12702130c5a 100644 --- a/website/docs/r/route.html.markdown +++ b/website/docs/r/route.html.markdown @@ -61,7 +61,7 @@ One of the following target arguments must be supplied: * `carrier_gateway_id` - (Optional) Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone. * `egress_only_gateway_id` - (Optional) Identifier of a VPC Egress Only Internet Gateway. * `gateway_id` - (Optional) Identifier of a VPC internet gateway or a virtual private gateway. -* `instance_id` - (Optional) Identifier of an EC2 instance. +* `instance_id` - (Optional, **Deprecated** use `network_interface_id` instead) Identifier of an EC2 instance. * `nat_gateway_id` - (Optional) Identifier of a VPC NAT gateway. * `local_gateway_id` - (Optional) Identifier of a Outpost local gateway. * `network_interface_id` - (Optional) Identifier of an EC2 network interface. diff --git a/website/docs/r/route_table.html.markdown b/website/docs/r/route_table.html.markdown index 37779a3df5a..2ad02c9968e 100644 --- a/website/docs/r/route_table.html.markdown +++ b/website/docs/r/route_table.html.markdown @@ -90,7 +90,7 @@ One of the following target arguments must be supplied: * `carrier_gateway_id` - (Optional) Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone. * `egress_only_gateway_id` - (Optional) Identifier of a VPC Egress Only Internet Gateway. * `gateway_id` - (Optional) Identifier of a VPC internet gateway or a virtual private gateway. -* `instance_id` - (Optional) Identifier of an EC2 instance. +* `instance_id` - (Optional, **Deprecated** use `network_interface_id` instead) Identifier of an EC2 instance. * `local_gateway_id` - (Optional) Identifier of a Outpost local gateway. * `nat_gateway_id` - (Optional) Identifier of a VPC NAT gateway. * `network_interface_id` - (Optional) Identifier of an EC2 network interface.