Skip to content

Commit

Permalink
tests/data-source/aws_internet_gateway: Remove hardcoded provider reg…
Browse files Browse the repository at this point in the history
…ion and ExpectNonEmptyPlan (#12253)

Previously in the acceptance testing:

```
--- FAIL: TestAccDataSourceAwsInternetGateway_typical (11.00s)
    testing.go:654: Step 0 error: errors during apply:

        Error: Error creating VPC: VpcLimitExceeded: The maximum number of VPCs has been reached.
```

Since this hardcoded region is not part of our normal sweeping regions, it went unchecked and hit the 5 VPC limit. Running the sweeper in that region cleaned up dangling VPC resources.

Output from acceptance testing:

```
--- PASS: TestAccDataSourceAwsInternetGateway_typical (43.46s)
```
  • Loading branch information
bflad authored Mar 10, 2020
1 parent 4c275f4 commit 50d36a1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions aws/data_source_aws_internet_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func TestAccDataSourceAwsInternetGateway_typical(t *testing.T) {
resource.TestCheckResourceAttrPair(ds3ResourceName, "owner_id", igwResourceName, "owner_id"),
resource.TestCheckResourceAttrPair(ds3ResourceName, "attachments.0.vpc_id", vpcResourceName, "id"),
),
ExpectNonEmptyPlan: true,
},
},
})
Expand Down Expand Up @@ -67,10 +66,8 @@ data "aws_internet_gateway" "by_tags" {
data "aws_internet_gateway" "by_filter" {
filter {
name = "attachment.vpc-id"
values = ["${aws_vpc.test.id}"]
name = "internet-gateway-id"
values = ["${aws_internet_gateway.test.id}"]
}
depends_on = ["aws_internet_gateway.test"]
}
`

0 comments on commit 50d36a1

Please sign in to comment.