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: Fix empty result errors reading vaults in certain Regions #39670

Merged
merged 3 commits into from
Oct 10, 2024

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Oct 10, 2024

Description

VaultType will be empty ("") in Regions that don't support Logically Air Gapped Vaults.

Relations

Closes #39664.
Closes #39650.
Relates #39098.

Output from Acceptance Testing

Before

% AWS_DEFAULT_REGION=ca-west-1 make testacc TESTARGS='-run=TestAccBackupVault_basic' PKG=backup
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/backup/... -v -count 1 -parallel 20  -run=TestAccBackupVault_basic -timeout 360m
2024/10/10 08:24:40 Initializing Terraform AWS Provider...
=== RUN   TestAccBackupVault_basic
=== PAUSE TestAccBackupVault_basic
=== CONT  TestAccBackupVault_basic
    vault_test.go:36: Step 1/2 error: Error running apply: exit status 1
        
        Error: reading Backup Vault (tf-acc-test-5117170325796173347): empty result
        
          with aws_backup_vault.test,
          on terraform_plugin_test.tf line 12, in resource "aws_backup_vault" "test":
          12: resource "aws_backup_vault" "test" {
        
--- FAIL: TestAccBackupVault_basic (7.40s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/backup	12.336s
FAIL
make: *** [testacc] Error 1

After

% AWS_DEFAULT_REGION=ca-west-1 make testacc TESTARGS='-run=TestAccBackupVault_basic' PKG=backup
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/backup/... -v -count 1 -parallel 20  -run=TestAccBackupVault_basic -timeout 360m
2024/10/10 08:40:43 Initializing Terraform AWS Provider...
=== RUN   TestAccBackupVault_basic
=== PAUSE TestAccBackupVault_basic
=== CONT  TestAccBackupVault_basic
--- PASS: TestAccBackupVault_basic (14.29s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	19.353s
% make testacc TESTARGS='-run=TestAccBackupVault_basic\|TestAccBackupLogicallyAirGappedVault_basic' PKG=backup
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/backup/... -v -count 1 -parallel 20  -run=TestAccBackupVault_basic\|TestAccBackupLogicallyAirGappedVault_basic -timeout 360m
2024/10/10 10:42:07 Initializing Terraform AWS Provider...
=== RUN   TestAccBackupLogicallyAirGappedVault_basic
=== PAUSE TestAccBackupLogicallyAirGappedVault_basic
=== RUN   TestAccBackupVault_basic
=== PAUSE TestAccBackupVault_basic
=== CONT  TestAccBackupLogicallyAirGappedVault_basic
=== CONT  TestAccBackupVault_basic
--- PASS: TestAccBackupVault_basic (14.01s)
--- PASS: TestAccBackupLogicallyAirGappedVault_basic (149.75s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	154.842s

@ewbankkit ewbankkit requested a review from a team as a code owner October 10, 2024 14:37
Copy link

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added service/backup Issues and PRs that pertain to the backup service. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels Oct 10, 2024
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Oct 10, 2024
@tanadeau
Copy link

@ewbankkit: In GovCloud, it looks like the VaultType is null and not empty.

@ewbankkit
Copy link
Contributor Author

Verified in US GovCloud:

% hashigovaws 
Setting HashiCorp AWS GovCloud credentials
% make testacc TESTARGS='-run=TestAccBackupVault_basic' PKG=backup
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/backup/... -v -count 1 -parallel 20  -run=TestAccBackupVault_basic -timeout 360m
2024/10/10 13:22:41 Initializing Terraform AWS Provider...
=== RUN   TestAccBackupVault_basic
=== PAUSE TestAccBackupVault_basic
=== CONT  TestAccBackupVault_basic
--- PASS: TestAccBackupVault_basic (13.56s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	18.583s

@tanadeau A null in the JSON returned from the Backup service becomes an empty string in the Go API.

@ewbankkit ewbankkit merged commit 6d9b545 into main Oct 10, 2024
51 checks passed
@ewbankkit ewbankkit deleted the b-aws_backup_vault-not-found.ca-central-1 branch October 10, 2024 18:53
@github-actions github-actions bot added this to the v5.71.0 milestone Oct 10, 2024
terraform-aws-provider bot pushed a commit that referenced this pull request Oct 10, 2024
Copy link

This functionality has been released in v5.72.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 15, 2024
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 Nov 16, 2024
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. service/backup Issues and PRs that pertain to the backup service.
Projects
None yet
3 participants