mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
providers/aws: route table import should ignore default rule
This commit is contained in:
parent
08b7f67227
commit
a1035804d4
@ -33,6 +33,11 @@ func resourceAwsRouteTableImportState(
|
|||||||
// Construct the routes
|
// Construct the routes
|
||||||
subResource := resourceAwsRoute()
|
subResource := resourceAwsRoute()
|
||||||
for _, route := range table.Routes {
|
for _, route := range table.Routes {
|
||||||
|
// Ignore the local/default route
|
||||||
|
if route.GatewayId != nil && *route.GatewayId == "local" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Minimal data for route
|
// Minimal data for route
|
||||||
d := subResource.Data(nil)
|
d := subResource.Data(nil)
|
||||||
d.SetType("aws_route")
|
d.SetType("aws_route")
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
func TestAccAWSRouteTable_importBasic(t *testing.T) {
|
func TestAccAWSRouteTable_importBasic(t *testing.T) {
|
||||||
checkFn := func(s []*terraform.InstanceState) error {
|
checkFn := func(s []*terraform.InstanceState) error {
|
||||||
// Expect 2: group, 1 rules
|
// Expect 2: group, 1 rules
|
||||||
if len(s) != 3 {
|
if len(s) != 2 {
|
||||||
return fmt.Errorf("bad states: %#v", s)
|
return fmt.Errorf("bad states: %#v", s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user