Skip to content

Commit e0104c8

Browse files
author
Martin Guibert
committed
fix: add acc test for aws_s3_account_public_access_block
1 parent e067a6d commit e0104c8

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package aws_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/snyk/driftctl/test"
7+
"github.com/snyk/driftctl/test/acceptance"
8+
)
9+
10+
func TestAcc_Aws_S3Account_PublicAccessBlock(t *testing.T) {
11+
acceptance.Run(t, acceptance.AccTestCase{
12+
TerraformVersion: "0.15.5",
13+
Paths: []string{"./testdata/acc/aws_s3_account_public_access_block"},
14+
Args: []string{"scan"},
15+
Checks: []acceptance.AccCheck{
16+
{
17+
Env: map[string]string{
18+
"AWS_REGION": "us-east-1",
19+
},
20+
Check: func(result *test.ScanResult, stdout string, err error) {
21+
if err != nil {
22+
t.Fatal(err)
23+
}
24+
result.AssertInfrastructureIsInSync()
25+
result.AssertManagedCount(1)
26+
},
27+
},
28+
},
29+
})
30+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!aws_s3_account_public_access_block

pkg/resource/aws/testdata/acc/aws_s3_account_public_access_block/.terraform.lock.hcl

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
provider "aws" {
2+
region = "us-east-1"
3+
}
4+
5+
terraform {
6+
required_providers {
7+
aws = "3.19.0"
8+
}
9+
}
10+
11+
resource "aws_s3_account_public_access_block" "example" {
12+
block_public_acls = true
13+
block_public_policy = true
14+
}
15+

0 commit comments

Comments
 (0)