Skip to content

Commit

Permalink
Merge pull request #15087 from terraform-providers/t-gov-guardduty-fi…
Browse files Browse the repository at this point in the history
…lter

tests/provider: Fix hardcoded (GuardDuty Filter)
  • Loading branch information
YakDriver authored Sep 11, 2020
2 parents f225022 + 9d4b723 commit 1e16fd7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions aws/resource_aws_guardduty_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func testAccAwsGuardDutyFilter_update(t *testing.T) {
tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "finding_criteria.0.criterion.*", map[string]string{
"field": "region",
"equals.#": "1",
"equals.0": "us-west-2",
"equals.0": testAccGetRegion(),
}),
tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "finding_criteria.0.criterion.*", map[string]string{
"field": "service.additionalInfo.threatListName",
Expand Down Expand Up @@ -316,6 +316,8 @@ resource "aws_guardduty_detector" "test" {

func testAccGuardDutyFilterConfig_multipleTags() string {
return `
data "aws_region" "current" {}
resource "aws_guardduty_filter" "test" {
detector_id = aws_guardduty_detector.test.id
name = "test-filter"
Expand All @@ -325,7 +327,7 @@ resource "aws_guardduty_filter" "test" {
finding_criteria {
criterion {
field = "region"
equals = ["us-west-2"]
equals = [data.aws_region.current.name]
}
}
Expand All @@ -343,6 +345,8 @@ resource "aws_guardduty_detector" "test" {

func testAccGuardDutyFilterConfig_update() string {
return `
data "aws_region" "current" {}
resource "aws_guardduty_filter" "test" {
detector_id = aws_guardduty_detector.test.id
name = "test-filter"
Expand All @@ -352,7 +356,7 @@ resource "aws_guardduty_filter" "test" {
finding_criteria {
criterion {
field = "region"
equals = ["us-west-2"]
equals = [data.aws_region.current.name]
}
criterion {
Expand All @@ -370,6 +374,8 @@ resource "aws_guardduty_detector" "test" {

func testAccGuardDutyFilterConfig_updateTags() string {
return `
data "aws_region" "current" {}
resource "aws_guardduty_filter" "test" {
detector_id = aws_guardduty_detector.test.id
name = "test-filter"
Expand All @@ -379,7 +385,7 @@ resource "aws_guardduty_filter" "test" {
finding_criteria {
criterion {
field = "region"
equals = ["us-west-2"]
equals = [data.aws_region.current.name]
}
}
Expand Down

0 comments on commit 1e16fd7

Please sign in to comment.