-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Conversation
When the route's wait-for-creation operation times out, its state is leaked as `d.SetId(...)` is called after the `WaitRouteReady(...)`. So, the next time the configuration is applied, the Terraform engine tries to create the same route again, getting duplication error from AWS. Call `d.SetId(...)` before `WaitRouteReady(...)`. Fixes: hashicorp#23827
Issue: When the route's wait-for-creation operation times out, its state is leaked as `d.SetId(...)` is called after the `WaitRouteReady(...)`. So, the next time the configuration is applied, the Terraform engine tries to create the same route again, getting duplication error from AWS. Fix: Call `d.SetId(...)` before `WaitRouteReady(...)`. Fixes: hashicorp#23827
…aws into issue-23827
… configuration block.
…ment_arn' attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccEC2Route\|TestAccEC2DefaultRouteTable\|TestAccEC2VPNConnection_basic' PKG=ec2 ACCTEST_PARALLELISM=2 ACCTEST_TIMEOUT=720m
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2 -run=TestAccEC2Route\|TestAccEC2DefaultRouteTable\|TestAccEC2VPNConnection_basic -timeout 720m
=== RUN TestAccEC2DefaultRouteTable_basic
=== PAUSE TestAccEC2DefaultRouteTable_basic
=== RUN TestAccEC2DefaultRouteTable_Disappears_vpc
=== PAUSE TestAccEC2DefaultRouteTable_Disappears_vpc
=== RUN TestAccEC2DefaultRouteTable_Route_mode
=== PAUSE TestAccEC2DefaultRouteTable_Route_mode
=== RUN TestAccEC2DefaultRouteTable_swap
=== PAUSE TestAccEC2DefaultRouteTable_swap
=== RUN TestAccEC2DefaultRouteTable_ipv4ToTransitGateway
=== PAUSE TestAccEC2DefaultRouteTable_ipv4ToTransitGateway
=== RUN TestAccEC2DefaultRouteTable_ipv4ToVPCEndpoint
=== PAUSE TestAccEC2DefaultRouteTable_ipv4ToVPCEndpoint
=== RUN TestAccEC2DefaultRouteTable_vpcEndpointAssociation
=== PAUSE TestAccEC2DefaultRouteTable_vpcEndpointAssociation
=== RUN TestAccEC2DefaultRouteTable_tags
=== PAUSE TestAccEC2DefaultRouteTable_tags
=== RUN TestAccEC2DefaultRouteTable_conditionalCIDRBlock
=== PAUSE TestAccEC2DefaultRouteTable_conditionalCIDRBlock
=== RUN TestAccEC2DefaultRouteTable_prefixListToInternetGateway
=== PAUSE TestAccEC2DefaultRouteTable_prefixListToInternetGateway
=== RUN TestAccEC2DefaultRouteTable_revokeExistingRules
=== PAUSE TestAccEC2DefaultRouteTable_revokeExistingRules
=== RUN TestAccEC2RouteDataSource_basic
=== PAUSE TestAccEC2RouteDataSource_basic
=== RUN TestAccEC2RouteDataSource_transitGatewayID
=== PAUSE TestAccEC2RouteDataSource_transitGatewayID
=== RUN TestAccEC2RouteDataSource_ipv6DestinationCIDR
=== PAUSE TestAccEC2RouteDataSource_ipv6DestinationCIDR
=== RUN TestAccEC2RouteDataSource_localGatewayID
=== PAUSE TestAccEC2RouteDataSource_localGatewayID
=== RUN TestAccEC2RouteDataSource_carrierGatewayID
=== PAUSE TestAccEC2RouteDataSource_carrierGatewayID
=== RUN TestAccEC2RouteDataSource_destinationPrefixListID
=== PAUSE TestAccEC2RouteDataSource_destinationPrefixListID
=== RUN TestAccEC2RouteDataSource_gatewayVPCEndpoint
=== PAUSE TestAccEC2RouteDataSource_gatewayVPCEndpoint
=== RUN TestAccEC2RouteTableAssociation_Subnet_basic
=== PAUSE TestAccEC2RouteTableAssociation_Subnet_basic
=== RUN TestAccEC2RouteTableAssociation_Subnet_changeRouteTable
=== PAUSE TestAccEC2RouteTableAssociation_Subnet_changeRouteTable
=== RUN TestAccEC2RouteTableAssociation_Gateway_basic
=== PAUSE TestAccEC2RouteTableAssociation_Gateway_basic
=== RUN TestAccEC2RouteTableAssociation_Gateway_changeRouteTable
=== PAUSE TestAccEC2RouteTableAssociation_Gateway_changeRouteTable
=== RUN TestAccEC2RouteTableAssociation_disappears
=== PAUSE TestAccEC2RouteTableAssociation_disappears
=== RUN TestAccEC2RouteTableDataSource_basic
=== PAUSE TestAccEC2RouteTableDataSource_basic
=== RUN TestAccEC2RouteTableDataSource_main
=== PAUSE TestAccEC2RouteTableDataSource_main
=== RUN TestAccEC2RouteTable_basic
=== PAUSE TestAccEC2RouteTable_basic
=== RUN TestAccEC2RouteTable_disappears
=== PAUSE TestAccEC2RouteTable_disappears
=== RUN TestAccEC2RouteTable_Disappears_subnetAssociation
=== PAUSE TestAccEC2RouteTable_Disappears_subnetAssociation
=== RUN TestAccEC2RouteTable_ipv4ToInternetGateway
=== PAUSE TestAccEC2RouteTable_ipv4ToInternetGateway
=== RUN TestAccEC2RouteTable_ipv4ToInstance
=== PAUSE TestAccEC2RouteTable_ipv4ToInstance
=== RUN TestAccEC2RouteTable_ipv6ToEgressOnlyInternetGateway
=== PAUSE TestAccEC2RouteTable_ipv6ToEgressOnlyInternetGateway
=== RUN TestAccEC2RouteTable_tags
=== PAUSE TestAccEC2RouteTable_tags
=== RUN TestAccEC2RouteTable_requireRouteDestination
=== PAUSE TestAccEC2RouteTable_requireRouteDestination
=== RUN TestAccEC2RouteTable_requireRouteTarget
=== PAUSE TestAccEC2RouteTable_requireRouteTarget
=== RUN TestAccEC2RouteTable_Route_mode
=== PAUSE TestAccEC2RouteTable_Route_mode
=== RUN TestAccEC2RouteTable_ipv4ToTransitGateway
=== PAUSE TestAccEC2RouteTable_ipv4ToTransitGateway
=== RUN TestAccEC2RouteTable_ipv4ToVPCEndpoint
=== PAUSE TestAccEC2RouteTable_ipv4ToVPCEndpoint
=== RUN TestAccEC2RouteTable_ipv4ToCarrierGateway
=== PAUSE TestAccEC2RouteTable_ipv4ToCarrierGateway
=== RUN TestAccEC2RouteTable_ipv4ToLocalGateway
=== PAUSE TestAccEC2RouteTable_ipv4ToLocalGateway
=== RUN TestAccEC2RouteTable_ipv4ToVPCPeeringConnection
=== PAUSE TestAccEC2RouteTable_ipv4ToVPCPeeringConnection
=== RUN TestAccEC2RouteTable_vgwRoutePropagation
=== PAUSE TestAccEC2RouteTable_vgwRoutePropagation
=== RUN TestAccEC2RouteTable_conditionalCIDRBlock
=== PAUSE TestAccEC2RouteTable_conditionalCIDRBlock
=== RUN TestAccEC2RouteTable_ipv4ToNatGateway
=== PAUSE TestAccEC2RouteTable_ipv4ToNatGateway
=== RUN TestAccEC2RouteTable_IPv6ToNetworkInterface_unattached
=== PAUSE TestAccEC2RouteTable_IPv6ToNetworkInterface_unattached
=== RUN TestAccEC2RouteTable_IPv4ToNetworkInterfaces_unattached
=== PAUSE TestAccEC2RouteTable_IPv4ToNetworkInterfaces_unattached
=== RUN TestAccEC2RouteTable_vpcMultipleCIDRs
=== PAUSE TestAccEC2RouteTable_vpcMultipleCIDRs
=== RUN TestAccEC2RouteTable_vpcClassicLink
=== PAUSE TestAccEC2RouteTable_vpcClassicLink
=== RUN TestAccEC2RouteTable_gatewayVPCEndpoint
=== PAUSE TestAccEC2RouteTable_gatewayVPCEndpoint
=== RUN TestAccEC2RouteTable_multipleRoutes
=== PAUSE TestAccEC2RouteTable_multipleRoutes
=== RUN TestAccEC2RouteTable_prefixListToInternetGateway
=== PAUSE TestAccEC2RouteTable_prefixListToInternetGateway
=== RUN TestAccEC2RouteTablesDataSource_basic
=== PAUSE TestAccEC2RouteTablesDataSource_basic
=== RUN TestAccEC2Route_basic
=== PAUSE TestAccEC2Route_basic
=== RUN TestAccEC2Route_disappears
=== PAUSE TestAccEC2Route_disappears
=== RUN TestAccEC2Route_Disappears_routeTable
=== PAUSE TestAccEC2Route_Disappears_routeTable
=== RUN TestAccEC2Route_ipv6ToEgressOnlyInternetGateway
=== PAUSE TestAccEC2Route_ipv6ToEgressOnlyInternetGateway
=== RUN TestAccEC2Route_ipv6ToInternetGateway
=== PAUSE TestAccEC2Route_ipv6ToInternetGateway
=== RUN TestAccEC2Route_ipv6ToInstance
=== PAUSE TestAccEC2Route_ipv6ToInstance
=== RUN TestAccEC2Route_IPv6ToNetworkInterface_unattached
=== PAUSE TestAccEC2Route_IPv6ToNetworkInterface_unattached
=== RUN TestAccEC2Route_ipv6ToVPCPeeringConnection
=== PAUSE TestAccEC2Route_ipv6ToVPCPeeringConnection
=== RUN TestAccEC2Route_ipv6ToVPNGateway
=== PAUSE TestAccEC2Route_ipv6ToVPNGateway
=== RUN TestAccEC2Route_ipv4ToVPNGateway
=== PAUSE TestAccEC2Route_ipv4ToVPNGateway
=== RUN TestAccEC2Route_ipv4ToInstance
=== PAUSE TestAccEC2Route_ipv4ToInstance
=== RUN TestAccEC2Route_IPv4ToNetworkInterface_unattached
=== PAUSE TestAccEC2Route_IPv4ToNetworkInterface_unattached
=== RUN TestAccEC2Route_IPv4ToNetworkInterface_attached
=== PAUSE TestAccEC2Route_IPv4ToNetworkInterface_attached
=== RUN TestAccEC2Route_IPv4ToNetworkInterface_twoAttachments
=== PAUSE TestAccEC2Route_IPv4ToNetworkInterface_twoAttachments
=== RUN TestAccEC2Route_ipv4ToVPCPeeringConnection
=== PAUSE TestAccEC2Route_ipv4ToVPCPeeringConnection
=== RUN TestAccEC2Route_ipv4ToNatGateway
=== PAUSE TestAccEC2Route_ipv4ToNatGateway
=== RUN TestAccEC2Route_ipv6ToNatGateway
=== PAUSE TestAccEC2Route_ipv6ToNatGateway
=== RUN TestAccEC2Route_doesNotCrashWithVPCEndpoint
=== PAUSE TestAccEC2Route_doesNotCrashWithVPCEndpoint
=== RUN TestAccEC2Route_ipv4ToTransitGateway
=== PAUSE TestAccEC2Route_ipv4ToTransitGateway
=== RUN TestAccEC2Route_ipv6ToTransitGateway
=== PAUSE TestAccEC2Route_ipv6ToTransitGateway
=== RUN TestAccEC2Route_ipv4ToCarrierGateway
=== PAUSE TestAccEC2Route_ipv4ToCarrierGateway
=== RUN TestAccEC2Route_ipv4ToLocalGateway
=== PAUSE TestAccEC2Route_ipv4ToLocalGateway
=== RUN TestAccEC2Route_ipv6ToLocalGateway
=== PAUSE TestAccEC2Route_ipv6ToLocalGateway
=== RUN TestAccEC2Route_conditionalCIDRBlock
=== PAUSE TestAccEC2Route_conditionalCIDRBlock
=== RUN TestAccEC2Route_IPv4Update_target
=== PAUSE TestAccEC2Route_IPv4Update_target
=== RUN TestAccEC2Route_IPv6Update_target
=== PAUSE TestAccEC2Route_IPv6Update_target
=== RUN TestAccEC2Route_ipv4ToVPCEndpoint
=== PAUSE TestAccEC2Route_ipv4ToVPCEndpoint
=== RUN TestAccEC2Route_localRoute
=== PAUSE TestAccEC2Route_localRoute
=== RUN TestAccEC2Route_prefixListToInternetGateway
=== PAUSE TestAccEC2Route_prefixListToInternetGateway
=== RUN TestAccEC2Route_prefixListToVPNGateway
=== PAUSE TestAccEC2Route_prefixListToVPNGateway
=== RUN TestAccEC2Route_prefixListToInstance
=== PAUSE TestAccEC2Route_prefixListToInstance
=== RUN TestAccEC2Route_PrefixListToNetworkInterface_unattached
=== PAUSE TestAccEC2Route_PrefixListToNetworkInterface_unattached
=== RUN TestAccEC2Route_PrefixListToNetworkInterface_attached
=== PAUSE TestAccEC2Route_PrefixListToNetworkInterface_attached
=== RUN TestAccEC2Route_prefixListToVPCPeeringConnection
=== PAUSE TestAccEC2Route_prefixListToVPCPeeringConnection
=== RUN TestAccEC2Route_prefixListToNatGateway
=== PAUSE TestAccEC2Route_prefixListToNatGateway
=== RUN TestAccEC2Route_prefixListToTransitGateway
=== PAUSE TestAccEC2Route_prefixListToTransitGateway
=== RUN TestAccEC2Route_prefixListToCarrierGateway
=== PAUSE TestAccEC2Route_prefixListToCarrierGateway
=== RUN TestAccEC2Route_prefixListToLocalGateway
=== PAUSE TestAccEC2Route_prefixListToLocalGateway
=== RUN TestAccEC2Route_prefixListToEgressOnlyInternetGateway
=== PAUSE TestAccEC2Route_prefixListToEgressOnlyInternetGateway
=== RUN TestAccEC2VPNConnection_basic
=== PAUSE TestAccEC2VPNConnection_basic
=== CONT TestAccEC2DefaultRouteTable_basic
=== CONT TestAccEC2Route_IPv4Update_target
--- PASS: TestAccEC2DefaultRouteTable_basic (29.30s)
=== CONT TestAccEC2VPNConnection_basic
=== CONT TestAccEC2Route_IPv4Update_target
route_test.go:1119: Step 1/9 error: Error running apply: exit status 1
Error: error adding VPC Endpoint Service permissions: InvalidPrincipal: Invalid Principal: 'xxxxxxxxxxxx'
status code: 400, request id: 26893a54-7f93-49e0-96aa-e6abb9de8ac1
with aws_vpc_endpoint_service.test,
on terraform_plugin_test.tf line 165, in resource "aws_vpc_endpoint_service" "test":
165: resource "aws_vpc_endpoint_service" "test" {
--- PASS: TestAccEC2VPNConnection_basic (281.71s)
=== CONT TestAccEC2Route_prefixListToEgressOnlyInternetGateway
--- PASS: TestAccEC2Route_prefixListToEgressOnlyInternetGateway (38.47s)
=== CONT TestAccEC2Route_prefixListToLocalGateway
acctest.go:1293: skipping since no Outposts found
--- SKIP: TestAccEC2Route_prefixListToLocalGateway (1.04s)
=== CONT TestAccEC2Route_prefixListToCarrierGateway
--- PASS: TestAccEC2Route_prefixListToCarrierGateway (27.94s)
=== CONT TestAccEC2Route_prefixListToTransitGateway
--- FAIL: TestAccEC2Route_IPv4Update_target (382.46s)
=== CONT TestAccEC2Route_prefixListToNatGateway
--- PASS: TestAccEC2Route_prefixListToNatGateway (189.43s)
=== CONT TestAccEC2Route_prefixListToVPCPeeringConnection
--- PASS: TestAccEC2Route_prefixListToVPCPeeringConnection (27.67s)
=== CONT TestAccEC2Route_PrefixListToNetworkInterface_attached
--- PASS: TestAccEC2Route_PrefixListToNetworkInterface_attached (127.79s)
=== CONT TestAccEC2Route_PrefixListToNetworkInterface_unattached
--- PASS: TestAccEC2Route_PrefixListToNetworkInterface_unattached (42.10s)
=== CONT TestAccEC2Route_prefixListToInstance
--- PASS: TestAccEC2Route_prefixListToTransitGateway (413.12s)
=== CONT TestAccEC2Route_prefixListToVPNGateway
--- PASS: TestAccEC2Route_prefixListToInstance (108.14s)
=== CONT TestAccEC2Route_prefixListToInternetGateway
--- PASS: TestAccEC2Route_prefixListToInternetGateway (30.10s)
=== CONT TestAccEC2Route_localRoute
--- PASS: TestAccEC2Route_localRoute (17.83s)
=== CONT TestAccEC2Route_ipv4ToVPCEndpoint
route_test.go:1501: Step 1/2 error: Error running apply: exit status 1
Error: error adding VPC Endpoint Service permissions: InvalidPrincipal: Invalid Principal: 'xxxxxxxxxxxx'
status code: 400, request id: 370de810-e8a9-4d27-a78c-b4908543639a
with aws_vpc_endpoint_service.test,
on terraform_plugin_test.tf line 40, in resource "aws_vpc_endpoint_service" "test":
40: resource "aws_vpc_endpoint_service" "test" {
--- FAIL: TestAccEC2Route_ipv4ToVPCEndpoint (100.93s)
=== CONT TestAccEC2Route_IPv6Update_target
--- PASS: TestAccEC2Route_prefixListToVPNGateway (412.19s)
=== CONT TestAccEC2RouteTable_ipv4ToLocalGateway
acctest.go:1293: skipping since no Outposts found
--- SKIP: TestAccEC2RouteTable_ipv4ToLocalGateway (0.53s)
=== CONT TestAccEC2Route_ipv6ToInstance
--- PASS: TestAccEC2Route_ipv6ToInstance (134.38s)
=== CONT TestAccEC2Route_ipv6ToInternetGateway
--- PASS: TestAccEC2Route_IPv6Update_target (332.79s)
=== CONT TestAccEC2Route_ipv6ToEgressOnlyInternetGateway
--- PASS: TestAccEC2Route_ipv6ToInternetGateway (31.08s)
=== CONT TestAccEC2Route_Disappears_routeTable
--- PASS: TestAccEC2Route_Disappears_routeTable (18.21s)
=== CONT TestAccEC2Route_disappears
--- PASS: TestAccEC2Route_ipv6ToEgressOnlyInternetGateway (41.74s)
=== CONT TestAccEC2Route_IPv6ToNetworkInterface_unattached
--- PASS: TestAccEC2Route_disappears (23.05s)
=== CONT TestAccEC2Route_basic
--- PASS: TestAccEC2Route_basic (20.56s)
=== CONT TestAccEC2Route_conditionalCIDRBlock
--- PASS: TestAccEC2Route_IPv6ToNetworkInterface_unattached (32.53s)
=== CONT TestAccEC2RouteTablesDataSource_basic
--- PASS: TestAccEC2RouteTablesDataSource_basic (18.65s)
=== CONT TestAccEC2Route_ipv6ToLocalGateway
acctest.go:1293: skipping since no Outposts found
--- SKIP: TestAccEC2Route_ipv6ToLocalGateway (0.57s)
=== CONT TestAccEC2Route_ipv4ToLocalGateway
acctest.go:1293: skipping since no Outposts found
--- SKIP: TestAccEC2Route_ipv4ToLocalGateway (0.18s)
=== CONT TestAccEC2Route_ipv4ToCarrierGateway
--- PASS: TestAccEC2Route_ipv4ToCarrierGateway (21.14s)
=== CONT TestAccEC2Route_ipv6ToTransitGateway
--- PASS: TestAccEC2Route_conditionalCIDRBlock (46.04s)
=== CONT TestAccEC2Route_ipv4ToTransitGateway
--- PASS: TestAccEC2Route_ipv4ToTransitGateway (406.73s)
=== CONT TestAccEC2Route_doesNotCrashWithVPCEndpoint
--- PASS: TestAccEC2Route_ipv6ToTransitGateway (414.48s)
=== CONT TestAccEC2Route_ipv6ToNatGateway
route_test.go:754: Step 1/2 error: Error running apply: exit status 1
Error: error associating EC2 Subnet (subnet-0a3da6cabf6ff4e7a) IPv6 CIDR block (2600:1f13:1f9:4801::/64): InvalidSubnet.Conflict: The CIDR '2600:1f13:1f9:4801::/64' conflicts with another subnet
status code: 400, request id: 409802ce-335d-4e27-89f9-2783fdac6fb0
with aws_subnet.test,
on terraform_plugin_test.tf line 11, in resource "aws_subnet" "test":
11: resource "aws_subnet" "test" {
--- FAIL: TestAccEC2Route_ipv6ToNatGateway (22.44s)
=== CONT TestAccEC2Route_ipv4ToNatGateway
--- PASS: TestAccEC2Route_doesNotCrashWithVPCEndpoint (36.70s)
=== CONT TestAccEC2Route_ipv4ToVPCPeeringConnection
--- PASS: TestAccEC2Route_ipv4ToVPCPeeringConnection (25.42s)
=== CONT TestAccEC2RouteTable_prefixListToInternetGateway
--- PASS: TestAccEC2RouteTable_prefixListToInternetGateway (31.70s)
=== CONT TestAccEC2RouteTable_multipleRoutes
--- PASS: TestAccEC2Route_ipv4ToNatGateway (213.70s)
=== CONT TestAccEC2RouteTable_gatewayVPCEndpoint
--- PASS: TestAccEC2RouteTable_gatewayVPCEndpoint (34.82s)
=== CONT TestAccEC2RouteTable_vpcClassicLink
--- PASS: TestAccEC2RouteTable_multipleRoutes (188.78s)
=== CONT TestAccEC2RouteTable_vpcMultipleCIDRs
--- PASS: TestAccEC2RouteTable_vpcClassicLink (23.55s)
=== CONT TestAccEC2Route_IPv4ToNetworkInterface_twoAttachments
--- PASS: TestAccEC2RouteTable_vpcMultipleCIDRs (45.80s)
=== CONT TestAccEC2RouteTable_IPv4ToNetworkInterfaces_unattached
--- PASS: TestAccEC2RouteTable_IPv4ToNetworkInterfaces_unattached (83.83s)
=== CONT TestAccEC2Route_IPv4ToNetworkInterface_attached
--- PASS: TestAccEC2Route_IPv4ToNetworkInterface_twoAttachments (149.92s)
=== CONT TestAccEC2RouteTable_IPv6ToNetworkInterface_unattached
--- PASS: TestAccEC2RouteTable_IPv6ToNetworkInterface_unattached (38.96s)
=== CONT TestAccEC2RouteTable_ipv4ToNatGateway
--- PASS: TestAccEC2Route_IPv4ToNetworkInterface_attached (135.09s)
=== CONT TestAccEC2RouteTable_conditionalCIDRBlock
--- PASS: TestAccEC2RouteTable_conditionalCIDRBlock (79.32s)
=== CONT TestAccEC2RouteTable_vgwRoutePropagation
--- PASS: TestAccEC2RouteTable_ipv4ToNatGateway (174.39s)
=== CONT TestAccEC2RouteTable_ipv4ToVPCPeeringConnection
--- PASS: TestAccEC2RouteTable_ipv4ToVPCPeeringConnection (26.14s)
=== CONT TestAccEC2Route_IPv4ToNetworkInterface_unattached
--- PASS: TestAccEC2RouteTable_vgwRoutePropagation (87.77s)
=== CONT TestAccEC2Route_ipv4ToInstance
--- PASS: TestAccEC2Route_IPv4ToNetworkInterface_unattached (30.82s)
=== CONT TestAccEC2Route_ipv4ToVPNGateway
--- PASS: TestAccEC2Route_ipv4ToVPNGateway (57.29s)
=== CONT TestAccEC2Route_ipv6ToVPNGateway
--- PASS: TestAccEC2Route_ipv4ToInstance (116.18s)
=== CONT TestAccEC2Route_ipv6ToVPCPeeringConnection
--- PASS: TestAccEC2Route_ipv6ToVPNGateway (75.84s)
=== CONT TestAccEC2DefaultRouteTable_revokeExistingRules
--- PASS: TestAccEC2Route_ipv6ToVPCPeeringConnection (41.13s)
=== CONT TestAccEC2RouteTableAssociation_Subnet_basic
--- PASS: TestAccEC2RouteTableAssociation_Subnet_basic (54.30s)
=== CONT TestAccEC2RouteTableAssociation_Subnet_changeRouteTable
--- PASS: TestAccEC2DefaultRouteTable_revokeExistingRules (87.74s)
=== CONT TestAccEC2RouteTable_ipv4ToCarrierGateway
--- PASS: TestAccEC2RouteTable_ipv4ToCarrierGateway (27.33s)
=== CONT TestAccEC2RouteTable_ipv4ToVPCEndpoint
--- PASS: TestAccEC2RouteTableAssociation_Subnet_changeRouteTable (42.95s)
=== CONT TestAccEC2RouteTable_ipv4ToTransitGateway
=== CONT TestAccEC2RouteTable_ipv4ToVPCEndpoint
route_table_test.go:439: Step 1/2 error: Error running apply: exit status 1
Error: error adding VPC Endpoint Service permissions: InvalidPrincipal: Invalid Principal: 'xxxxxxxxxxxx'
status code: 400, request id: 6437b12b-1201-40de-8e89-e6a3c3fa732a
with aws_vpc_endpoint_service.test,
on terraform_plugin_test.tf line 40, in resource "aws_vpc_endpoint_service" "test":
40: resource "aws_vpc_endpoint_service" "test" {
--- FAIL: TestAccEC2RouteTable_ipv4ToVPCEndpoint (103.18s)
=== CONT TestAccEC2RouteTable_Route_mode
--- PASS: TestAccEC2RouteTable_Route_mode (62.10s)
=== CONT TestAccEC2RouteTable_requireRouteTarget
--- PASS: TestAccEC2RouteTable_requireRouteTarget (11.73s)
=== CONT TestAccEC2RouteDataSource_gatewayVPCEndpoint
--- PASS: TestAccEC2RouteDataSource_gatewayVPCEndpoint (35.83s)
=== CONT TestAccEC2RouteTable_requireRouteDestination
--- PASS: TestAccEC2RouteTable_ipv4ToTransitGateway (416.64s)
=== CONT TestAccEC2RouteTable_tags
--- PASS: TestAccEC2RouteTable_tags (47.83s)
=== CONT TestAccEC2RouteDataSource_destinationPrefixListID
--- PASS: TestAccEC2RouteTable_requireRouteDestination (326.12s)
=== CONT TestAccEC2RouteTable_ipv6ToEgressOnlyInternetGateway
--- PASS: TestAccEC2RouteTable_ipv6ToEgressOnlyInternetGateway (40.24s)
=== CONT TestAccEC2RouteDataSource_carrierGatewayID
--- PASS: TestAccEC2RouteDataSource_carrierGatewayID (22.12s)
=== CONT TestAccEC2RouteTable_ipv4ToInstance
--- PASS: TestAccEC2RouteDataSource_destinationPrefixListID (230.31s)
=== CONT TestAccEC2RouteDataSource_localGatewayID
acctest.go:1293: skipping since no Outposts found
--- SKIP: TestAccEC2RouteDataSource_localGatewayID (0.60s)
=== CONT TestAccEC2RouteTable_ipv4ToInternetGateway
--- PASS: TestAccEC2RouteTable_ipv4ToInstance (130.74s)
=== CONT TestAccEC2RouteTable_Disappears_subnetAssociation
--- PASS: TestAccEC2RouteTable_ipv4ToInternetGateway (38.37s)
=== CONT TestAccEC2RouteTable_disappears
--- PASS: TestAccEC2RouteTable_Disappears_subnetAssociation (20.29s)
=== CONT TestAccEC2RouteTable_basic
--- PASS: TestAccEC2RouteTable_disappears (17.87s)
=== CONT TestAccEC2RouteTableDataSource_main
--- PASS: TestAccEC2RouteTableDataSource_main (16.83s)
=== CONT TestAccEC2RouteTableDataSource_basic
--- PASS: TestAccEC2RouteTable_basic (20.36s)
=== CONT TestAccEC2RouteTableAssociation_disappears
--- PASS: TestAccEC2RouteTableDataSource_basic (21.27s)
=== CONT TestAccEC2RouteTableAssociation_Gateway_changeRouteTable
--- PASS: TestAccEC2RouteTableAssociation_disappears (21.66s)
=== CONT TestAccEC2RouteTableAssociation_Gateway_basic
--- PASS: TestAccEC2RouteTableAssociation_Gateway_basic (32.16s)
=== CONT TestAccEC2RouteDataSource_ipv6DestinationCIDR
--- PASS: TestAccEC2RouteDataSource_ipv6DestinationCIDR (20.52s)
=== CONT TestAccEC2DefaultRouteTable_ipv4ToVPCEndpoint
--- PASS: TestAccEC2RouteTableAssociation_Gateway_changeRouteTable (61.15s)
=== CONT TestAccEC2RouteDataSource_transitGatewayID
=== CONT TestAccEC2DefaultRouteTable_ipv4ToVPCEndpoint
default_route_table_test.go:273: Step 1/3 error: Error running apply: exit status 1
Error: error adding VPC Endpoint Service permissions: InvalidPrincipal: Invalid Principal: 'xxxxxxxxxxxx'
status code: 400, request id: 10d3a3a6-a744-4d83-bf36-edc8fa8b0988
with aws_vpc_endpoint_service.test,
on terraform_plugin_test.tf line 49, in resource "aws_vpc_endpoint_service" "test":
49: resource "aws_vpc_endpoint_service" "test" {
--- FAIL: TestAccEC2DefaultRouteTable_ipv4ToVPCEndpoint (102.25s)
=== CONT TestAccEC2DefaultRouteTable_prefixListToInternetGateway
--- PASS: TestAccEC2DefaultRouteTable_prefixListToInternetGateway (43.51s)
=== CONT TestAccEC2RouteDataSource_basic
--- PASS: TestAccEC2RouteDataSource_basic (114.14s)
=== CONT TestAccEC2DefaultRouteTable_tags
--- PASS: TestAccEC2DefaultRouteTable_tags (43.19s)
=== CONT TestAccEC2DefaultRouteTable_swap
--- PASS: TestAccEC2DefaultRouteTable_swap (65.19s)
=== CONT TestAccEC2DefaultRouteTable_conditionalCIDRBlock
--- PASS: TestAccEC2RouteDataSource_transitGatewayID (385.04s)
=== CONT TestAccEC2DefaultRouteTable_ipv4ToTransitGateway
--- PASS: TestAccEC2DefaultRouteTable_conditionalCIDRBlock (58.06s)
=== CONT TestAccEC2DefaultRouteTable_vpcEndpointAssociation
--- PASS: TestAccEC2DefaultRouteTable_vpcEndpointAssociation (29.77s)
=== CONT TestAccEC2DefaultRouteTable_Route_mode
--- PASS: TestAccEC2DefaultRouteTable_Route_mode (56.27s)
=== CONT TestAccEC2DefaultRouteTable_Disappears_vpc
--- PASS: TestAccEC2DefaultRouteTable_Disappears_vpc (13.66s)
--- PASS: TestAccEC2DefaultRouteTable_ipv4ToTransitGateway (443.43s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/ec2 4536.910s
FAIL
make: *** [testacc] Error 1
Failure are unrelated to these changes.
We have starting to get the InvalidSubnet.Conflict
error in nightly CI:
=== RUN TestAccEC2Route_IPv6Update_target
=== PAUSE TestAccEC2Route_IPv6Update_target
=== CONT TestAccEC2Route_IPv6Update_target
route_test.go:1307: Step 1/7 error: Error running apply: exit status 1
Error: error associating EC2 Subnet (subnet-07137c071fdaa2a3b) IPv6 CIDR block (2600:1f14:dd9:b801::/64): InvalidSubnet.Conflict: The CIDR '2600:1f14:dd9:b801::/64' conflicts with another subnet
status code: 400, request id: 6b124bb5-5c2c-4df5-a562-dbb2adb4a950
with aws_subnet.test,
on terraform_plugin_test.tf line 71, in resource "aws_subnet" "test":
71: resource "aws_subnet" "test" {
--- FAIL: TestAccEC2Route_IPv6Update_target (69.06s)
This functionality has been released in v4.9.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Issue:
When the route's wait-for-creation operation times out, its state is leaked as
d.SetId(...)
is called after theWaitRouteReady(...)
. So, the next time the configuration is applied, the Terraform engine tries to create the same route again, getting duplication error from AWS.Fix:
Call
d.SetId(...)
beforeWaitRouteReady(...)
.Community Note
Closes #23827
Output from acceptance testing: