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_framework #23175

Merged
merged 25 commits into from
Feb 14, 2022
Merged

Conversation

GlennChia
Copy link
Collaborator

@GlennChia GlennChia commented Feb 14, 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 #21784

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccBackupFramework' 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=TestAccBackupFramework -timeout 180m
=== RUN   TestAccBackupFramework_basic
=== PAUSE TestAccBackupFramework_basic
=== RUN   TestAccBackupFramework_updateTags
=== PAUSE TestAccBackupFramework_updateTags
=== RUN   TestAccBackupFramework_updateControlScope
=== PAUSE TestAccBackupFramework_updateControlScope
=== RUN   TestAccBackupFramework_updateControlInputParameters
=== PAUSE TestAccBackupFramework_updateControlInputParameters
=== RUN   TestAccBackupFramework_updateControls
=== PAUSE TestAccBackupFramework_updateControls
=== RUN   TestAccBackupFramework_disappears
=== PAUSE TestAccBackupFramework_disappears
=== CONT  TestAccBackupFramework_basic
--- PASS: TestAccBackupFramework_basic (75.86s)
=== CONT  TestAccBackupFramework_updateControlInputParameters
--- PASS: TestAccBackupFramework_updateControlInputParameters (78.05s)
=== CONT  TestAccBackupFramework_disappears
--- PASS: TestAccBackupFramework_disappears (30.73s)
=== CONT  TestAccBackupFramework_updateControls
--- PASS: TestAccBackupFramework_updateControls (87.09s)
=== CONT  TestAccBackupFramework_updateControlScope
--- PASS: TestAccBackupFramework_updateControlScope (185.90s)
=== CONT  TestAccBackupFramework_updateTags
--- PASS: TestAccBackupFramework_updateTags (102.67s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/backup     575.258s

...

Reference docs

Misc - Note/Gotchas

  • For the tests, we do not necessarily need to turn on resource tracking to enable AWS Config recording to track configuration changes of your backup resources. If turned on from the console, the deployment_status will be COMPLETED instead of FAILED. However, regardless of the deployment_status, the updates will still work and tests will still pass. Hence, I did not add a pre check to check for the Service Linked Role (this role is AWSServiceRoleForConfig)
    image

  • Waiters are implemented because of eventual consistency. Timeouts default to 2 minutes for Create, Update, Delete operations. The timeouts block is documented.

  • For the TestAccBackupFramework_updateControlScope in Step 7/7, I noticed it appends an additional { ControlName: "" } element in Framework Controls which initially failed the tests. The error was A control name is required. To fix this, I added a check for the empty name in the expandFrameworkControls function, skipping that iteration of the loop if it finds this case. Subsequently, the test passes.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. 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 Feb 14, 2022
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 14, 2022
@ewbankkit ewbankkit added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 14, 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 TESTS=TestAccBackupFramework_ 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='TestAccBackupFramework_'  -timeout 180m
=== RUN   TestAccBackupFramework_basic
=== PAUSE TestAccBackupFramework_basic
=== RUN   TestAccBackupFramework_updateTags
=== PAUSE TestAccBackupFramework_updateTags
=== RUN   TestAccBackupFramework_updateControlScope
=== PAUSE TestAccBackupFramework_updateControlScope
=== RUN   TestAccBackupFramework_updateControlInputParameters
=== PAUSE TestAccBackupFramework_updateControlInputParameters
=== RUN   TestAccBackupFramework_updateControls
=== PAUSE TestAccBackupFramework_updateControls
=== RUN   TestAccBackupFramework_disappears
=== PAUSE TestAccBackupFramework_disappears
=== CONT  TestAccBackupFramework_basic
--- PASS: TestAccBackupFramework_basic (65.26s)
=== CONT  TestAccBackupFramework_updateControlInputParameters
--- PASS: TestAccBackupFramework_updateControlInputParameters (65.65s)
=== CONT  TestAccBackupFramework_disappears
--- PASS: TestAccBackupFramework_disappears (28.99s)
=== CONT  TestAccBackupFramework_updateControls
--- PASS: TestAccBackupFramework_updateControls (67.19s)
=== CONT  TestAccBackupFramework_updateControlScope
--- PASS: TestAccBackupFramework_updateControlScope (181.72s)
=== CONT  TestAccBackupFramework_updateTags
--- PASS: TestAccBackupFramework_updateTags (79.47s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	492.003s
GovCloud
% make testacc TESTS=TestAccBackupFramework_ 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='TestAccBackupFramework_'  -timeout 180m
=== RUN   TestAccBackupFramework_basic
=== PAUSE TestAccBackupFramework_basic
=== RUN   TestAccBackupFramework_updateTags
=== PAUSE TestAccBackupFramework_updateTags
=== RUN   TestAccBackupFramework_updateControlScope
=== PAUSE TestAccBackupFramework_updateControlScope
=== RUN   TestAccBackupFramework_updateControlInputParameters
=== PAUSE TestAccBackupFramework_updateControlInputParameters
=== RUN   TestAccBackupFramework_updateControls
=== PAUSE TestAccBackupFramework_updateControls
=== RUN   TestAccBackupFramework_disappears
=== PAUSE TestAccBackupFramework_disappears
=== CONT  TestAccBackupFramework_basic
    framework_test.go:468: skipping acceptance testing: AccessDeniedException: 
        	status code: 403, request id: 22167a1c-3083-4c1d-b885-2fe621428f1b
--- SKIP: TestAccBackupFramework_basic (2.93s)
=== CONT  TestAccBackupFramework_updateControlInputParameters
    framework_test.go:468: skipping acceptance testing: AccessDeniedException: 
        	status code: 403, request id: b4fdec06-a1cf-42b1-910a-417f96a6e414
--- SKIP: TestAccBackupFramework_updateControlInputParameters (0.38s)
=== CONT  TestAccBackupFramework_disappears
    framework_test.go:468: skipping acceptance testing: AccessDeniedException: 
        	status code: 403, request id: 9c357013-7450-43ed-8b2c-26bda9861a56
--- SKIP: TestAccBackupFramework_disappears (0.37s)
=== CONT  TestAccBackupFramework_updateControls
    framework_test.go:468: skipping acceptance testing: AccessDeniedException: 
        	status code: 403, request id: 56a17886-fd59-433d-a810-7cb04a3fb8ea
--- SKIP: TestAccBackupFramework_updateControls (0.39s)
=== CONT  TestAccBackupFramework_updateControlScope
    framework_test.go:468: skipping acceptance testing: AccessDeniedException: 
        	status code: 403, request id: 5bbd9ec0-8166-4f3a-b280-c339001f5b9a
--- SKIP: TestAccBackupFramework_updateControlScope (0.41s)
=== CONT  TestAccBackupFramework_updateTags
    framework_test.go:468: skipping acceptance testing: AccessDeniedException: 
        	status code: 403, request id: 6e3893a3-1bdf-4066-bb84-791d06fdba84
--- SKIP: TestAccBackupFramework_updateTags (0.39s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/backup	8.357s

@ewbankkit ewbankkit merged commit c177af5 into hashicorp:main Feb 14, 2022
@github-actions github-actions bot added this to the v4.1.0 milestone Feb 14, 2022
@GlennChia GlennChia deleted the f-aws_backup_framework branch February 14, 2022 23:12
@github-actions
Copy link

This functionality has been released in v4.1.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 May 18, 2022
@justinretzolk justinretzolk added the partner Contribution from a partner. label May 16, 2024
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. new-resource Introduces a new resource. partner Contribution from a partner. provider Pertains to the provider itself, rather than any interaction with AWS. 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.

New resource: aws_backup_framework
3 participants