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

Tech debt: Reduce tags boilerplate code - Plugin SDK resources w* and x* (Phase 3c) #30417

Merged
merged 5 commits into from
Apr 3, 2023

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Apr 3, 2023

Description

Extends the work done in Phase 2 to the remaining resources implemented using Terraform Plugin SDK v2.

Relations

Relates #30280.
Relates #29747.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccXRayGroup_basic\|TestAccXRayGroup_tags\|TestAccXRaySamplingRule_basic\|TestAccXRaySamplingRule_tags' PKG=xray ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/xray/... -v -count 1 -parallel 3  -run=TestAccXRayGroup_basic\|TestAccXRayGroup_tags\|TestAccXRaySamplingRule_basic\|TestAccXRaySamplingRule_tags -timeout 180m
=== RUN   TestAccXRayGroup_basic
=== PAUSE TestAccXRayGroup_basic
=== RUN   TestAccXRayGroup_tags
=== PAUSE TestAccXRayGroup_tags
=== RUN   TestAccXRaySamplingRule_basic
=== PAUSE TestAccXRaySamplingRule_basic
=== RUN   TestAccXRaySamplingRule_tags
=== PAUSE TestAccXRaySamplingRule_tags
=== CONT  TestAccXRayGroup_basic
=== CONT  TestAccXRaySamplingRule_basic
=== CONT  TestAccXRaySamplingRule_tags
--- PASS: TestAccXRaySamplingRule_basic (18.74s)
=== CONT  TestAccXRayGroup_tags
--- PASS: TestAccXRayGroup_basic (30.49s)
--- PASS: TestAccXRaySamplingRule_tags (41.35s)
--- PASS: TestAccXRayGroup_tags (38.95s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/xray	63.223s
% make testacc TESTARGS='-run=_basic$$\|_tags$$' PKG=waf... ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/waf.../... -v -count 1 -parallel 3  -run=_basic$\|_tags$ -timeout 180m
=== RUN   TestAccWAFByteMatchSet_basic
=== PAUSE TestAccWAFByteMatchSet_basic
=== RUN   TestAccWAFGeoMatchSet_basic
=== PAUSE TestAccWAFGeoMatchSet_basic
=== RUN   TestAccWAFIPSetDataSource_basic
=== PAUSE TestAccWAFIPSetDataSource_basic
=== RUN   TestAccWAFIPSet_basic
=== PAUSE TestAccWAFIPSet_basic
=== RUN   TestAccWAFRuleDataSource_basic
=== PAUSE TestAccWAFRuleDataSource_basic
=== RUN   TestAccWAFRuleGroup_basic
=== PAUSE TestAccWAFRuleGroup_basic
=== RUN   TestAccWAFRuleGroup_tags
=== PAUSE TestAccWAFRuleGroup_tags
=== RUN   TestAccWAFRule_basic
=== PAUSE TestAccWAFRule_basic
=== RUN   TestAccWAFRule_tags
=== PAUSE TestAccWAFRule_tags
=== RUN   TestAccWAFSizeConstraintSet_basic
=== PAUSE TestAccWAFSizeConstraintSet_basic
=== RUN   TestAccWAFSQLInjectionMatchSet_basic
=== PAUSE TestAccWAFSQLInjectionMatchSet_basic
=== RUN   TestAccWAFSubscribedRuleGroupDataSource_basic
    subscribed_rule_group_test.go:17: Environment variable WAF_SUBSCRIBED_RULE_GROUP_NAME is not set
--- SKIP: TestAccWAFSubscribedRuleGroupDataSource_basic (0.00s)
=== RUN   TestAccWAFWebACLDataSource_basic
=== PAUSE TestAccWAFWebACLDataSource_basic
=== RUN   TestAccWAFWebACL_basic
=== PAUSE TestAccWAFWebACL_basic
=== RUN   TestAccWAFWebACL_tags
=== PAUSE TestAccWAFWebACL_tags
=== RUN   TestAccWAFXSSMatchSet_basic
=== PAUSE TestAccWAFXSSMatchSet_basic
=== CONT  TestAccWAFByteMatchSet_basic
=== CONT  TestAccWAFRule_tags
=== CONT  TestAccWAFXSSMatchSet_basic
--- PASS: TestAccWAFByteMatchSet_basic (32.43s)
=== CONT  TestAccWAFWebACL_tags
--- PASS: TestAccWAFXSSMatchSet_basic (33.67s)
=== CONT  TestAccWAFWebACL_basic
--- PASS: TestAccWAFWebACL_basic (28.82s)
=== CONT  TestAccWAFWebACLDataSource_basic
--- PASS: TestAccWAFRule_tags (74.78s)
=== CONT  TestAccWAFSQLInjectionMatchSet_basic
--- PASS: TestAccWAFWebACLDataSource_basic (27.79s)
=== CONT  TestAccWAFSizeConstraintSet_basic
--- PASS: TestAccWAFWebACL_tags (68.05s)
=== CONT  TestAccWAFRuleDataSource_basic
--- PASS: TestAccWAFSQLInjectionMatchSet_basic (28.77s)
=== CONT  TestAccWAFRule_basic
--- PASS: TestAccWAFSizeConstraintSet_basic (28.91s)
=== CONT  TestAccWAFRuleGroup_tags
--- PASS: TestAccWAFRuleDataSource_basic (24.11s)
=== CONT  TestAccWAFRuleGroup_basic
--- PASS: TestAccWAFRule_basic (31.75s)
=== CONT  TestAccWAFIPSetDataSource_basic
--- PASS: TestAccWAFRuleGroup_basic (31.59s)
=== CONT  TestAccWAFIPSet_basic
--- PASS: TestAccWAFIPSetDataSource_basic (24.12s)
=== CONT  TestAccWAFGeoMatchSet_basic
--- PASS: TestAccWAFRuleGroup_tags (61.34s)
--- PASS: TestAccWAFIPSet_basic (29.03s)
--- PASS: TestAccWAFGeoMatchSet_basic (26.94s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/waf	194.419s
=== RUN   TestAccWAFRegionalByteMatchSet_basic
=== PAUSE TestAccWAFRegionalByteMatchSet_basic
=== RUN   TestAccWAFRegionalGeoMatchSet_basic
=== PAUSE TestAccWAFRegionalGeoMatchSet_basic
=== RUN   TestAccWAFRegionalIPSetDataSource_basic
=== PAUSE TestAccWAFRegionalIPSetDataSource_basic
=== RUN   TestAccWAFRegionalIPSet_basic
=== PAUSE TestAccWAFRegionalIPSet_basic
=== RUN   TestAccWAFRegionalRateBasedRuleDataSource_basic
=== PAUSE TestAccWAFRegionalRateBasedRuleDataSource_basic
=== RUN   TestAccWAFRegionalRateBasedRule_basic
=== PAUSE TestAccWAFRegionalRateBasedRule_basic
=== RUN   TestAccWAFRegionalRateBasedRule_tags
=== PAUSE TestAccWAFRegionalRateBasedRule_tags
=== RUN   TestAccWAFRegionalRuleDataSource_basic
=== PAUSE TestAccWAFRegionalRuleDataSource_basic
=== RUN   TestAccWAFRegionalRuleGroup_basic
=== PAUSE TestAccWAFRegionalRuleGroup_basic
=== RUN   TestAccWAFRegionalRuleGroup_tags
=== PAUSE TestAccWAFRegionalRuleGroup_tags
=== RUN   TestAccWAFRegionalRule_basic
=== PAUSE TestAccWAFRegionalRule_basic
=== RUN   TestAccWAFRegionalRule_tags
=== PAUSE TestAccWAFRegionalRule_tags
=== RUN   TestAccWAFRegionalSizeConstraintSet_basic
=== PAUSE TestAccWAFRegionalSizeConstraintSet_basic
=== RUN   TestAccWAFRegionalSQLInjectionMatchSet_basic
=== PAUSE TestAccWAFRegionalSQLInjectionMatchSet_basic
=== RUN   TestAccWAFRegionalSubscribedRuleGroupDataSource_basic
    subscribed_rule_group_test.go:17: Environment variable WAF_SUBSCRIBED_RULE_GROUP_NAME is not set
--- SKIP: TestAccWAFRegionalSubscribedRuleGroupDataSource_basic (0.00s)
=== RUN   TestAccWAFRegionalWebACLAssociation_basic
=== PAUSE TestAccWAFRegionalWebACLAssociation_basic
=== RUN   TestAccWAFRegionalWebACLDataSource_basic
=== PAUSE TestAccWAFRegionalWebACLDataSource_basic
=== RUN   TestAccWAFRegionalWebACL_basic
=== PAUSE TestAccWAFRegionalWebACL_basic
=== RUN   TestAccWAFRegionalWebACL_tags
=== PAUSE TestAccWAFRegionalWebACL_tags
=== RUN   TestAccWAFRegionalXSSMatchSet_basic
=== PAUSE TestAccWAFRegionalXSSMatchSet_basic
=== CONT  TestAccWAFRegionalByteMatchSet_basic
=== CONT  TestAccWAFRegionalWebACLDataSource_basic
=== CONT  TestAccWAFRegionalXSSMatchSet_basic
--- PASS: TestAccWAFRegionalWebACLDataSource_basic (30.41s)
=== CONT  TestAccWAFRegionalWebACL_tags
--- PASS: TestAccWAFRegionalXSSMatchSet_basic (32.76s)
=== CONT  TestAccWAFRegionalWebACL_basic
--- PASS: TestAccWAFRegionalByteMatchSet_basic (34.37s)
=== CONT  TestAccWAFRegionalSQLInjectionMatchSet_basic
--- PASS: TestAccWAFRegionalSQLInjectionMatchSet_basic (33.50s)
=== CONT  TestAccWAFRegionalWebACLAssociation_basic
--- PASS: TestAccWAFRegionalWebACL_basic (37.98s)
=== CONT  TestAccWAFRegionalIPSet_basic
--- PASS: TestAccWAFRegionalIPSet_basic (31.39s)
=== CONT  TestAccWAFRegionalRateBasedRuleDataSource_basic
--- PASS: TestAccWAFRegionalWebACL_tags (76.26s)
=== CONT  TestAccWAFRegionalIPSetDataSource_basic
--- PASS: TestAccWAFRegionalRateBasedRuleDataSource_basic (27.31s)
=== CONT  TestAccWAFRegionalGeoMatchSet_basic
--- PASS: TestAccWAFRegionalIPSetDataSource_basic (26.35s)
=== CONT  TestAccWAFRegionalSizeConstraintSet_basic
--- PASS: TestAccWAFRegionalGeoMatchSet_basic (29.04s)
=== CONT  TestAccWAFRegionalRuleGroup_basic
--- PASS: TestAccWAFRegionalSizeConstraintSet_basic (28.98s)
=== CONT  TestAccWAFRegionalRuleGroup_tags
--- PASS: TestAccWAFRegionalRuleGroup_basic (30.39s)
=== CONT  TestAccWAFRegionalRuleDataSource_basic
--- PASS: TestAccWAFRegionalRuleDataSource_basic (21.44s)
=== CONT  TestAccWAFRegionalRule_tags
--- PASS: TestAccWAFRegionalRuleGroup_tags (59.66s)
=== CONT  TestAccWAFRegionalRateBasedRule_basic
--- PASS: TestAccWAFRegionalWebACLAssociation_basic (168.66s)
=== CONT  TestAccWAFRegionalRateBasedRule_tags
--- PASS: TestAccWAFRegionalRateBasedRule_basic (28.69s)
=== CONT  TestAccWAFRegionalRule_basic
--- PASS: TestAccWAFRegionalRule_tags (54.86s)
--- PASS: TestAccWAFRegionalRule_basic (24.70s)
--- PASS: TestAccWAFRegionalRateBasedRule_tags (55.14s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/wafregional	303.865s
=== RUN   TestAccWAFV2IPSetDataSource_basic
=== PAUSE TestAccWAFV2IPSetDataSource_basic
=== RUN   TestAccWAFV2IPSet_basic
=== PAUSE TestAccWAFV2IPSet_basic
=== RUN   TestAccWAFV2IPSet_tags
=== PAUSE TestAccWAFV2IPSet_tags
=== RUN   TestAccWAFV2RegexPatternSetDataSource_basic
=== PAUSE TestAccWAFV2RegexPatternSetDataSource_basic
=== RUN   TestAccWAFV2RegexPatternSet_basic
=== PAUSE TestAccWAFV2RegexPatternSet_basic
=== RUN   TestAccWAFV2RegexPatternSet_tags
=== PAUSE TestAccWAFV2RegexPatternSet_tags
=== RUN   TestAccWAFV2RuleGroupDataSource_basic
=== PAUSE TestAccWAFV2RuleGroupDataSource_basic
=== RUN   TestAccWAFV2RuleGroup_basic
=== PAUSE TestAccWAFV2RuleGroup_basic
=== RUN   TestAccWAFV2RuleGroup_tags
=== PAUSE TestAccWAFV2RuleGroup_tags
=== RUN   TestAccWAFV2WebACLAssociation_basic
=== PAUSE TestAccWAFV2WebACLAssociation_basic
=== RUN   TestAccWAFV2WebACLDataSource_basic
=== PAUSE TestAccWAFV2WebACLDataSource_basic
=== RUN   TestAccWAFV2WebACLLoggingConfiguration_basic
=== PAUSE TestAccWAFV2WebACLLoggingConfiguration_basic
=== RUN   TestAccWAFV2WebACL_basic
=== PAUSE TestAccWAFV2WebACL_basic
=== RUN   TestAccWAFV2WebACL_ManagedRuleGroup_basic
=== PAUSE TestAccWAFV2WebACL_ManagedRuleGroup_basic
=== RUN   TestAccWAFV2WebACL_RateBased_basic
=== PAUSE TestAccWAFV2WebACL_RateBased_basic
=== RUN   TestAccWAFV2WebACL_ByteMatchStatement_basic
=== PAUSE TestAccWAFV2WebACL_ByteMatchStatement_basic
=== RUN   TestAccWAFV2WebACL_GeoMatch_basic
=== PAUSE TestAccWAFV2WebACL_GeoMatch_basic
=== RUN   TestAccWAFV2WebACL_IPSetReference_basic
=== PAUSE TestAccWAFV2WebACL_IPSetReference_basic
=== RUN   TestAccWAFV2WebACL_RuleGroupReference_basic
=== PAUSE TestAccWAFV2WebACL_RuleGroupReference_basic
=== RUN   TestAccWAFV2WebACL_tags
=== PAUSE TestAccWAFV2WebACL_tags
=== CONT  TestAccWAFV2IPSetDataSource_basic
=== CONT  TestAccWAFV2WebACLDataSource_basic
=== CONT  TestAccWAFV2WebACL_ByteMatchStatement_basic
--- PASS: TestAccWAFV2IPSetDataSource_basic (28.70s)
=== CONT  TestAccWAFV2WebACL_RuleGroupReference_basic
--- PASS: TestAccWAFV2WebACLDataSource_basic (52.89s)
=== CONT  TestAccWAFV2WebACL_tags
--- PASS: TestAccWAFV2WebACL_ByteMatchStatement_basic (105.84s)
=== CONT  TestAccWAFV2WebACL_IPSetReference_basic
--- PASS: TestAccWAFV2WebACL_IPSetReference_basic (53.13s)
=== CONT  TestAccWAFV2WebACL_ManagedRuleGroup_basic
--- PASS: TestAccWAFV2WebACL_RuleGroupReference_basic (157.84s)
=== CONT  TestAccWAFV2WebACL_RateBased_basic
--- PASS: TestAccWAFV2WebACL_tags (133.94s)
=== CONT  TestAccWAFV2RegexPatternSet_tags
--- PASS: TestAccWAFV2RegexPatternSet_tags (49.83s)
=== CONT  TestAccWAFV2WebACLAssociation_basic
--- PASS: TestAccWAFV2WebACL_RateBased_basic (65.55s)
=== CONT  TestAccWAFV2RuleGroup_tags
--- PASS: TestAccWAFV2WebACL_ManagedRuleGroup_basic (127.32s)
=== CONT  TestAccWAFV2RuleGroup_basic
--- PASS: TestAccWAFV2RuleGroup_basic (25.74s)
=== CONT  TestAccWAFV2RuleGroupDataSource_basic
--- PASS: TestAccWAFV2RuleGroup_tags (67.54s)
=== CONT  TestAccWAFV2RegexPatternSetDataSource_basic
--- PASS: TestAccWAFV2RegexPatternSetDataSource_basic (18.05s)
=== CONT  TestAccWAFV2RegexPatternSet_basic
--- PASS: TestAccWAFV2RuleGroupDataSource_basic (26.94s)
=== CONT  TestAccWAFV2WebACL_basic
--- PASS: TestAccWAFV2RegexPatternSet_basic (28.91s)
=== CONT  TestAccWAFV2WebACL_GeoMatch_basic
--- PASS: TestAccWAFV2WebACL_basic (27.69s)
=== CONT  TestAccWAFV2WebACLLoggingConfiguration_basic
--- PASS: TestAccWAFV2WebACL_GeoMatch_basic (46.57s)
=== CONT  TestAccWAFV2IPSet_basic
--- PASS: TestAccWAFV2IPSet_basic (26.87s)
=== CONT  TestAccWAFV2IPSet_tags
--- PASS: TestAccWAFV2IPSet_tags (38.35s)
=== CONT  TestAccWAFV2WebACLLoggingConfiguration_basic
    web_acl_logging_configuration_test.go:26: Step 1/2 error: Error running apply: exit status 1
        
        Error: error creating S3 bucket ACL for tf-acc-test-8893173864125490027: AccessControlListNotSupported: The bucket does not allow ACLs
        	status code: 400, request id: 72M4095S2NMKJV6C, host id: 2JfiXEZ44G8JBPkFRyBva2wRIOBAncA0VmNM0naskmGpXc/2RukOA+CJKoefnr+uP39Z0//90Wc=
        
          with aws_s3_bucket_acl.test,
          on terraform_plugin_test.tf line 36, in resource "aws_s3_bucket_acl" "test":
          36: resource "aws_s3_bucket_acl" "test" {
        
=== CONT  TestAccWAFV2WebACLAssociation_basic
    web_acl_association_test.go:25: Step 1/2 error: Error running apply: exit status 1
        
        Error: creating WAFv2 WebACL Association (arn:aws:wafv2:us-west-2:187416307283:regional/webacl/tf-acc-test-3204428642727575776/9ab7d102-deab-4f3d-9442-7519d7935feb,arn:aws:apigateway:us-west-2::/restapis/gktm0x2nnk/stages/tf-acc-test-3204428642727575776): WAFUnavailableEntityException: AWS WAF couldn’t retrieve the resource that you requested. Retry your request.
        
          with aws_wafv2_web_acl_association.test,
          on terraform_plugin_test.tf line 52, in resource "aws_wafv2_web_acl_association" "test":
          52: resource "aws_wafv2_web_acl_association" "test" {
        
--- FAIL: TestAccWAFV2WebACLAssociation_basic (316.94s)
--- FAIL: TestAccWAFV2WebACLLoggingConfiguration_basic (197.40s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/wafv2	569.061s
FAIL
make: *** [testacc] Error 1

Failures are unrelated to this change.

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

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 generators Relates to code generators. service/waf Issues and PRs that pertain to the waf service. service/wafregional Issues and PRs that pertain to the wafregional service. service/wafv2 Issues and PRs that pertain to the wafv2 service. service/workspaces Issues and PRs that pertain to the workspaces service. service/xray Issues and PRs that pertain to the xray service. size/XL Managed by automation to categorize the size of a PR. and removed service/waf Issues and PRs that pertain to the waf service. service/workspaces Issues and PRs that pertain to the workspaces service. service/xray Issues and PRs that pertain to the xray service. service/wafv2 Issues and PRs that pertain to the wafv2 service. service/wafregional Issues and PRs that pertain to the wafregional service. generators Relates to code generators. labels Apr 3, 2023
@ewbankkit ewbankkit added tags Pertains to resource tagging. service/waf Issues and PRs that pertain to the waf service. service/workspaces Issues and PRs that pertain to the workspaces service. service/xray Issues and PRs that pertain to the xray service. service/wafv2 Issues and PRs that pertain to the wafv2 service. service/wafregional Issues and PRs that pertain to the wafregional service. labels Apr 3, 2023
@ewbankkit ewbankkit merged commit de6d166 into main Apr 3, 2023
@ewbankkit ewbankkit deleted the td-transparent-tagging-phase3c-wx branch April 3, 2023 16:47
@github-actions github-actions bot added this to the v4.62.0 milestone Apr 3, 2023
@ewbankkit ewbankkit changed the title Tech debt: Reduce tags boilerplate code - Plugin Framework resources w* and x* (Phase 3c) Tech debt: Reduce tags boilerplate code - Plugin SDK resources w* and x* (Phase 3c) Apr 4, 2023
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

This functionality has been released in v4.62.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

github-actions bot commented May 8, 2023

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 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/waf Issues and PRs that pertain to the waf service. service/wafregional Issues and PRs that pertain to the wafregional service. service/wafv2 Issues and PRs that pertain to the wafv2 service. service/workspaces Issues and PRs that pertain to the workspaces service. service/xray Issues and PRs that pertain to the xray service. size/XL Managed by automation to categorize the size of a PR. tags Pertains to resource tagging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant