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

r/glacier_vault: fix policy diff + read after create + refactor tests #12645

Merged
merged 14 commits into from
Jan 29, 2021

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented Apr 2, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #12619 (possibly)
Relates #13826

Release note for CHANGELOG:

resource_aws_glacier_vault: remove from state when vault does not exist.
resource_aws_glacier_vault: add plan time validation to `sns_topic` in the `notification` block.
resource_aws_glacier_vault: add plan time validation to `events` in the `notification` block.
resource_aws_glacier_vault: fix diff for `access_policy`.

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSGlacierVault_'
--- PASS: TestAccAWSGlacierVault_basic (51.11s)
--- PASS: TestAccAWSGlacierVault_tags (145.51s)
--- PASS: TestAccAWSGlacierVault_disappears (32.80s)
--- PASS: TestAccAWSGlacierVault_notification (134.42s)
--- PASS: TestAccAWSGlacierVault_policy (79.08s)

@DrFaust92 DrFaust92 requested a review from a team April 2, 2020 21:40
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/glacier Issues and PRs that pertain to the glacier service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 2, 2020
@ghost ghost added size/L Managed by automation to categorize the size of a PR. size/XL Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. size/L Managed by automation to categorize the size of a PR. labels Apr 29, 2020
@ghost ghost added size/L Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels May 16, 2020
@DrFaust92
Copy link
Collaborator Author

rebased + retested

@ewbankkit
Copy link
Contributor

Verified acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSGlacierVault_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSGlacierVault_ -timeout 120m
=== RUN   TestAccAWSGlacierVault_basic
=== PAUSE TestAccAWSGlacierVault_basic
=== RUN   TestAccAWSGlacierVault_notification
=== PAUSE TestAccAWSGlacierVault_notification
=== RUN   TestAccAWSGlacierVault_policy
=== PAUSE TestAccAWSGlacierVault_policy
=== RUN   TestAccAWSGlacierVault_tags
=== PAUSE TestAccAWSGlacierVault_tags
=== RUN   TestAccAWSGlacierVault_disappears
=== PAUSE TestAccAWSGlacierVault_disappears
=== CONT  TestAccAWSGlacierVault_basic
=== CONT  TestAccAWSGlacierVault_tags
=== CONT  TestAccAWSGlacierVault_disappears
=== CONT  TestAccAWSGlacierVault_policy
=== CONT  TestAccAWSGlacierVault_notification
--- PASS: TestAccAWSGlacierVault_disappears (19.35s)
--- PASS: TestAccAWSGlacierVault_basic (28.48s)
--- PASS: TestAccAWSGlacierVault_policy (31.39s)
--- PASS: TestAccAWSGlacierVault_tags (66.01s)
--- PASS: TestAccAWSGlacierVault_notification (71.82s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	71.875s

@DrFaust92 DrFaust92 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 27, 2020
@DrFaust92 DrFaust92 marked this pull request as draft August 27, 2020 21:54
@DrFaust92 DrFaust92 changed the title r/glacier_vault: fix policy diff + refactor tests r/glacier_vault: fix policy diff + read after create + refactor tests Aug 27, 2020
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Aug 27, 2020
@DrFaust92 DrFaust92 marked this pull request as ready for review August 27, 2020 22:13
@DrFaust92
Copy link
Collaborator Author

Refactored:

--- PASS: TestAccAWSGlacierVault_notification (152.71s)
--- PASS: TestAccAWSGlacierVault_policy (135.11s)
--- PASS: TestAccAWSGlacierVault_tags (133.06s)
--- PASS: TestAccAWSGlacierVault_disappears (41.30s)

Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM.

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSGlacierVault_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSGlacierVault_ -timeout 120m
=== RUN   TestAccAWSGlacierVault_basic
=== PAUSE TestAccAWSGlacierVault_basic
=== RUN   TestAccAWSGlacierVault_notification
=== PAUSE TestAccAWSGlacierVault_notification
=== RUN   TestAccAWSGlacierVault_policy
=== PAUSE TestAccAWSGlacierVault_policy
=== RUN   TestAccAWSGlacierVault_tags
=== PAUSE TestAccAWSGlacierVault_tags
=== RUN   TestAccAWSGlacierVault_disappears
=== PAUSE TestAccAWSGlacierVault_disappears
=== CONT  TestAccAWSGlacierVault_basic
=== CONT  TestAccAWSGlacierVault_tags
=== CONT  TestAccAWSGlacierVault_policy
=== CONT  TestAccAWSGlacierVault_notification
=== CONT  TestAccAWSGlacierVault_disappears
    resource_aws_glacier_vault_test.go:246: [INFO] Got non-empty plan, as expected
--- PASS: TestAccAWSGlacierVault_disappears (19.78s)
--- PASS: TestAccAWSGlacierVault_basic (27.42s)
2020/08/28 09:28:51 [DEBUG] Trying to get account information via sts:GetCallerIdentity
--- PASS: TestAccAWSGlacierVault_tags (59.22s)
--- PASS: TestAccAWSGlacierVault_policy (60.41s)
--- PASS: TestAccAWSGlacierVault_notification (64.91s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	64.957s

remove from state if doesnt exist
add nil check to access policy

refactor and add tests
Base automatically changed from master to main January 23, 2021 00:57
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:57
@bflad bflad added the crash Results from or addresses a Terraform crash or kernel panic. label Jan 29, 2021
@bflad bflad self-assigned this Jan 29, 2021
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you, @DrFaust92 🚀

Output from acceptance testing:

--- PASS: TestAccAWSGlacierVault_disappears (12.48s)
--- PASS: TestAccAWSGlacierVault_basic (17.66s)
--- PASS: TestAccAWSGlacierVault_policy (41.22s)
--- PASS: TestAccAWSGlacierVault_tags (43.39s)
--- PASS: TestAccAWSGlacierVault_notification (46.12s)

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Appease newer static analysis

aws/resource_aws_glacier_vault_test.go Show resolved Hide resolved
aws/resource_aws_glacier_vault_test.go Outdated Show resolved Hide resolved
aws/resource_aws_glacier_vault_test.go Show resolved Hide resolved
aws/resource_aws_glacier_vault_test.go Outdated Show resolved Hide resolved
@bflad bflad merged commit c5375a2 into hashicorp:main Jan 29, 2021
@github-actions github-actions bot added this to the v3.27.0 milestone Jan 29, 2021
bflad added a commit that referenced this pull request Jan 29, 2021
@ghost
Copy link

ghost commented Feb 5, 2021

This has been released in version 3.27.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Feb 28, 2021

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 as resolved and limited conversation to collaborators Feb 28, 2021
@DrFaust92 DrFaust92 deleted the r/glacier_vault_refactor branch April 15, 2021 10:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/glacier Issues and PRs that pertain to the glacier service. size/XL 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.

Glacier vault import fails
3 participants