Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/resource/aws_s3_bucket_policy: Fix expected policy with data-source/aws_iam_policy_document wildcard handling #4602

Merged
merged 1 commit into from
May 22, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented May 21, 2018

Followup to #4248

Changes proposed in this pull request:

Previously:

=== RUN   TestAccAWSS3BucketPolicy_basic
--- FAIL: TestAccAWSS3BucketPolicy_basic (21.16s)
    testing.go:518: Step 0 error: Check failed: Check 2/2 error: Non-equivalent policy error:
        
        expected: {"Version":"2012-10-17","Statement":[{"Sid": "", "Effect":"Allow","Principal":"*","Action":"s3:*","Resource":["arn:aws:s3:::tf-test-bucket-4419237844750449962/*","arn:aws:s3:::tf-test-bucket-4419237844750449962"]}]}
        
             got: {"Version":"2012-10-17","Statement":[{"Sid":"","Effect":"Allow","Principal":{"AWS":"*"},"Action":"s3:*","Resource":["arn:aws:s3:::tf-test-bucket-4419237844750449962/*","arn:aws:s3:::tf-test-bucket-4419237844750449962"]}]}

=== RUN   TestAccAWSS3BucketPolicy_policyUpdate
--- FAIL: TestAccAWSS3BucketPolicy_policyUpdate (10.80s)
    testing.go:518: Step 0 error: Check failed: Check 2/2 error: Non-equivalent policy error:
        
        expected: {"Version":"2012-10-17","Statement":[{"Sid": "", "Effect":"Allow","Principal":"*","Action":"s3:*","Resource":["arn:aws:s3:::tf-test-bucket-7001005429761437413/*","arn:aws:s3:::tf-test-bucket-7001005429761437413"]}]}
        
             got: {"Version":"2012-10-17","Statement":[{"Sid":"","Effect":"Allow","Principal":{"AWS":"*"},"Action":"s3:*","Resource":["arn:aws:s3:::tf-test-bucket-7001005429761437413/*","arn:aws:s3:::tf-test-bucket-7001005429761437413"]}]}

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSS3BucketPolicy'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSS3BucketPolicy -timeout 120m
=== RUN   TestAccAWSS3BucketPolicy_basic
--- PASS: TestAccAWSS3BucketPolicy_basic (34.86s)
=== RUN   TestAccAWSS3BucketPolicy_policyUpdate
--- PASS: TestAccAWSS3BucketPolicy_policyUpdate (48.12s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	83.013s

…urce/aws_iam_policy_document wildcard handling
@bflad bflad added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/s3 Issues and PRs that pertain to the s3 service. labels May 21, 2018
@bflad bflad added this to the v1.20.0 milestone May 21, 2018
@bflad bflad requested a review from a team May 21, 2018 20:08
@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label May 21, 2018
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@bflad bflad merged commit a6925ba into master May 22, 2018
@bflad bflad deleted the t-aws_s3_bucket_policy-fix-wildcard branch May 22, 2018 13:39
@ghost
Copy link

ghost commented Apr 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/s3 Issues and PRs that pertain to the s3 service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants