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/aws_backup_vault_policy: sweeper should not fail on AccessDeniedException #19854

Merged

Conversation

GavinWu1991
Copy link
Contributor

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 #19848

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAwsBackupVaultPolicy_*'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsBackupVaultPolicy_* -timeout 180m
=== RUN   TestAccAwsBackupVaultPolicy_basic
=== PAUSE TestAccAwsBackupVaultPolicy_basic
=== RUN   TestAccAwsBackupVaultPolicy_disappears
=== PAUSE TestAccAwsBackupVaultPolicy_disappears
=== CONT  TestAccAwsBackupVaultPolicy_basic
=== CONT  TestAccAwsBackupVaultPolicy_disappears
--- PASS: TestAccAwsBackupVaultPolicy_basic (173.38s)
--- PASS: TestAccAwsBackupVaultPolicy_disappears (177.83s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       179.798s

@GavinWu1991 GavinWu1991 requested a review from ewbankkit as a code owner June 17, 2021 13:58
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/backup Issues and PRs that pertain to the backup service. size/XS Managed by automation to categorize the size of a PR. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 17, 2021
Gavin and others added 4 commits June 23, 2021 12:38
…s been deleted.

Acceptance test output:

% make testacc TEST=./aws TESTARGS='-run=TestAccAwsBackupVaultPolicy_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsBackupVaultPolicy_ -timeout 180m
=== RUN   TestAccAwsBackupVaultPolicy_basic
=== PAUSE TestAccAwsBackupVaultPolicy_basic
=== RUN   TestAccAwsBackupVaultPolicy_disappears
=== PAUSE TestAccAwsBackupVaultPolicy_disappears
=== CONT  TestAccAwsBackupVaultPolicy_basic
=== CONT  TestAccAwsBackupVaultPolicy_disappears
--- PASS: TestAccAwsBackupVaultPolicy_disappears (12.99s)
--- PASS: TestAccAwsBackupVaultPolicy_basic (25.17s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	28.498s
@ewbankkit ewbankkit added service/backup Issues and PRs that pertain to the backup service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jun 23, 2021
…sweeper.

Acceptance test output:

% make testacc TEST=./aws TESTARGS='-run=TestAccAwsBackupVaultPolicy_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsBackupVaultPolicy_ -timeout 180m
=== RUN   TestAccAwsBackupVaultPolicy_basic
=== PAUSE TestAccAwsBackupVaultPolicy_basic
=== RUN   TestAccAwsBackupVaultPolicy_disappears
=== PAUSE TestAccAwsBackupVaultPolicy_disappears
=== RUN   TestAccAwsBackupVaultPolicy_disappears_vault
=== PAUSE TestAccAwsBackupVaultPolicy_disappears_vault
=== CONT  TestAccAwsBackupVaultPolicy_basic
=== CONT  TestAccAwsBackupVaultPolicy_disappears_vault
=== CONT  TestAccAwsBackupVaultPolicy_disappears
--- PASS: TestAccAwsBackupVaultPolicy_disappears_vault (12.00s)
--- PASS: TestAccAwsBackupVaultPolicy_disappears (13.96s)
--- PASS: TestAccAwsBackupVaultPolicy_basic (25.44s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	28.825s

% TEST=./aws SWEEP=us-east-1,us-east-2,us-west-1,us-west-2 SWEEPARGS=-sweep-run=aws_backup_vault_policy make sweep
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./aws -v -sweep=us-east-1,us-east-2,us-west-1,us-west-2 -sweep-run=aws_backup_vault_policy -timeout 60m
2021/06/23 13:43:16 [DEBUG] Running Sweepers for region (us-east-1):
2021/06/23 13:43:16 [DEBUG] Running Sweeper (aws_backup_vault_policy) in region (us-east-1)
2021/06/23 13:43:16 [INFO] AWS Auth provider used: "EnvProvider"
2021/06/23 13:43:16 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/23 13:43:16 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/23 13:43:17 [DEBUG] Waiting for state to become: [success]
2021/06/23 13:43:17 [DEBUG] Deleting Backup Vault Policy (Default)
2021/06/23 13:43:17 Sweeper Tests ran successfully:
	- aws_backup_vault_policy
2021/06/23 13:43:17 [DEBUG] Running Sweepers for region (us-east-2):
2021/06/23 13:43:17 [DEBUG] Running Sweeper (aws_backup_vault_policy) in region (us-east-2)
2021/06/23 13:43:17 [INFO] AWS Auth provider used: "EnvProvider"
2021/06/23 13:43:17 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/23 13:43:17 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/23 13:43:17 Sweeper Tests ran successfully:
	- aws_backup_vault_policy
2021/06/23 13:43:17 [DEBUG] Running Sweepers for region (us-west-1):
2021/06/23 13:43:17 [DEBUG] Running Sweeper (aws_backup_vault_policy) in region (us-west-1)
2021/06/23 13:43:17 [INFO] AWS Auth provider used: "EnvProvider"
2021/06/23 13:43:17 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/23 13:43:17 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/23 13:43:18 Sweeper Tests ran successfully:
	- aws_backup_vault_policy
2021/06/23 13:43:18 [DEBUG] Running Sweepers for region (us-west-2):
2021/06/23 13:43:18 [DEBUG] Running Sweeper (aws_backup_vault_policy) in region (us-west-2)
2021/06/23 13:43:18 [INFO] AWS Auth provider used: "EnvProvider"
2021/06/23 13:43:18 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/23 13:43:19 [DEBUG] Trying to get account information via sts:GetCallerIdentity
2021/06/23 13:43:19 [DEBUG] Waiting for state to become: [success]
2021/06/23 13:43:19 [DEBUG] Waiting for state to become: [success]
2021/06/23 13:43:19 [DEBUG] Deleting Backup Vault Policy (Default)
2021/06/23 13:43:19 [DEBUG] Deleting Backup Vault Policy (aws/efs/automatic-backup-vault)
2021/06/23 13:43:20 Sweeper Tests ran successfully:
	- aws_backup_vault_policy
ok  	github.com/terraform-providers/terraform-provider-aws/aws	7.233s
@ewbankkit ewbankkit force-pushed the f-aws-backup-vault-policy-sweeper branch from 88df6f9 to 4875d0d Compare June 23, 2021 17:51
@github-actions github-actions bot added size/L Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Jun 23, 2021
@ewbankkit
Copy link
Contributor

@GavinWu1991 Thanks for the contribution 🎉 👏.
I incorporated work from #19749 and added some additional testing.

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 🚀.

Commercial
% make testacc TEST=./aws TESTARGS='-run=TestAccAwsBackupVaultPolicy_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsBackupVaultPolicy_ -timeout 180m
=== RUN   TestAccAwsBackupVaultPolicy_basic
=== PAUSE TestAccAwsBackupVaultPolicy_basic
=== RUN   TestAccAwsBackupVaultPolicy_disappears
=== PAUSE TestAccAwsBackupVaultPolicy_disappears
=== RUN   TestAccAwsBackupVaultPolicy_disappears_vault
=== PAUSE TestAccAwsBackupVaultPolicy_disappears_vault
=== CONT  TestAccAwsBackupVaultPolicy_basic
=== CONT  TestAccAwsBackupVaultPolicy_disappears_vault
=== CONT  TestAccAwsBackupVaultPolicy_disappears
--- PASS: TestAccAwsBackupVaultPolicy_disappears_vault (12.00s)
--- PASS: TestAccAwsBackupVaultPolicy_disappears (13.96s)
--- PASS: TestAccAwsBackupVaultPolicy_basic (25.44s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	28.825s
GovCloud
% make testacc TEST=./aws TESTARGS='-run=TestAccAwsBackupVaultPolicy_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsBackupVaultPolicy_ -timeout 180m
=== RUN   TestAccAwsBackupVaultPolicy_basic
=== PAUSE TestAccAwsBackupVaultPolicy_basic
=== RUN   TestAccAwsBackupVaultPolicy_disappears
=== PAUSE TestAccAwsBackupVaultPolicy_disappears
=== RUN   TestAccAwsBackupVaultPolicy_disappears_vault
=== PAUSE TestAccAwsBackupVaultPolicy_disappears_vault
=== CONT  TestAccAwsBackupVaultPolicy_basic
=== CONT  TestAccAwsBackupVaultPolicy_disappears_vault
=== CONT  TestAccAwsBackupVaultPolicy_disappears
--- PASS: TestAccAwsBackupVaultPolicy_disappears_vault (14.34s)
--- PASS: TestAccAwsBackupVaultPolicy_disappears (16.81s)
--- PASS: TestAccAwsBackupVaultPolicy_basic (32.25s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	35.288s

@ewbankkit ewbankkit merged commit fae0277 into hashicorp:main Jun 23, 2021
@github-actions github-actions bot added this to the v3.47.0 milestone Jun 23, 2021
@github-actions
Copy link

This functionality has been released in v3.47.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. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/backup Issues and PRs that pertain to the backup service. size/L 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.

sweeper/aws_backup_vault_policy: Sweeper should not fail on AccessDeniedException
2 participants