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

backup/selection_type: add conditions and not_resources fields #22074

Merged
merged 11 commits into from
Jan 10, 2022

Conversation

leanenkaa
Copy link
Contributor

@leanenkaa leanenkaa commented Dec 6, 2021

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

Output from acceptance testing:
TESTARGS='-run=TestAccBackup' PKG=backup make testacc

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/backup/... -v -count 1 -parallel 20 -run=TestAccBackup -timeout 180m
=== RUN   TestAccBackupGlobalSettings_basic
=== PAUSE TestAccBackupGlobalSettings_basic
=== RUN   TestAccBackupPlanDataSource_basic
=== PAUSE TestAccBackupPlanDataSource_basic
=== RUN   TestAccBackupPlan_basic
=== PAUSE TestAccBackupPlan_basic
=== RUN   TestAccBackupPlan_withTags
=== PAUSE TestAccBackupPlan_withTags
=== RUN   TestAccBackupPlan_withRules
=== PAUSE TestAccBackupPlan_withRules
=== RUN   TestAccBackupPlan_withLifecycle
=== PAUSE TestAccBackupPlan_withLifecycle
=== RUN   TestAccBackupPlan_withRecoveryPointTags
=== PAUSE TestAccBackupPlan_withRecoveryPointTags
=== RUN   TestAccBackupPlan_RuleCopyAction_sameRegion
=== PAUSE TestAccBackupPlan_RuleCopyAction_sameRegion
=== RUN   TestAccBackupPlan_RuleCopyAction_noLifecycle
=== PAUSE TestAccBackupPlan_RuleCopyAction_noLifecycle
=== RUN   TestAccBackupPlan_RuleCopyAction_multiple
=== PAUSE TestAccBackupPlan_RuleCopyAction_multiple
=== RUN   TestAccBackupPlan_RuleCopyAction_crossRegion
=== PAUSE TestAccBackupPlan_RuleCopyAction_crossRegion
=== RUN   TestAccBackupPlan_advancedBackupSetting
=== PAUSE TestAccBackupPlan_advancedBackupSetting
=== RUN   TestAccBackupPlan_enableContinuousBackup
=== PAUSE TestAccBackupPlan_enableContinuousBackup
=== RUN   TestAccBackupPlan_disappears
=== PAUSE TestAccBackupPlan_disappears
=== RUN   TestAccBackupRegionSettings_basic
=== PAUSE TestAccBackupRegionSettings_basic
=== RUN   TestAccBackupSelectionDataSource_basic
=== PAUSE TestAccBackupSelectionDataSource_basic
=== RUN   TestAccBackupSelection_basic
=== PAUSE TestAccBackupSelection_basic
=== RUN   TestAccBackupSelection_disappears
=== PAUSE TestAccBackupSelection_disappears
=== RUN   TestAccBackupSelection_Disappears_backupPlan
=== PAUSE TestAccBackupSelection_Disappears_backupPlan
=== RUN   TestAccBackupSelection_withTags
=== PAUSE TestAccBackupSelection_withTags
=== RUN   TestAccBackupSelection_ConditionsWithTags
=== PAUSE TestAccBackupSelection_ConditionsWithTags
=== RUN   TestAccBackupSelection_withResources
=== PAUSE TestAccBackupSelection_withResources
=== RUN   TestAccBackupSelection_withNotResources
=== PAUSE TestAccBackupSelection_withNotResources
=== RUN   TestAccBackupSelection_updateTag
=== PAUSE TestAccBackupSelection_updateTag
=== RUN   TestAccBackupVaultDataSource_basic
=== PAUSE TestAccBackupVaultDataSource_basic
=== RUN   TestAccBackupVaultLockConfiguration_basic
=== PAUSE TestAccBackupVaultLockConfiguration_basic
=== RUN   TestAccBackupVaultLockConfiguration_disappears
=== PAUSE TestAccBackupVaultLockConfiguration_disappears
=== RUN   TestAccBackupVaultNotification_basic
=== PAUSE TestAccBackupVaultNotification_basic
=== RUN   TestAccBackupVaultNotification_disappears
=== PAUSE TestAccBackupVaultNotification_disappears
=== RUN   TestAccBackupVaultPolicy_basic
=== PAUSE TestAccBackupVaultPolicy_basic
=== RUN   TestAccBackupVaultPolicy_disappears
=== PAUSE TestAccBackupVaultPolicy_disappears
=== RUN   TestAccBackupVaultPolicy_Disappears_vault
=== PAUSE TestAccBackupVaultPolicy_Disappears_vault
=== RUN   TestAccBackupVault_basic
=== PAUSE TestAccBackupVault_basic
=== RUN   TestAccBackupVault_withKMSKey
=== PAUSE TestAccBackupVault_withKMSKey
=== RUN   TestAccBackupVault_withTags
=== PAUSE TestAccBackupVault_withTags
=== RUN   TestAccBackupVault_disappears
=== PAUSE TestAccBackupVault_disappears
=== CONT  TestAccBackupVaultNotification_basic
=== CONT  TestAccBackupGlobalSettings_basic
=== CONT  TestAccBackupVaultPolicy_disappears
=== CONT  TestAccBackupVaultPolicy_Disappears_vault
=== CONT  TestAccBackupVaultPolicy_basic
=== CONT  TestAccBackupVault_withTags
=== CONT  TestAccBackupVault_disappears
=== CONT  TestAccBackupPlan_RuleCopyAction_multiple
=== CONT  TestAccBackupSelection_disappears
=== CONT  TestAccBackupSelection_basic
=== CONT  TestAccBackupSelectionDataSource_basic
=== CONT  TestAccBackupRegionSettings_basic
=== CONT  TestAccBackupPlan_disappears
=== CONT  TestAccBackupPlan_enableContinuousBackup
=== CONT  TestAccBackupPlan_advancedBackupSetting
=== CONT  TestAccBackupPlan_RuleCopyAction_crossRegion
=== CONT  TestAccBackupPlan_withLifecycle
=== CONT  TestAccBackupPlan_RuleCopyAction_noLifecycle
=== CONT  TestAccBackupPlan_RuleCopyAction_sameRegion
=== CONT  TestAccBackupPlan_withRecoveryPointTags
=== CONT  TestAccBackupGlobalSettings_basic
    acctest.go:696: this AWS account must be the management account of an AWS Organization
