-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add acc test for aws_s3_account_public_access_block
- Loading branch information
Martin Guibert
committed
Sep 28, 2022
1 parent
e067a6d
commit e0104c8
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
pkg/resource/aws/aws_s3_account_public_access_block_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
}, | ||
}, | ||
}, | ||
}) | ||
} |
2 changes: 2 additions & 0 deletions
2
pkg/resource/aws/testdata/acc/aws_s3_account_public_access_block/.driftignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!aws_s3_account_public_access_block |
41 changes: 41 additions & 0 deletions
41
pkg/resource/aws/testdata/acc/aws_s3_account_public_access_block/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
pkg/resource/aws/testdata/acc/aws_s3_account_public_access_block/terraform.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
|