Skip to content

Add parameterized resource identity to aws_route_table #43990

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented Aug 21, 2025

Description

Adds resource identity support to the aws_route_table resource. This is a parameterized resource with a single attribute, id, corresponding to the route table ID generated by AWS during creation.

The identity based import section in the registry documentation is adapted from the template used in the tfplugindocs tooling. See hashicorp/terraform-plugin-docs#496.

Relations

Relates #42983
Relates #42988

Output from Acceptance Testing

% make testacc PKG=vpc TESTS=TestAccVPCRouteTable_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.6 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCRouteTable_'  -timeout 360m -vet=off
2025/08/21 13:17:04 Creating Terraform AWS Provider (SDKv2-style)...
2025/08/21 13:17:04 Initializing Terraform AWS Provider (SDKv2-style)...

=== NAME  TestAccVPCRouteTable_ipv4ToCarrierGateway
    wavelength_carrier_gateway_test.go:198: skipping since no Wavelength Zones are available
--- SKIP: TestAccVPCRouteTable_ipv4ToCarrierGateway (0.97s)
=== CONT  TestAccVPCRouteTable_Disappears_subnetAssociation
=== NAME  TestAccVPCRouteTable_ipv4ToLocalGateway
    vpc_route_table_test.go:495: skipping since no Outposts found
