Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WhileLoop committed Feb 12, 2019
1 parent f927c23 commit 8c08d06
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions aws/resource_aws_waf_web_acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestAccAWSWafWebAcl_LoggingConfiguration(t *testing.T) {
testAccCheckAWSWafWebAclExists(resourceName, &webACL),
resource.TestCheckResourceAttr(resourceName, "logging_configuration.#", "1"),
resource.TestCheckResourceAttr(resourceName, "logging_configuration.0.redacted_fields.#", "1"),
resource.TestCheckResourceAttr(resourceName, "logging_configuration.0.redacted_fields.0.field_to_match.#", "4"),
resource.TestCheckResourceAttr(resourceName, "logging_configuration.0.redacted_fields.0.field_to_match.#", "2"),
),
},
// Test resource import
Expand Down Expand Up @@ -463,7 +463,7 @@ resource "aws_waf_web_acl" "test" {

func testAccAWSWafWebAclConfig_Logging(rName string) string {
return fmt.Sprintf(`
resource "aws_waf_web_acl" "waf_acl" {
resource "aws_waf_web_acl" "test" {
name = %[1]q
metric_name = %[1]q
Expand All @@ -473,12 +473,14 @@ resource "aws_waf_web_acl" "waf_acl" {
logging_configuration {
log_destination = "${aws_kinesis_firehose_delivery_stream.test_stream.arn}"
log_destination = "${aws_kinesis_firehose_delivery_stream.test.arn}"
redacted_fields {
field_to_match {
type = "URI"
}
field_to_match {
data = "referer"
type = "HEADER"
Expand Down Expand Up @@ -536,15 +538,16 @@ resource "aws_waf_web_acl" "test" {
}
logging_configuration {
log_destination = "${aws_kinesis_firehose_delivery_stream.test_stream.arn}"
log_destination = "${aws_kinesis_firehose_delivery_stream.test.arn}"
}
}
resource "aws_s3_bucket" "bucket" {
resource "aws_s3_bucket" "test" {
bucket = %q
acl = "private"
}
resource "aws_iam_role" "firehose_role" {
resource "aws_iam_role" "test" {
name = %q
assume_role_policy = <<EOF
Expand All @@ -564,14 +567,14 @@ resource "aws_iam_role" "firehose_role" {
EOF
}
resource "aws_kinesis_firehose_delivery_stream" "test_stream" {
resource "aws_kinesis_firehose_delivery_stream" "test" {
# the name must begin with aws-waf-logs-
name = "aws-waf-logs-%s"
destination = "s3"
s3_configuration {
role_arn = "${aws_iam_role.firehose_role.arn}"
bucket_arn = "${aws_s3_bucket.bucket.arn}"
role_arn = "${aws_iam_role.test.arn}"
bucket_arn = "${aws_s3_bucket.test.arn}"
}
}
Expand Down

0 comments on commit 8c08d06

Please sign in to comment.