Skip to content

Commit

Permalink
fix: add acc test for aws_s3_account_public_access_block
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Guibert committed Sep 28, 2022
1 parent e067a6d commit e0104c8
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pkg/resource/aws/aws_s3_account_public_access_block_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package aws_test

import (
"testing"

"github.com/snyk/driftctl/test"
"github.com/snyk/driftctl/test/acceptance"
)

func TestAcc_Aws_S3Account_PublicAccessBlock(t *testing.T) {
acceptance.Run(t, acceptance.AccTestCase{
TerraformVersion: "0.15.5",
Paths: []string{"./testdata/acc/aws_s3_account_public_access_block"},
Args: []string{"scan"},
Checks: []acceptance.AccCheck{
{
Env: map[string]string{
"AWS_REGION": "us-east-1",
},
Check: func(result *test.ScanResult, stdout string, err error) {
if err != nil {
t.Fatal(err)
}
result.AssertInfrastructureIsInSync()
result.AssertManagedCount(1)
},
},
},
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!aws_s3_account_public_access_block

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
provider "aws" {
region = "us-east-1"
}

terraform {
required_providers {
aws = "3.19.0"
}
}

resource "aws_s3_account_public_access_block" "example" {
block_public_acls = true
block_public_policy = true
}

0 comments on commit e0104c8

Please sign in to comment.