--- SKIP: TestAccVPCRouteTable_ipv4ToLocalGateway (0.97s)
=== CONT  TestAccVPCRouteTable_tags_EmptyMap
--- PASS: TestAccVPCRouteTable_requireRouteTarget (19.75s)
=== CONT  TestAccVPCRouteTable_ipv4ToNatGateway
--- PASS: TestAccVPCRouteTable_disappears (28.20s)
=== CONT  TestAccVPCRouteTable_conditionalCIDRBlock
--- PASS: TestAccVPCRouteTable_Disappears_subnetAssociation (36.47s)
=== CONT  TestAccVPCRouteTable_Identity_ExistingResource
--- PASS: TestAccVPCRouteTable_ipv4ToVPCPeeringConnection (43.15s)
=== CONT  TestAccVPCRouteTable_tags
--- PASS: TestAccVPCRouteTable_gatewayVPCEndpoint (51.46s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_providerOnly
--- PASS: TestAccVPCRouteTable_ipv4ToInternetGateway (54.56s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_overlapping
--- PASS: TestAccVPCRouteTable_IPv6ToNetworkInterface_unattached (57.32s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_nonOverlapping
--- PASS: TestAccVPCRouteTable_Identity_Basic (59.24s)
=== CONT  TestAccVPCRouteTable_Identity_RegionOverride
--- PASS: TestAccVPCRouteTable_vpcMultipleCIDRs (61.01s)
=== CONT  TestAccVPCRouteTable_tags_ComputedTag_OnCreate
--- PASS: TestAccVPCRouteTable_tags_null (62.69s)
=== CONT  TestAccVPCRouteTable_basic
=== CONT  TestAccVPCRouteTable_tags_IgnoreTags_Overlap_ResourceTag
--- PASS: TestAccVPCRouteTable_tags_EmptyMap (62.09s)
--- PASS: TestAccVPCRouteTable_tags_AddOnUpdate (69.31s)
=== CONT  TestAccVPCRouteTable_tags_IgnoreTags_Overlap_DefaultTag
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_updateToProviderOnly (69.89s)
=== CONT  TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Replace
--- PASS: TestAccVPCRouteTable_tags_EmptyTag_OnCreate (71.42s)
=== CONT  TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Add
--- PASS: TestAccVPCRouteTable_ipv6ToEgressOnlyInternetGateway (73.04s)
=== CONT  TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Replace
--- PASS: TestAccVPCRouteTable_Route_mode (95.32s)
=== CONT  TestAccVPCRouteTable_localRoute
--- PASS: TestAccVPCRouteTable_basic (37.07s)
=== CONT  TestAccVPCRouteTable_localRouteImportUpdate
--- PASS: TestAccVPCRouteTable_conditionalCIDRBlock (73.56s)
=== CONT  TestAccVPCRouteTable_localRouteAdoptUpdate
--- PASS: TestAccVPCRouteTable_tags_ComputedTag_OnCreate (41.95s)
=== CONT  TestAccVPCRouteTable_ipv4ToVPCEndpoint
--- PASS: TestAccVPCRouteTable_ipv4ToInstance (104.02s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_emptyProviderOnlyTag
--- PASS: TestAccVPCRouteTable_Identity_RegionOverride (51.99s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_nullNonOverlappingResourceTag
--- PASS: TestAccVPCRouteTable_IPv4ToNetworkInterfaces_unattached (113.85s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_nullOverlappingResourceTag
--- PASS: TestAccVPCRouteTable_Identity_ExistingResource (78.37s)
=== CONT  TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Add
--- PASS: TestAccVPCRouteTable_localRoute (39.07s)
=== CONT  TestAccVPCRouteTable_ipv4ToTransitGateway
--- PASS: TestAccVPCRouteTable_requireRouteDestination (138.48s)
=== CONT  TestAccVPCRouteTable_prefixListToInternetGateway
--- PASS: TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Replace (69.80s)
=== CONT  TestAccVPCRouteTable_multipleRoutes
--- PASS: TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Replace (70.14s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_emptyResourceTag
--- PASS: TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Add (73.52s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_updateToResourceOnly
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_emptyProviderOnlyTag (43.76s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_nullNonOverlappingResourceTag (40.17s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_nullOverlappingResourceTag (41.32s)
--- PASS: TestAccVPCRouteTable_tags_IgnoreTags_Overlap_DefaultTag (86.41s)
--- PASS: TestAccVPCRouteTable_tags_IgnoreTags_Overlap_ResourceTag (93.90s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_nonOverlapping (107.59s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_overlapping (111.61s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_emptyResourceTag (29.39s)
--- PASS: TestAccVPCRouteTable_tags (130.41s)
--- PASS: TestAccVPCRouteTable_prefixListToInternetGateway (36.61s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_providerOnly (127.03s)
--- PASS: TestAccVPCRouteTable_vgwRoutePropagation (178.90s)
--- PASS: TestAccVPCRouteTable_localRouteAdoptUpdate (78.25s)
--- PASS: TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Add (72.19s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_updateToResourceOnly (43.74s)
--- PASS: TestAccVPCRouteTable_localRouteImportUpdate (102.11s)
--- PASS: TestAccVPCRouteTable_ipv4ToNatGateway (197.80s)
--- PASS: TestAccVPCRouteTable_multipleRoutes (143.25s)
--- PASS: TestAccVPCRouteTable_ipv4ToVPCEndpoint (370.55s)
--- PASS: TestAccVPCRouteTable_ipv4ToTransitGateway (399.89s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        540.977s

Copy link
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

Adds resource identity support to the `aws_route_table` resource. This
is a parameterized resource with a single attribute, `id`, corresponding
to the route table ID generated by AWS during creation.

```console
% make testacc PKG=vpc TESTS=TestAccVPCRouteTable_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.6 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCRouteTable_'  -timeout 360m -vet=off
2025/08/21 13:17:04 Creating Terraform AWS Provider (SDKv2-style)...
2025/08/21 13:17:04 Initializing Terraform AWS Provider (SDKv2-style)...

=== NAME  TestAccVPCRouteTable_ipv4ToCarrierGateway
    wavelength_carrier_gateway_test.go:198: skipping since no Wavelength Zones are available
--- SKIP: TestAccVPCRouteTable_ipv4ToCarrierGateway (0.97s)
=== CONT  TestAccVPCRouteTable_Disappears_subnetAssociation
=== NAME  TestAccVPCRouteTable_ipv4ToLocalGateway
    vpc_route_table_test.go:495: skipping since no Outposts found
--- SKIP: TestAccVPCRouteTable_ipv4ToLocalGateway (0.97s)
=== CONT  TestAccVPCRouteTable_tags_EmptyMap
--- PASS: TestAccVPCRouteTable_requireRouteTarget (19.75s)
=== CONT  TestAccVPCRouteTable_ipv4ToNatGateway
--- PASS: TestAccVPCRouteTable_disappears (28.20s)
=== CONT  TestAccVPCRouteTable_conditionalCIDRBlock
--- PASS: TestAccVPCRouteTable_Disappears_subnetAssociation (36.47s)
=== CONT  TestAccVPCRouteTable_Identity_ExistingResource
--- PASS: TestAccVPCRouteTable_ipv4ToVPCPeeringConnection (43.15s)
=== CONT  TestAccVPCRouteTable_tags
--- PASS: TestAccVPCRouteTable_gatewayVPCEndpoint (51.46s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_providerOnly
--- PASS: TestAccVPCRouteTable_ipv4ToInternetGateway (54.56s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_overlapping
--- PASS: TestAccVPCRouteTable_IPv6ToNetworkInterface_unattached (57.32s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_nonOverlapping
--- PASS: TestAccVPCRouteTable_Identity_Basic (59.24s)
=== CONT  TestAccVPCRouteTable_Identity_RegionOverride
--- PASS: TestAccVPCRouteTable_vpcMultipleCIDRs (61.01s)
=== CONT  TestAccVPCRouteTable_tags_ComputedTag_OnCreate
--- PASS: TestAccVPCRouteTable_tags_null (62.69s)
=== CONT  TestAccVPCRouteTable_basic
=== CONT  TestAccVPCRouteTable_tags_IgnoreTags_Overlap_ResourceTag
--- PASS: TestAccVPCRouteTable_tags_EmptyMap (62.09s)
--- PASS: TestAccVPCRouteTable_tags_AddOnUpdate (69.31s)
=== CONT  TestAccVPCRouteTable_tags_IgnoreTags_Overlap_DefaultTag
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_updateToProviderOnly (69.89s)
=== CONT  TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Replace
--- PASS: TestAccVPCRouteTable_tags_EmptyTag_OnCreate (71.42s)
=== CONT  TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Add
--- PASS: TestAccVPCRouteTable_ipv6ToEgressOnlyInternetGateway (73.04s)
=== CONT  TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Replace
--- PASS: TestAccVPCRouteTable_Route_mode (95.32s)
=== CONT  TestAccVPCRouteTable_localRoute
--- PASS: TestAccVPCRouteTable_basic (37.07s)
=== CONT  TestAccVPCRouteTable_localRouteImportUpdate
--- PASS: TestAccVPCRouteTable_conditionalCIDRBlock (73.56s)
=== CONT  TestAccVPCRouteTable_localRouteAdoptUpdate
--- PASS: TestAccVPCRouteTable_tags_ComputedTag_OnCreate (41.95s)
=== CONT  TestAccVPCRouteTable_ipv4ToVPCEndpoint
--- PASS: TestAccVPCRouteTable_ipv4ToInstance (104.02s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_emptyProviderOnlyTag
--- PASS: TestAccVPCRouteTable_Identity_RegionOverride (51.99s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_nullNonOverlappingResourceTag
--- PASS: TestAccVPCRouteTable_IPv4ToNetworkInterfaces_unattached (113.85s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_nullOverlappingResourceTag
--- PASS: TestAccVPCRouteTable_Identity_ExistingResource (78.37s)
=== CONT  TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Add
--- PASS: TestAccVPCRouteTable_localRoute (39.07s)
=== CONT  TestAccVPCRouteTable_ipv4ToTransitGateway
--- PASS: TestAccVPCRouteTable_requireRouteDestination (138.48s)
=== CONT  TestAccVPCRouteTable_prefixListToInternetGateway
--- PASS: TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Replace (69.80s)
=== CONT  TestAccVPCRouteTable_multipleRoutes
--- PASS: TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Replace (70.14s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_emptyResourceTag
--- PASS: TestAccVPCRouteTable_tags_ComputedTag_OnUpdate_Add (73.52s)
=== CONT  TestAccVPCRouteTable_tags_DefaultTags_updateToResourceOnly
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_emptyProviderOnlyTag (43.76s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_nullNonOverlappingResourceTag (40.17s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_nullOverlappingResourceTag (41.32s)
--- PASS: TestAccVPCRouteTable_tags_IgnoreTags_Overlap_DefaultTag (86.41s)
--- PASS: TestAccVPCRouteTable_tags_IgnoreTags_Overlap_ResourceTag (93.90s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_nonOverlapping (107.59s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_overlapping (111.61s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_emptyResourceTag (29.39s)
--- PASS: TestAccVPCRouteTable_tags (130.41s)
--- PASS: TestAccVPCRouteTable_prefixListToInternetGateway (36.61s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_providerOnly (127.03s)
--- PASS: TestAccVPCRouteTable_vgwRoutePropagation (178.90s)
--- PASS: TestAccVPCRouteTable_localRouteAdoptUpdate (78.25s)
--- PASS: TestAccVPCRouteTable_tags_EmptyTag_OnUpdate_Add (72.19s)
--- PASS: TestAccVPCRouteTable_tags_DefaultTags_updateToResourceOnly (43.74s)
--- PASS: TestAccVPCRouteTable_localRouteImportUpdate (102.11s)
--- PASS: TestAccVPCRouteTable_ipv4ToNatGateway (197.80s)
--- PASS: TestAccVPCRouteTable_multipleRoutes (143.25s)
--- PASS: TestAccVPCRouteTable_ipv4ToVPCEndpoint (370.55s)
--- PASS: TestAccVPCRouteTable_ipv4ToTransitGateway (399.89s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        540.977s
```
@jar-b jar-b force-pushed the f-ri-route_table branch from 46270d8 to 9fa97f7 Compare August 21, 2025 17:28
@jar-b jar-b added the resource-identity Pertains to resource identity. label Aug 21, 2025
@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. generators Relates to code generators. service/vpc Issues and PRs that pertain to the vpc service. size/XL Managed by automation to categorize the size of a PR. labels Aug 21, 2025
@jar-b jar-b marked this pull request as ready for review August 21, 2025 18:34
@jar-b jar-b requested a review from a team as a code owner August 21, 2025 18:34
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. generators Relates to code generators. resource-identity Pertains to resource identity. service/vpc Issues and PRs that pertain to the vpc service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant