Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test/resource/aws_s3_bucket: Add EMR bootstrap prefix to sweeper list (…
…hashicorp#10106) Currently the EMR cluster test configuration creates a s3 bucket that is publicly accessible. These buckets are not currently cleaned up after testing so this change updates the s3 sweeper to remove test buckets starting with the prefix `tf-emr-bootstrap`. In the long term, we should determine if EMR bootstrapping supports non-public buckets and update the test configurations with the proper bucket permissions. Before the change: ``` > go test ./aws -v -sweep=us-gov-west-1 -sweep-run=aws_s3_bucket -timeout 10h 2019/09/13 13:22:08 [DEBUG] Running Sweepers for region (us-gov-west-1): 2019/09/13 13:22:08 [DEBUG] Sweeper (aws_s3_bucket) has dependency (aws_s3_bucket_object), running.. 2019/09/13 13:22:08 [INFO] Building AWS auth structure 2019/09/13 13:22:08 [INFO] Setting AWS metadata API timeout to 100ms 2019/09/13 13:22:08 [INFO] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id ... 2019/09/13 13:22:11 [INFO] Skipping S3 Bucket: tf-emr-bootstrap-396768694530128871 ... 2019/09/13 13:22:13 [DEBUG] Sweeper (aws_s3_bucket_object) already ran in region (us-gov-west-1) 2019/09/13 13:22:13 Sweeper Tests ran: - aws_s3_bucket_object - aws_s3_bucket ok github.com/terraform-providers/terraform-provider-aws/aws 5.138s ``` After the change ``` > go test ./aws -v -sweep=us-gov-west-1 -sweep-run=aws_s3_bucket -timeout 10h 2019/09/13 13:34:30 [DEBUG] Running Sweepers for region (us-gov-west-1): 2019/09/13 13:34:30 [DEBUG] Sweeper (aws_s3_bucket) has dependency (aws_s3_bucket_object), running.. 2019/09/13 13:34:30 [INFO] Building AWS auth structure 2019/09/13 13:34:30 [INFO] Setting AWS metadata API timeout to 100ms 2019/09/13 13:34:30 [INFO] Ignoring AWS metadata API endpoint at default location as it doesn't return any instance-id ... 2019/09/13 13:34:33 [INFO] Deleting S3 Bucket (tf-emr-bootstrap-396768694530128871) Object (testscript.sh) Version: null ... 2019/09/13 13:34:38 [DEBUG] Sweeper (aws_s3_bucket_object) already ran in region (us-gov-west-1) 2019/09/13 13:34:38 Sweeper Tests ran: - aws_s3_bucket_object - aws_s3_bucket ok github.com/terraform-providers/terraform-provider-aws/aws 8.158s ```
- Loading branch information