-
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
vpc/route_table: Allow local inline routes #32794
Conversation
Community NoteVoting for Prioritization
For Submitters
|
@@ -811,7 +820,7 @@ func flattenRoute(apiObject *ec2.Route) map[string]interface{} { | |||
return tfMap | |||
} | |||
|
|||
func flattenRoutes(ctx context.Context, conn *ec2.EC2, apiObjects []*ec2.Route) []interface{} { | |||
func flattenRoutes(ctx context.Context, d *schema.ResourceData, conn *ec2.EC2, apiObjects []*ec2.Route) []interface{} { |
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.
Nit: Swap *schema.ResourceData
and *ec2.EC2
arguments as the most common pattern is f(ctx, conn, other-args...)
.
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.
Yes, absolutely! Careless...
% make testacc TESTARGS='-run=TestAccVPCRoute' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2 -run=TestAccVPCRoute -timeout 180m
=== RUN TestAccVPCRouteDataSource_basic
=== PAUSE TestAccVPCRouteDataSource_basic
=== RUN TestAccVPCRouteDataSource_transitGatewayID
=== PAUSE TestAccVPCRouteDataSource_transitGatewayID
=== RUN TestAccVPCRouteDataSource_ipv6DestinationCIDR
=== PAUSE TestAccVPCRouteDataSource_ipv6DestinationCIDR
=== RUN TestAccVPCRouteDataSource_localGatewayID
=== PAUSE TestAccVPCRouteDataSource_localGatewayID
=== RUN TestAccVPCRouteDataSource_carrierGatewayID
=== PAUSE TestAccVPCRouteDataSource_carrierGatewayID
=== RUN TestAccVPCRouteDataSource_destinationPrefixListID
=== PAUSE TestAccVPCRouteDataSource_destinationPrefixListID
=== RUN TestAccVPCRouteDataSource_gatewayVPCEndpoint
=== PAUSE TestAccVPCRouteDataSource_gatewayVPCEndpoint
=== RUN TestAccVPCRouteTableAssociation_Subnet_basic
=== PAUSE TestAccVPCRouteTableAssociation_Subnet_basic
=== RUN TestAccVPCRouteTableAssociation_Subnet_changeRouteTable
=== PAUSE TestAccVPCRouteTableAssociation_Subnet_changeRouteTable
=== RUN TestAccVPCRouteTableAssociation_Gateway_basic
=== PAUSE TestAccVPCRouteTableAssociation_Gateway_basic
=== RUN TestAccVPCRouteTableAssociation_Gateway_changeRouteTable
=== PAUSE TestAccVPCRouteTableAssociation_Gateway_changeRouteTable
=== RUN TestAccVPCRouteTableAssociation_disappears
=== PAUSE TestAccVPCRouteTableAssociation_disappears
=== RUN TestAccVPCRouteTableDataSource_basic
=== PAUSE TestAccVPCRouteTableDataSource_basic
=== RUN TestAccVPCRouteTableDataSource_main
=== PAUSE TestAccVPCRouteTableDataSource_main
=== RUN TestAccVPCRouteTable_basic
=== PAUSE TestAccVPCRouteTable_basic
=== RUN TestAccVPCRouteTable_disappears
=== PAUSE TestAccVPCRouteTable_disappears
=== RUN TestAccVPCRouteTable_Disappears_subnetAssociation
=== PAUSE TestAccVPCRouteTable_Disappears_subnetAssociation
=== RUN TestAccVPCRouteTable_ipv4ToInternetGateway
=== PAUSE TestAccVPCRouteTable_ipv4ToInternetGateway
=== RUN TestAccVPCRouteTable_ipv4ToInstance
=== PAUSE TestAccVPCRouteTable_ipv4ToInstance
=== RUN TestAccVPCRouteTable_ipv6ToEgressOnlyInternetGateway
=== PAUSE TestAccVPCRouteTable_ipv6ToEgressOnlyInternetGateway
=== RUN TestAccVPCRouteTable_tags
=== PAUSE TestAccVPCRouteTable_tags
=== RUN TestAccVPCRouteTable_requireRouteDestination
=== PAUSE TestAccVPCRouteTable_requireRouteDestination
=== RUN TestAccVPCRouteTable_requireRouteTarget
=== PAUSE TestAccVPCRouteTable_requireRouteTarget
=== RUN TestAccVPCRouteTable_Route_mode
=== PAUSE TestAccVPCRouteTable_Route_mode
=== RUN TestAccVPCRouteTable_ipv4ToTransitGateway
=== PAUSE TestAccVPCRouteTable_ipv4ToTransitGateway
=== RUN TestAccVPCRouteTable_ipv4ToVPCEndpoint
=== PAUSE TestAccVPCRouteTable_ipv4ToVPCEndpoint
=== RUN TestAccVPCRouteTable_ipv4ToCarrierGateway
=== PAUSE TestAccVPCRouteTable_ipv4ToCarrierGateway
=== RUN TestAccVPCRouteTable_ipv4ToLocalGateway
=== PAUSE TestAccVPCRouteTable_ipv4ToLocalGateway
=== RUN TestAccVPCRouteTable_ipv4ToVPCPeeringConnection
=== PAUSE TestAccVPCRouteTable_ipv4ToVPCPeeringConnection
=== RUN TestAccVPCRouteTable_vgwRoutePropagation
=== PAUSE TestAccVPCRouteTable_vgwRoutePropagation
=== RUN TestAccVPCRouteTable_conditionalCIDRBlock
=== PAUSE TestAccVPCRouteTable_conditionalCIDRBlock
=== RUN TestAccVPCRouteTable_ipv4ToNatGateway
=== PAUSE TestAccVPCRouteTable_ipv4ToNatGateway
=== RUN TestAccVPCRouteTable_IPv6ToNetworkInterface_unattached
=== PAUSE TestAccVPCRouteTable_IPv6ToNetworkInterface_unattached
=== RUN TestAccVPCRouteTable_IPv4ToNetworkInterfaces_unattached
=== PAUSE TestAccVPCRouteTable_IPv4ToNetworkInterfaces_unattached
=== RUN TestAccVPCRouteTable_vpcMultipleCIDRs
=== PAUSE TestAccVPCRouteTable_vpcMultipleCIDRs
=== RUN TestAccVPCRouteTable_gatewayVPCEndpoint
=== PAUSE TestAccVPCRouteTable_gatewayVPCEndpoint
=== RUN TestAccVPCRouteTable_multipleRoutes
=== PAUSE TestAccVPCRouteTable_multipleRoutes
=== RUN TestAccVPCRouteTable_prefixListToInternetGateway
=== PAUSE TestAccVPCRouteTable_prefixListToInternetGateway
=== RUN TestAccVPCRouteTable_localRoute
=== PAUSE TestAccVPCRouteTable_localRoute
=== RUN TestAccVPCRouteTable_localRouteUpdate
=== PAUSE TestAccVPCRouteTable_localRouteUpdate
=== RUN TestAccVPCRouteTablesDataSource_basic
=== PAUSE TestAccVPCRouteTablesDataSource_basic
=== RUN TestAccVPCRoute_basic
=== PAUSE TestAccVPCRoute_basic
=== RUN TestAccVPCRoute_disappears
=== PAUSE TestAccVPCRoute_disappears
=== RUN TestAccVPCRoute_Disappears_routeTable
=== PAUSE TestAccVPCRoute_Disappears_routeTable
=== RUN TestAccVPCRoute_ipv6ToEgressOnlyInternetGateway
=== PAUSE TestAccVPCRoute_ipv6ToEgressOnlyInternetGateway
=== RUN TestAccVPCRoute_ipv6ToInternetGateway
=== PAUSE TestAccVPCRoute_ipv6ToInternetGateway
=== RUN TestAccVPCRoute_ipv6ToInstance
=== PAUSE TestAccVPCRoute_ipv6ToInstance
=== RUN TestAccVPCRoute_IPv6ToNetworkInterface_unattached
=== PAUSE TestAccVPCRoute_IPv6ToNetworkInterface_unattached
=== RUN TestAccVPCRoute_ipv6ToVPCPeeringConnection
=== PAUSE TestAccVPCRoute_ipv6ToVPCPeeringConnection
=== RUN TestAccVPCRoute_ipv6ToVPNGateway
=== PAUSE TestAccVPCRoute_ipv6ToVPNGateway
=== RUN TestAccVPCRoute_ipv4ToVPNGateway
=== PAUSE TestAccVPCRoute_ipv4ToVPNGateway
=== RUN TestAccVPCRoute_ipv4ToInstance
=== PAUSE TestAccVPCRoute_ipv4ToInstance
=== RUN TestAccVPCRoute_IPv4ToNetworkInterface_unattached
=== PAUSE TestAccVPCRoute_IPv4ToNetworkInterface_unattached
=== RUN TestAccVPCRoute_IPv4ToNetworkInterface_attached
=== PAUSE TestAccVPCRoute_IPv4ToNetworkInterface_attached
=== RUN TestAccVPCRoute_IPv4ToNetworkInterface_twoAttachments
=== PAUSE TestAccVPCRoute_IPv4ToNetworkInterface_twoAttachments
=== RUN TestAccVPCRoute_ipv4ToVPCPeeringConnection
=== PAUSE TestAccVPCRoute_ipv4ToVPCPeeringConnection
=== RUN TestAccVPCRoute_ipv4ToNatGateway
=== PAUSE TestAccVPCRoute_ipv4ToNatGateway
=== RUN TestAccVPCRoute_ipv6ToNatGateway
=== PAUSE TestAccVPCRoute_ipv6ToNatGateway
=== RUN TestAccVPCRoute_doesNotCrashWithVPCEndpoint
=== PAUSE TestAccVPCRoute_doesNotCrashWithVPCEndpoint
=== RUN TestAccVPCRoute_ipv4ToTransitGateway
=== PAUSE TestAccVPCRoute_ipv4ToTransitGateway
=== RUN TestAccVPCRoute_ipv6ToTransitGateway
=== PAUSE TestAccVPCRoute_ipv6ToTransitGateway
=== RUN TestAccVPCRoute_ipv4ToCarrierGateway
=== PAUSE TestAccVPCRoute_ipv4ToCarrierGateway
=== RUN TestAccVPCRoute_ipv4ToLocalGateway
=== PAUSE TestAccVPCRoute_ipv4ToLocalGateway
=== RUN TestAccVPCRoute_ipv6ToLocalGateway
=== PAUSE TestAccVPCRoute_ipv6ToLocalGateway
=== RUN TestAccVPCRoute_conditionalCIDRBlock
=== PAUSE TestAccVPCRoute_conditionalCIDRBlock
=== RUN TestAccVPCRoute_IPv4Update_target
=== PAUSE TestAccVPCRoute_IPv4Update_target
=== RUN TestAccVPCRoute_IPv6Update_target
=== PAUSE TestAccVPCRoute_IPv6Update_target
=== RUN TestAccVPCRoute_ipv4ToVPCEndpoint
=== PAUSE TestAccVPCRoute_ipv4ToVPCEndpoint
=== RUN TestAccVPCRoute_ipv6ToVPCEndpoint
=== PAUSE TestAccVPCRoute_ipv6ToVPCEndpoint
=== RUN TestAccVPCRoute_localRoute
=== PAUSE TestAccVPCRoute_localRoute
=== RUN TestAccVPCRoute_localRouteUpdate
=== PAUSE TestAccVPCRoute_localRouteUpdate
=== RUN TestAccVPCRoute_prefixListToInternetGateway
=== PAUSE TestAccVPCRoute_prefixListToInternetGateway
=== RUN TestAccVPCRoute_prefixListToVPNGateway
=== PAUSE TestAccVPCRoute_prefixListToVPNGateway
=== RUN TestAccVPCRoute_prefixListToInstance
=== PAUSE TestAccVPCRoute_prefixListToInstance
=== RUN TestAccVPCRoute_PrefixListToNetworkInterface_unattached
=== PAUSE TestAccVPCRoute_PrefixListToNetworkInterface_unattached
=== RUN TestAccVPCRoute_PrefixListToNetworkInterface_attached
=== PAUSE TestAccVPCRoute_PrefixListToNetworkInterface_attached
=== RUN TestAccVPCRoute_prefixListToVPCPeeringConnection
=== PAUSE TestAccVPCRoute_prefixListToVPCPeeringConnection
=== RUN TestAccVPCRoute_prefixListToNatGateway
=== PAUSE TestAccVPCRoute_prefixListToNatGateway
=== RUN TestAccVPCRoute_prefixListToTransitGateway
=== PAUSE TestAccVPCRoute_prefixListToTransitGateway
=== RUN TestAccVPCRoute_prefixListToCarrierGateway
=== PAUSE TestAccVPCRoute_prefixListToCarrierGateway
=== RUN TestAccVPCRoute_prefixListToLocalGateway
=== PAUSE TestAccVPCRoute_prefixListToLocalGateway
=== RUN TestAccVPCRoute_prefixListToEgressOnlyInternetGateway
=== PAUSE TestAccVPCRoute_prefixListToEgressOnlyInternetGateway
=== CONT TestAccVPCRouteDataSource_basic
=== CONT TestAccVPCRoute_basic
--- PASS: TestAccVPCRoute_basic (32.75s)
=== CONT TestAccVPCRouteTable_requireRouteDestination
--- PASS: TestAccVPCRouteDataSource_basic (126.85s)
=== CONT TestAccVPCRouteTablesDataSource_basic
--- PASS: TestAccVPCRouteTablesDataSource_basic (26.52s)
=== CONT TestAccVPCRouteTable_localRouteUpdate
--- PASS: TestAccVPCRouteTable_localRouteUpdate (108.11s)
=== CONT TestAccVPCRouteTable_localRoute
--- PASS: TestAccVPCRouteTable_localRoute (28.69s)
=== CONT TestAccVPCRouteTable_prefixListToInternetGateway
--- PASS: TestAccVPCRouteTable_prefixListToInternetGateway (36.52s)
=== CONT TestAccVPCRouteTable_multipleRoutes
--- PASS: TestAccVPCRouteTable_requireRouteDestination (324.66s)
=== CONT TestAccVPCRouteTable_gatewayVPCEndpoint
--- PASS: TestAccVPCRouteTable_gatewayVPCEndpoint (42.43s)
=== CONT TestAccVPCRouteTable_vpcMultipleCIDRs
--- PASS: TestAccVPCRouteTable_vpcMultipleCIDRs (51.18s)
=== CONT TestAccVPCRouteTable_IPv4ToNetworkInterfaces_unattached
--- PASS: TestAccVPCRouteTable_IPv4ToNetworkInterfaces_unattached (100.72s)
=== CONT TestAccVPCRouteTable_IPv6ToNetworkInterface_unattached
--- PASS: TestAccVPCRouteTable_multipleRoutes (231.26s)
=== CONT TestAccVPCRouteTable_ipv4ToNatGateway
--- PASS: TestAccVPCRouteTable_IPv6ToNetworkInterface_unattached (44.58s)
=== CONT TestAccVPCRouteTable_conditionalCIDRBlock
--- PASS: TestAccVPCRouteTable_conditionalCIDRBlock (62.19s)
=== CONT TestAccVPCRouteTable_vgwRoutePropagation
--- PASS: TestAccVPCRouteTable_ipv4ToNatGateway (199.92s)
=== CONT TestAccVPCRouteTable_ipv4ToVPCPeeringConnection
--- PASS: TestAccVPCRouteTable_ipv4ToVPCPeeringConnection (31.81s)
=== CONT TestAccVPCRouteTable_ipv4ToLocalGateway
acctest.go:1105: skipping since no Outposts found
--- SKIP: TestAccVPCRouteTable_ipv4ToLocalGateway (0.64s)
=== CONT TestAccVPCRouteTable_ipv4ToCarrierGateway
--- PASS: TestAccVPCRouteTable_ipv4ToCarrierGateway (31.75s)
=== CONT TestAccVPCRouteTable_ipv4ToVPCEndpoint
--- PASS: TestAccVPCRouteTable_vgwRoutePropagation (293.06s)
=== CONT TestAccVPCRouteTable_ipv4ToTransitGateway
--- PASS: TestAccVPCRouteTable_ipv4ToTransitGateway (241.97s)
=== CONT TestAccVPCRouteTable_requireRouteTarget
--- PASS: TestAccVPCRouteTable_requireRouteTarget (15.88s)
=== CONT TestAccVPCRoute_ipv4ToLocalGateway
acctest.go:1105: skipping since no Outposts found
--- SKIP: TestAccVPCRoute_ipv4ToLocalGateway (0.41s)
=== CONT TestAccVPCRoute_prefixListToEgressOnlyInternetGateway
--- PASS: TestAccVPCRouteTable_ipv4ToVPCEndpoint (404.33s)
=== CONT TestAccVPCRoute_prefixListToLocalGateway
acctest.go:1105: skipping since no Outposts found
--- SKIP: TestAccVPCRoute_prefixListToLocalGateway (0.67s)
=== CONT TestAccVPCRoute_prefixListToCarrierGateway
--- PASS: TestAccVPCRoute_prefixListToEgressOnlyInternetGateway (48.57s)
=== CONT TestAccVPCRoute_prefixListToTransitGateway
--- PASS: TestAccVPCRoute_prefixListToCarrierGateway (37.78s)
=== CONT TestAccVPCRoute_prefixListToNatGateway
--- PASS: TestAccVPCRoute_prefixListToNatGateway (199.06s)
=== CONT TestAccVPCRoute_prefixListToVPCPeeringConnection
--- PASS: TestAccVPCRoute_prefixListToVPCPeeringConnection (39.70s)
=== CONT TestAccVPCRoute_PrefixListToNetworkInterface_attached
--- PASS: TestAccVPCRoute_prefixListToTransitGateway (261.60s)
=== CONT TestAccVPCRoute_PrefixListToNetworkInterface_unattached
--- PASS: TestAccVPCRoute_PrefixListToNetworkInterface_unattached (40.83s)
=== CONT TestAccVPCRoute_prefixListToInstance
--- PASS: TestAccVPCRoute_PrefixListToNetworkInterface_attached (133.29s)
=== CONT TestAccVPCRoute_prefixListToVPNGateway
=== NAME TestAccVPCRoute_prefixListToInstance
testing_new.go:88: Error running post-test destroy, there may be dangling resources: exit status 1
Error: reading Route Table (rtb-05e01615a95de82cd): couldn't find resource
--- FAIL: TestAccVPCRoute_prefixListToInstance (125.01s)
=== CONT TestAccVPCRoute_prefixListToInternetGateway
--- PASS: TestAccVPCRoute_prefixListToVPNGateway (119.83s)
=== CONT TestAccVPCRoute_localRouteUpdate
--- PASS: TestAccVPCRoute_prefixListToInternetGateway (84.44s)
=== CONT TestAccVPCRoute_localRoute
--- PASS: TestAccVPCRoute_localRoute (56.29s)
=== CONT TestAccVPCRoute_ipv6ToVPCEndpoint
=== NAME TestAccVPCRoute_localRouteUpdate
vpc_route_test.go:1626: Step 4/4 error: After applying this test step and performing a `terraform refresh`, the plan was not empty.
stdout
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# aws_network_interface.test will be created
+ resource "aws_network_interface" "test" {
+ arn = (known after apply)
+ id = (known after apply)
+ interface_type = (known after apply)
+ ipv4_prefix_count = (known after apply)
+ ipv4_prefixes = (known after apply)
+ ipv6_address_count = (known after apply)
+ ipv6_address_list = (known after apply)
+ ipv6_address_list_enabled = false
+ ipv6_addresses = (known after apply)
+ ipv6_prefix_count = (known after apply)
+ ipv6_prefixes = (known after apply)
+ mac_address = (known after apply)
+ outpost_arn = (known after apply)
+ owner_id = (known after apply)
+ private_dns_name = (known after apply)
+ private_ip = (known after apply)
+ private_ip_list = (known after apply)
+ private_ip_list_enabled = false
+ private_ips = (known after apply)
+ private_ips_count = (known after apply)
+ security_groups = (known after apply)
+ source_dest_check = true
+ subnet_id = (known after apply)
+ tags = {
+ "Name" = "tf-acc-test-1740478483555398537"
}
+ tags_all = {
+ "Name" = "tf-acc-test-1740478483555398537"
}
+ attachment {
+ attachment_id = (known after apply)
+ device_index = (known after apply)
+ instance = (known after apply)
}
}
# aws_subnet.test will be created
+ resource "aws_subnet" "test" {
+ arn = (known after apply)
+ assign_ipv6_address_on_creation = false
+ availability_zone = (known after apply)
+ availability_zone_id = (known after apply)
+ cidr_block = "10.1.1.0/24"
+ enable_dns64 = false
+ enable_resource_name_dns_a_record_on_launch = false
+ enable_resource_name_dns_aaaa_record_on_launch = false
+ id = (known after apply)
+ ipv6_cidr_block_association_id = (known after apply)
+ ipv6_native = false
+ map_public_ip_on_launch = false
+ owner_id = (known after apply)
+ private_dns_hostname_type_on_launch = (known after apply)
+ tags = {
+ "Name" = "tf-acc-test-1740478483555398537"
}
+ tags_all = {
+ "Name" = "tf-acc-test-1740478483555398537"
}
+ vpc_id = "vpc-0e413db9011528b95"
}
Plan: 2 to add, 0 to change, 0 to destroy.
--- FAIL: TestAccVPCRoute_localRouteUpdate (147.76s)
=== CONT TestAccVPCRouteTable_Route_mode
--- PASS: TestAccVPCRouteTable_Route_mode (143.59s)
=== CONT TestAccVPCRouteTableAssociation_disappears
--- PASS: TestAccVPCRouteTableAssociation_disappears (35.41s)
=== CONT TestAccVPCRouteTable_tags
--- PASS: TestAccVPCRouteTable_tags (70.34s)
=== CONT TestAccVPCRouteTable_ipv6ToEgressOnlyInternetGateway
--- PASS: TestAccVPCRouteTable_ipv6ToEgressOnlyInternetGateway (58.09s)
=== CONT TestAccVPCRouteTable_ipv4ToInstance
--- PASS: TestAccVPCRoute_ipv6ToVPCEndpoint (452.94s)
=== CONT TestAccVPCRouteTable_ipv4ToInternetGateway
--- PASS: TestAccVPCRouteTable_ipv4ToInternetGateway (55.69s)
=== CONT TestAccVPCRouteTable_Disappears_subnetAssociation
--- PASS: TestAccVPCRouteTable_ipv4ToInstance (128.40s)
=== CONT TestAccVPCRouteTable_disappears
--- PASS: TestAccVPCRouteTable_Disappears_subnetAssociation (31.42s)
=== CONT TestAccVPCRoute_ipv4ToVPCEndpoint
--- PASS: TestAccVPCRouteTable_disappears (30.27s)
=== CONT TestAccVPCRoute_IPv6Update_target
--- PASS: TestAccVPCRoute_IPv6Update_target (330.43s)
=== CONT TestAccVPCRoute_IPv4Update_target
--- PASS: TestAccVPCRoute_ipv4ToVPCEndpoint (540.71s)
=== CONT TestAccVPCRoute_conditionalCIDRBlock
--- PASS: TestAccVPCRoute_conditionalCIDRBlock (60.09s)
=== CONT TestAccVPCRoute_ipv6ToLocalGateway
acctest.go:1105: skipping since no Outposts found
--- SKIP: TestAccVPCRoute_ipv6ToLocalGateway (0.40s)
=== CONT TestAccVPCRouteTable_basic
--- PASS: TestAccVPCRouteTable_basic (28.62s)
=== CONT TestAccVPCRouteTableDataSource_main
--- PASS: TestAccVPCRouteTableDataSource_main (24.02s)
=== CONT TestAccVPCRoute_IPv4ToNetworkInterface_unattached
--- PASS: TestAccVPCRoute_IPv4ToNetworkInterface_unattached (33.27s)
=== CONT TestAccVPCRoute_ipv4ToNatGateway
--- PASS: TestAccVPCRoute_ipv4ToNatGateway (177.13s)
=== CONT TestAccVPCRoute_ipv4ToVPCPeeringConnection
--- PASS: TestAccVPCRoute_ipv4ToVPCPeeringConnection (33.87s)
=== CONT TestAccVPCRoute_IPv4ToNetworkInterface_twoAttachments
--- PASS: TestAccVPCRoute_IPv4Update_target (624.09s)
=== CONT TestAccVPCRoute_ipv6ToNatGateway
--- PASS: TestAccVPCRoute_IPv4ToNetworkInterface_twoAttachments (169.90s)
=== CONT TestAccVPCRoute_ipv4ToCarrierGateway
--- PASS: TestAccVPCRoute_ipv4ToCarrierGateway (30.12s)
=== CONT TestAccVPCRoute_ipv6ToTransitGateway
--- PASS: TestAccVPCRoute_ipv6ToNatGateway (228.07s)
=== CONT TestAccVPCRoute_ipv4ToTransitGateway
--- PASS: TestAccVPCRoute_ipv6ToTransitGateway (250.58s)
=== CONT TestAccVPCRoute_doesNotCrashWithVPCEndpoint
--- PASS: TestAccVPCRoute_doesNotCrashWithVPCEndpoint (43.92s)
=== CONT TestAccVPCRouteTableDataSource_basic
--- PASS: TestAccVPCRouteTableDataSource_basic (28.96s)
=== CONT TestAccVPCRoute_ipv6ToEgressOnlyInternetGateway
--- PASS: TestAccVPCRoute_ipv4ToTransitGateway (250.71s)
=== CONT TestAccVPCRoute_IPv4ToNetworkInterface_attached
--- PASS: TestAccVPCRoute_ipv6ToEgressOnlyInternetGateway (55.78s)
=== CONT TestAccVPCRoute_IPv6ToNetworkInterface_unattached
--- PASS: TestAccVPCRoute_IPv6ToNetworkInterface_unattached (45.25s)
=== CONT TestAccVPCRouteDataSource_gatewayVPCEndpoint
--- PASS: TestAccVPCRoute_IPv4ToNetworkInterface_attached (123.84s)
=== CONT TestAccVPCRoute_ipv4ToInstance
--- PASS: TestAccVPCRouteDataSource_gatewayVPCEndpoint (46.37s)
=== CONT TestAccVPCRouteTableAssociation_Gateway_changeRouteTable
--- PASS: TestAccVPCRouteTableAssociation_Gateway_changeRouteTable (58.18s)
=== CONT TestAccVPCRoute_ipv4ToVPNGateway
--- PASS: TestAccVPCRoute_ipv4ToInstance (127.45s)
=== CONT TestAccVPCRouteTableAssociation_Gateway_basic
--- PASS: TestAccVPCRouteTableAssociation_Gateway_basic (35.96s)
=== CONT TestAccVPCRoute_ipv6ToVPNGateway
--- PASS: TestAccVPCRoute_ipv4ToVPNGateway (121.25s)
=== CONT TestAccVPCRoute_ipv6ToVPCPeeringConnection
--- PASS: TestAccVPCRoute_ipv6ToVPCPeeringConnection (40.95s)
=== CONT TestAccVPCRoute_ipv6ToInstance
--- PASS: TestAccVPCRoute_ipv6ToVPNGateway (151.01s)
=== CONT TestAccVPCRoute_Disappears_routeTable
--- PASS: TestAccVPCRoute_Disappears_routeTable (27.59s)
=== CONT TestAccVPCRouteTableAssociation_Subnet_changeRouteTable
--- PASS: TestAccVPCRoute_ipv6ToInstance (130.47s)
=== CONT TestAccVPCRouteTableAssociation_Subnet_basic
--- PASS: TestAccVPCRouteTableAssociation_Subnet_basic (34.34s)
=== CONT TestAccVPCRouteDataSource_localGatewayID
acctest.go:1105: skipping since no Outposts found
--- SKIP: TestAccVPCRouteDataSource_localGatewayID (0.45s)
=== CONT TestAccVPCRoute_ipv6ToInternetGateway
--- PASS: TestAccVPCRouteTableAssociation_Subnet_changeRouteTable (52.86s)
=== CONT TestAccVPCRouteDataSource_destinationPrefixListID
--- PASS: TestAccVPCRoute_ipv6ToInternetGateway (41.52s)
=== CONT TestAccVPCRouteDataSource_carrierGatewayID
--- PASS: TestAccVPCRouteDataSource_carrierGatewayID (28.81s)
=== CONT TestAccVPCRoute_disappears
--- PASS: TestAccVPCRoute_disappears (26.95s)
=== CONT TestAccVPCRouteDataSource_ipv6DestinationCIDR
--- PASS: TestAccVPCRouteDataSource_ipv6DestinationCIDR (28.67s)
=== CONT TestAccVPCRouteDataSource_transitGatewayID
--- PASS: TestAccVPCRouteDataSource_destinationPrefixListID (227.13s)
--- PASS: TestAccVPCRouteDataSource_transitGatewayID (258.71s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/ec2 4710.970s
FAIL
make: *** [testacc] Error 1 % make testacc TESTARGS='-run=TestAccVPCRoute_prefixListToInstance\|TestAccVPCRoute_localRouteUpdate' PKG=ec2 ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 2 -run=TestAccVPCRoute_prefixListToInstance\|TestAccVPCRoute_localRouteUpdate -timeout 180m
=== RUN TestAccVPCRoute_localRouteUpdate
=== PAUSE TestAccVPCRoute_localRouteUpdate
=== RUN TestAccVPCRoute_prefixListToInstance
=== PAUSE TestAccVPCRoute_prefixListToInstance
=== CONT TestAccVPCRoute_localRouteUpdate
=== CONT TestAccVPCRoute_prefixListToInstance
--- PASS: TestAccVPCRoute_localRouteUpdate (74.38s)
--- PASS: TestAccVPCRoute_prefixListToInstance (93.19s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 97.995s |
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 🚀.
This functionality has been released in v5.11.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. |
Description
This PR is similar to the changes made in #24507, which addressed
aws_route
. This PR addressesaws_route_table
inline routes.Because
aws_route_table
performs dual functions 1) as a parent in the parent-child relationship withaws_route
, and 2) as a means of managing routes inline withroute
blocks, this enhancement is a bit more complicated than the scenario inaws_route
.Normally,
aws_route_table
ignores defaultlocal
routes. In order to not introduce a massive breaking change, these changes preserve the previous behavior of typically ignoring thelocal
routes created by AWS. However, now we want to manage these routes a bit more. We usehasLocalConfig()
along withflattenRoutes()
to prevent defaultlocal
routes from being stored in state (the previous behavior), while allowing configuredlocal
routes to be updated and kept in state (preventing perpetual diffs) like other routes.hasLocalConfig()
checks theResourceData
to distinguish defaultlocal
routes from configuredlocal
routes. Normally, you can't count onResourceData
to represent config. However, in this case, alocal
gateway route inResourceData
must come from the config because of the gatekeeping done byhasLocalConfig()
andflattenRoutes()
to prevent defaultlocal
routes from being stored in state asResourceData
.This PR is likely a step on the road to fully support all the possibilities described in AWS's Deployment models for AWS Network Firewall. After this is merged, please open new issues to describe what yet remains to make your route/firewall dreams come true.
Import Example
Adopt Example
With this PR, in addition to importing a
local
route, you can now adopt alocal
route.Step 1. Create an
aws_route_table
and adopt an existinglocal
routeHere, the
local
route is created for you by AWS. Therefore, this configuration creates the route table but adopts the existinglocal
route into management.CAUTION: Since you cannot create
local
-target routes, if you use the wrong CIDR block, you will get an error.Apply:
Step 2. Change the route to have an ENI target
Here, the route (the AWS created route) will be updated to have an ENI target.
Apply:
Step 3. Update the route again to have a
local
targetApply:
Relations
Closes #21350
Relates #24507
References
Output from Acceptance Testing