--- SKIP: TestAccBackupGlobalSettings_basic (3.65s)
=== CONT  TestAccBackupPlan_withTags
--- PASS: TestAccBackupVault_disappears (35.07s)
=== CONT  TestAccBackupPlan_withRules
--- PASS: TestAccBackupVaultPolicy_Disappears_vault (40.86s)
=== CONT  TestAccBackupSelection_updateTag
--- PASS: TestAccBackupPlan_disappears (46.30s)
=== CONT  TestAccBackupVaultLockConfiguration_disappears
--- PASS: TestAccBackupVaultPolicy_disappears (46.61s)
=== CONT  TestAccBackupVaultLockConfiguration_basic
--- PASS: TestAccBackupSelection_disappears (47.56s)
=== CONT  TestAccBackupVaultDataSource_basic
--- PASS: TestAccBackupVaultNotification_basic (48.15s)
=== CONT  TestAccBackupSelection_withResources
--- PASS: TestAccBackupSelectionDataSource_basic (49.20s)
=== CONT  TestAccBackupSelection_withNotResources
--- PASS: TestAccBackupPlan_enableContinuousBackup (51.37s)
=== CONT  TestAccBackupPlan_basic
--- PASS: TestAccBackupPlan_RuleCopyAction_multiple (53.01s)
=== CONT  TestAccBackupVault_withKMSKey
--- PASS: TestAccBackupSelection_basic (53.78s)
=== CONT  TestAccBackupPlanDataSource_basic
--- PASS: TestAccBackupPlan_RuleCopyAction_crossRegion (60.00s)
=== CONT  TestAccBackupVaultNotification_disappears
--- PASS: TestAccBackupVaultPolicy_basic (71.97s)
=== CONT  TestAccBackupSelection_ConditionsWithTags
--- PASS: TestAccBackupPlan_advancedBackupSetting (78.40s)
=== CONT  TestAccBackupSelection_withTags
--- PASS: TestAccBackupVaultLockConfiguration_disappears (35.46s)
=== CONT  TestAccBackupSelection_Disappears_backupPlan
--- PASS: TestAccBackupVaultLockConfiguration_basic (38.89s)
=== CONT  TestAccBackupVault_basic
--- PASS: TestAccBackupVaultDataSource_basic (38.10s)
--- PASS: TestAccBackupPlan_basic (40.06s)
--- PASS: TestAccBackupSelection_withNotResources (42.49s)
--- PASS: TestAccBackupVaultNotification_disappears (34.32s)
--- PASS: TestAccBackupRegionSettings_basic (94.39s)
--- PASS: TestAccBackupPlanDataSource_basic (41.13s)
--- PASS: TestAccBackupVault_withKMSKey (42.24s)
--- PASS: TestAccBackupVault_withTags (96.30s)
--- PASS: TestAccBackupSelection_withResources (50.24s)
--- PASS: TestAccBackupPlan_RuleCopyAction_sameRegion (103.74s)
--- PASS: TestAccBackupPlan_withRecoveryPointTags (104.33s)
--- PASS: TestAccBackupPlan_withTags (101.04s)
--- PASS: TestAccBackupPlan_RuleCopyAction_noLifecycle (104.91s)
--- PASS: TestAccBackupSelection_ConditionsWithTags (37.15s)
--- PASS: TestAccBackupSelection_updateTag (69.01s)
--- PASS: TestAccBackupVault_basic (27.59s)
--- PASS: TestAccBackupSelection_Disappears_backupPlan (31.34s)
--- PASS: TestAccBackupSelection_withTags (36.19s)
--- PASS: TestAccBackupPlan_withLifecycle (120.42s)
--- PASS: TestAccBackupPlan_withRules (87.63s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	129.545s

@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. 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 Dec 6, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @leonenkoa 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 7, 2021
@leanenkaa leanenkaa changed the title Add conditions to backup service backup/selection_type: add conditions and not_resource fields Dec 9, 2021
@leanenkaa leanenkaa changed the title backup/selection_type: add conditions and not_resource fields backup/selection_type: add conditions and not_resources fields Dec 9, 2021
@leanenkaa leanenkaa requested a review from ewbankkit as a code owner January 10, 2022 11:35
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Jan 10, 2022
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 TESTARGS='-run=TestAccBackupSelection_\|TestAccBackupSelectionDataSource_' PKG_NAME=internal/service/backup
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/backup/... -v -count 1 -parallel 20 -run=TestAccBackupSelection_\|TestAccBackupSelectionDataSource_ -timeout 180m
=== RUN   TestAccBackupSelectionDataSource_basic
=== PAUSE TestAccBackupSelectionDataSource_basic
=== RUN   TestAccBackupSelection_basic
=== PAUSE TestAccBackupSelection_basic
=== RUN   TestAccBackupSelection_disappears
=== PAUSE TestAccBackupSelection_disappears
=== RUN   TestAccBackupSelection_Disappears_backupPlan
=== PAUSE TestAccBackupSelection_Disappears_backupPlan
=== RUN   TestAccBackupSelection_withTags
=== PAUSE TestAccBackupSelection_withTags
=== RUN   TestAccBackupSelection_ConditionsWithTags
=== PAUSE TestAccBackupSelection_ConditionsWithTags
=== RUN   TestAccBackupSelection_withResources
=== PAUSE TestAccBackupSelection_withResources
=== RUN   TestAccBackupSelection_withNotResources
=== PAUSE TestAccBackupSelection_withNotResources
=== RUN   TestAccBackupSelection_updateTag
=== PAUSE TestAccBackupSelection_updateTag
=== CONT  TestAccBackupSelectionDataSource_basic
=== CONT  TestAccBackupSelection_withResources
=== CONT  TestAccBackupSelection_Disappears_backupPlan
=== CONT  TestAccBackupSelection_withNotResources
=== CONT  TestAccBackupSelection_disappears
=== CONT  TestAccBackupSelection_updateTag
=== CONT  TestAccBackupSelection_ConditionsWithTags
=== CONT  TestAccBackupSelection_withTags
=== CONT  TestAccBackupSelection_basic
--- PASS: TestAccBackupSelection_Disappears_backupPlan (24.87s)
--- PASS: TestAccBackupSelection_disappears (26.00s)
--- PASS: TestAccBackupSelectionDataSource_basic (26.64s)
--- PASS: TestAccBackupSelection_withNotResources (27.26s)
--- PASS: TestAccBackupSelection_basic (28.92s)
--- PASS: TestAccBackupSelection_ConditionsWithTags (28.92s)
--- PASS: TestAccBackupSelection_withTags (29.72s)
--- PASS: TestAccBackupSelection_withResources (37.18s)
--- PASS: TestAccBackupSelection_updateTag (42.98s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	47.737s
GovCloud
% make testacc TESTARGS='-run=TestAccBackupSelection_\|TestAccBackupSelectionDataSource_' PKG_NAME=internal/service/backup
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/backup/... -v -count 1 -parallel 20 -run=TestAccBackupSelection_\|TestAccBackupSelectionDataSource_ -timeout 180m
=== RUN   TestAccBackupSelectionDataSource_basic
=== PAUSE TestAccBackupSelectionDataSource_basic
=== RUN   TestAccBackupSelection_basic
=== PAUSE TestAccBackupSelection_basic
=== RUN   TestAccBackupSelection_disappears
=== PAUSE TestAccBackupSelection_disappears
=== RUN   TestAccBackupSelection_Disappears_backupPlan
=== PAUSE TestAccBackupSelection_Disappears_backupPlan
=== RUN   TestAccBackupSelection_withTags
=== PAUSE TestAccBackupSelection_withTags
=== RUN   TestAccBackupSelection_ConditionsWithTags
=== PAUSE TestAccBackupSelection_ConditionsWithTags
=== RUN   TestAccBackupSelection_withResources
=== PAUSE TestAccBackupSelection_withResources
=== RUN   TestAccBackupSelection_withNotResources
=== PAUSE TestAccBackupSelection_withNotResources
=== RUN   TestAccBackupSelection_updateTag
=== PAUSE TestAccBackupSelection_updateTag
=== CONT  TestAccBackupSelectionDataSource_basic
=== CONT  TestAccBackupSelection_ConditionsWithTags
=== CONT  TestAccBackupSelection_basic
=== CONT  TestAccBackupSelection_withResources
=== CONT  TestAccBackupSelection_Disappears_backupPlan
=== CONT  TestAccBackupSelection_withTags
=== CONT  TestAccBackupSelection_updateTag
=== CONT  TestAccBackupSelection_disappears
=== CONT  TestAccBackupSelection_withNotResources
--- PASS: TestAccBackupSelection_Disappears_backupPlan (29.67s)
--- PASS: TestAccBackupSelection_disappears (30.52s)
--- PASS: TestAccBackupSelectionDataSource_basic (31.26s)
--- PASS: TestAccBackupSelection_withNotResources (35.72s)
--- PASS: TestAccBackupSelection_basic (35.72s)
--- PASS: TestAccBackupSelection_withTags (35.74s)
--- PASS: TestAccBackupSelection_ConditionsWithTags (35.77s)
--- PASS: TestAccBackupSelection_withResources (41.27s)
--- PASS: TestAccBackupSelection_updateTag (51.07s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	54.236s

@ewbankkit
Copy link
Contributor

@leonenkoa Thanks for the contribution 🎉 👏.
In general everything looks great.
I changed the conditions configuration block name to condition.

@ewbankkit ewbankkit merged commit 14ead7a into hashicorp:main Jan 10, 2022
@github-actions github-actions bot added this to the v3.72.0 milestone Jan 10, 2022
@github-actions
Copy link

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

@tdmalone
Copy link
Contributor

(likely) causes #22595

@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 May 27, 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. enhancement Requests to existing resources that expand the functionality or scope. 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.

Support for recent AWS Backup selection improvements
4 participants