-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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_resourcegroups_group: Make resource_query and configuration not conflict #30242
r/aws_resourcegroups_group: Make resource_query and configuration not conflict #30242
Conversation
Community NoteVoting for Prioritization
For Submitters
|
codablock Missing changelog, can you go over contribution guide? |
@DrFaust92 Added a changelog file/entry :) |
Any chance to get a review here? |
…failed resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccResourceGroupsGroup_' PKG=resourcegroups ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/resourcegroups/... -v -count 1 -parallel 2 -run=TestAccResourceGroupsGroup_ -timeout 180m
=== RUN TestAccResourceGroupsGroup_basic
=== PAUSE TestAccResourceGroupsGroup_basic
=== RUN TestAccResourceGroupsGroup_tags
=== PAUSE TestAccResourceGroupsGroup_tags
=== RUN TestAccResourceGroupsGroup_Configuration
=== PAUSE TestAccResourceGroupsGroup_Configuration
=== RUN TestAccResourceGroupsGroup_configurationParametersOptional
=== PAUSE TestAccResourceGroupsGroup_configurationParametersOptional
=== RUN TestAccResourceGroupsGroup_resourceQueryAndConfiguration
=== PAUSE TestAccResourceGroupsGroup_resourceQueryAndConfiguration
=== CONT TestAccResourceGroupsGroup_basic
=== CONT TestAccResourceGroupsGroup_configurationParametersOptional
--- PASS: TestAccResourceGroupsGroup_configurationParametersOptional (26.95s)
=== CONT TestAccResourceGroupsGroup_resourceQueryAndConfiguration
--- PASS: TestAccResourceGroupsGroup_basic (45.38s)
=== CONT TestAccResourceGroupsGroup_Configuration
--- PASS: TestAccResourceGroupsGroup_resourceQueryAndConfiguration (26.38s)
=== CONT TestAccResourceGroupsGroup_tags
--- PASS: TestAccResourceGroupsGroup_tags (63.51s)
--- PASS: TestAccResourceGroupsGroup_Configuration (73.07s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/resourcegroups 123.921s
% make testacc TESTARGS='-run=TestAccResourceGroupsResource_' PKG=resourcegroups
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/resourcegroups/... -v -count 1 -parallel 20 -run=TestAccResourceGroupsResource_ -timeout 180m
=== RUN TestAccResourceGroupsResource_basic
=== PAUSE TestAccResourceGroupsResource_basic
=== CONT TestAccResourceGroupsResource_basic
--- PASS: TestAccResourceGroupsResource_basic (26.49s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/resourcegroups 32.163s
% make sweep SWEEPARGS=-sweep-run=aws_resourcegroups_group
# make sweep SWEEPARGS=-sweep-run=aws_example_thing
# set SWEEPARGS=-sweep-allow-failures to continue after first failure
WARNING: This will destroy infrastructure. Use only in development accounts.
go test ./internal/sweep -v -tags=sweep -sweep=us-west-2,us-east-1,us-east-2 -sweep-run=aws_resourcegroups_group -timeout 60m
2023/06/29 11:34:22 [DEBUG] Running Sweepers for region (us-west-2):
2023/06/29 11:34:22 [DEBUG] Running Sweeper (aws_resourcegroups_group) in region (us-west-2)
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-4156072979504175319
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-3237009494218269245
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-5323803557228335846
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-8609933339003332924
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-4987950737488137534
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-2867155452020362352
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-4022458543988726902
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: test-group-1970219225215566345
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-8514890133925320257
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-3556904857257078244
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-6879907987582139300
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-6698149265625212243
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-7076610115531334639
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-4370588089895096134
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-7112314810095621238
2023/06/29 11:34:23 [DEBUG] Waiting for state to become: [success]
2023/06/29 11:34:23 [DEBUG] Deleting Resource Groups Group: tf-acc-test-6852960003045699462
2023/06/29 11:34:24 [DEBUG] Completed Sweeper (aws_resourcegroups_group) in region (us-west-2) in 2.185899048s
2023/06/29 11:34:24 Completed Sweepers for region (us-west-2) in 2.186163975s
2023/06/29 11:34:24 Sweeper Tests for region (us-west-2) ran successfully:
- aws_resourcegroups_group
2023/06/29 11:34:24 [DEBUG] Running Sweepers for region (us-east-1):
2023/06/29 11:34:24 [DEBUG] Running Sweeper (aws_resourcegroups_group) in region (us-east-1)
2023/06/29 11:34:25 [DEBUG] Completed Sweeper (aws_resourcegroups_group) in region (us-east-1) in 551.764714ms
2023/06/29 11:34:25 Completed Sweepers for region (us-east-1) in 551.845073ms
2023/06/29 11:34:25 Sweeper Tests for region (us-east-1) ran successfully:
- aws_resourcegroups_group
2023/06/29 11:34:25 [DEBUG] Running Sweepers for region (us-east-2):
2023/06/29 11:34:25 [DEBUG] Running Sweeper (aws_resourcegroups_group) in region (us-east-2)
2023/06/29 11:34:25 [DEBUG] Completed Sweeper (aws_resourcegroups_group) in region (us-east-2) in 617.943764ms
2023/06/29 11:34:25 Completed Sweepers for region (us-east-2) in 618.012871ms
2023/06/29 11:34:25 Sweeper Tests for region (us-east-2) ran successfully:
- aws_resourcegroups_group
ok github.com/hashicorp/terraform-provider-aws/internal/sweep 8.712s
@codablock Thanks for the contribution 🎉 👏. |
This functionality has been released in v5.6.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! |
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. |
Description
This PR changes aws_resourcegroups_group to not conflict the two blocks "resource_query" and "configuration".
AWS has recentry introduced tag based resource groups support for the network firewall.
This requires to create a resource group that has a resource query configured AND a configuration block that changes the type to
AWS::NetworkFirewall::RuleGroup
(docs here). This currently however causes a conflict in terraform as it forbids setting resource_query and configuration at the same time.With this PR, creating such resource groups becomes possible. I tested this with the following resource:
Closes #31843.
References
https://aws.amazon.com/about-aws/whats-new/2023/02/aws-network-firewall-tag-based-resource-groups/
https://docs.aws.amazon.com/ARG/latest/userguide/about-slg.html#about-slg-types-network-firewall-rulegroup
Output from Acceptance Testing