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: Add force_destroy argument #26199

Merged
merged 12 commits into from
Aug 10, 2022

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Aug 9, 2022

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 #13247.

% make testacc TESTARGS='-run=TestAccBackupVault_' PKG=backup ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/backup/... -v -count 1 -parallel 2  -run=TestAccBackupVault_ -timeout 180m
=== RUN   TestAccBackupVault_basic
=== PAUSE TestAccBackupVault_basic
=== RUN   TestAccBackupVault_disappears
=== PAUSE TestAccBackupVault_disappears
=== RUN   TestAccBackupVault_tags
=== PAUSE TestAccBackupVault_tags
=== RUN   TestAccBackupVault_withKMSKey
=== PAUSE TestAccBackupVault_withKMSKey
=== RUN   TestAccBackupVault_forceDestroyEmpty
=== PAUSE TestAccBackupVault_forceDestroyEmpty
=== RUN   TestAccBackupVault_forceDestroyWithRecoveryPoint
=== PAUSE TestAccBackupVault_forceDestroyWithRecoveryPoint
=== CONT  TestAccBackupVault_basic
=== CONT  TestAccBackupVault_withKMSKey
--- PASS: TestAccBackupVault_basic (18.15s)
=== CONT  TestAccBackupVault_tags
--- PASS: TestAccBackupVault_withKMSKey (19.70s)
=== CONT  TestAccBackupVault_disappears
--- PASS: TestAccBackupVault_disappears (11.75s)
=== CONT  TestAccBackupVault_forceDestroyWithRecoveryPoint
--- PASS: TestAccBackupVault_tags (39.77s)
=== CONT  TestAccBackupVault_forceDestroyEmpty
--- PASS: TestAccBackupVault_forceDestroyEmpty (16.52s)
--- PASS: TestAccBackupVault_forceDestroyWithRecoveryPoint (108.87s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	144.511s

Acceptance test output:

% make testacc TESTARGS='-run=TestAccBackupVault_' PKG=backup ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/backup/... -v -count 1 -parallel 1  -run=TestAccBackupVault_ -timeout 180m
=== RUN   TestAccBackupVault_basic
=== PAUSE TestAccBackupVault_basic
=== RUN   TestAccBackupVault_disappears
=== PAUSE TestAccBackupVault_disappears
=== RUN   TestAccBackupVault_tags
=== PAUSE TestAccBackupVault_tags
=== RUN   TestAccBackupVault_withKMSKey
=== PAUSE TestAccBackupVault_withKMSKey
=== CONT  TestAccBackupVault_basic
--- PASS: TestAccBackupVault_basic (17.52s)
=== CONT  TestAccBackupVault_tags
--- PASS: TestAccBackupVault_tags (37.63s)
=== CONT  TestAccBackupVault_withKMSKey
--- PASS: TestAccBackupVault_withKMSKey (17.59s)
=== CONT  TestAccBackupVault_disappears
--- PASS: TestAccBackupVault_disappears (11.44s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	88.100s
Acceptance test output:

% make testacc TESTARGS='-run=TestAccBackupVault_forceDestroy' PKG=backup ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/backup/... -v -count 1 -parallel 1  -run=TestAccBackupVault_forceDestroy -timeout 180m
=== RUN   TestAccBackupVault_forceDestroyEmpty
=== PAUSE TestAccBackupVault_forceDestroyEmpty
=== CONT  TestAccBackupVault_forceDestroyEmpty
--- PASS: TestAccBackupVault_forceDestroyEmpty (23.93s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	31.410s
@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/backup Issues and PRs that pertain to the backup service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL Managed by automation to categorize the size of a PR. labels Aug 9, 2022
ewbankkit and others added 4 commits August 9, 2022 16:21
…oint'.

Acceptance test output:

% make testacc TESTARGS='-run=TestAccBackupVault_forceDestroyWithRecoveryPoint' PKG=backup ACCTEST_PARALLELISM=1
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/backup/... -v -count 1 -parallel 1  -run=TestAccBackupVault_forceDestroyWithRecoveryPoint -timeout 180m
=== RUN   TestAccBackupVault_forceDestroyWithRecoveryPoint
=== PAUSE TestAccBackupVault_forceDestroyWithRecoveryPoint
=== CONT  TestAccBackupVault_forceDestroyWithRecoveryPoint
--- PASS: TestAccBackupVault_forceDestroyWithRecoveryPoint (110.64s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	114.576s
Hello!

Usecase:
in `backup_aws_vault`, if you set the variable `vault_name` with a string of more than 50 characters, instead of a length error, it raises:
`"must consist of lowercase letters, numbers, and hyphens."`

I think it should raise something along the line of:
`expected length of name to be in the range (1 - 50)`

I think this regex is to blame (the last part of the regex):
`^[a-zA-Z0-9\-\_\.]{1, 50}$`

Proposed solution:
Split the validation into syntax validation and length validation
@ewbankkit ewbankkit merged commit fc43804 into main Aug 10, 2022
@ewbankkit ewbankkit deleted the f-aws_backup_vault.force_delete branch August 10, 2022 13:54
@github-actions github-actions bot added this to the v4.26.0 milestone Aug 10, 2022
github-actions bot pushed a commit that referenced this pull request Aug 10, 2022
@github-actions
Copy link

This functionality has been released in v4.26.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 Sep 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/backup Issues and PRs that pertain to the backup 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.

Add force_delete to aws_backup_vault resource
2 participants