driftctl/pkg/resource/aws/aws_s3_bucket_test.go

33 lines
911 B
Go
Raw Normal View History

2021-01-07 09:06:08 +00:00
package aws_test
import (
"testing"
2021-03-31 14:33:25 +00:00
"github.com/cloudskiff/driftctl/test"
2021-01-07 09:06:08 +00:00
"github.com/cloudskiff/driftctl/test/acceptance"
)
func TestAcc_AwsS3Bucket_BucketInUsEast1(t *testing.T) {
acceptance.Run(t, acceptance.AccTestCase{
TerraformVersion: "0.14.9",
Paths: []string{"./testdata/acc/aws_s3_bucket"},
2021-07-20 12:42:52 +00:00
Args: []string{"scan", "--filter", "Type=='aws_s3_bucket' || Type=='aws_s3_bucket_policy'", "--deep"},
2021-01-07 09:06:08 +00:00
Checks: []acceptance.AccCheck{
{
Env: map[string]string{
"AWS_REGION": "us-east-1",
},
2021-03-31 14:33:25 +00:00
Check: func(result *test.ScanResult, stdout string, err error) {
2021-01-07 09:06:08 +00:00
if err != nil {
t.Fatal(err)
}
2021-04-29 14:36:05 +00:00
result.AssertManagedCount(5)
// Actually we have a false positive drift on policies due to AWS behavior
// AWS rework policy and mutate single element array into a string
// result.AssertDriftCountTotal(0)
2021-01-07 09:06:08 +00:00
},
},
},
})
}