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

fix: empty tags drift on fwprovider resources #38636

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

kkopachev
Copy link
Contributor

Description

Fixing constant drift in resources which use fwprovider when supplied configuration has empty tags.

resource "aws_networkmonitor_monitor" "example" {
  aggregation_period = 30
  monitor_name       = "example"

  tags = {}
}

There are multiple resources affected by this, however I only tested aws_networkmonitor_monitor and aws_eks_pod_identity_association

Relations

Closes #38173

References

Same issue reported previously

Output from Acceptance Testing

Before

% make testacc TESTS=TestAccNetworkMonitorMonitor_tags PKG=networkmonitor
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.4 test ./internal/service/networkmonitor/... -v -count 1 -parallel 20 -run='TestAccNetworkMonitorMonitor_tags'  -timeout 360m
=== RUN   TestAccNetworkMonitorMonitor_tags
=== PAUSE TestAccNetworkMonitorMonitor_tags
=== CONT  TestAccNetworkMonitorMonitor_tags
    monitor_test.go:62: Step 1/5 error: After applying this test step, the refresh plan was not empty.
        stdout
        
        
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # aws_networkmonitor_monitor.test will be updated in-place
          ~ resource "aws_networkmonitor_monitor" "test" {
                id                 = "tf-acc-test-8125989460679217634"
              + tags               = {}
                # (4 unchanged attributes hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccNetworkMonitorMonitor_tags (21.91s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/networkmonitor	22.183s
FAIL
make: *** [GNUmakefile:626: testacc] Error 1

After

% make testacc TESTS=TestAccNetworkMonitorMonitor_tags PKG=networkmonitor
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/networkmonitor/... -v -count 1 -parallel 20 -run='TestAccNetworkMonitorMonitor_tags'  -timeout 360m
=== RUN   TestAccNetworkMonitorMonitor_tags
=== PAUSE TestAccNetworkMonitorMonitor_tags
=== CONT  TestAccNetworkMonitorMonitor_tags
--- PASS: TestAccNetworkMonitorMonitor_tags (68.52s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/networkmonitor	68.781s

Copy link

github-actions bot commented Aug 1, 2024

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 tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. provider Pertains to the provider itself, rather than any interaction with AWS. service/networkmonitor Issues and PRs that pertain to the networkmonitor service. needs-triage Waiting for first response or review from a maintainer. labels Aug 1, 2024
@kkopachev kkopachev force-pushed the b-empty-tags-drift-on-fwprovider branch from c9a04f8 to f291d17 Compare August 1, 2024 05:02
@kkopachev kkopachev marked this pull request as ready for review August 1, 2024 14:42
@kkopachev kkopachev requested a review from a team as a code owner August 1, 2024 14:42
@ewbankkit ewbankkit added the tags Pertains to resource tagging. label Aug 1, 2024
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 12, 2024
@kkopachev
Copy link
Contributor Author

Pulled in latest changes from main, including #38869
This issue is still relevant

@gdavison gdavison self-assigned this Sep 11, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 11, 2024
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @kkopachev 🚀

@gdavison gdavison merged commit 9a42dce into hashicorp:main Sep 11, 2024
39 checks passed
@github-actions github-actions bot added this to the v5.67.0 milestone Sep 11, 2024
@kkopachev kkopachev deleted the b-empty-tags-drift-on-fwprovider branch September 11, 2024 23:04
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 13, 2024
Copy link

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

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 Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. provider Pertains to the provider itself, rather than any interaction with AWS. service/networkmonitor Issues and PRs that pertain to the networkmonitor service. tags Pertains to resource tagging. 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.

[Bug]: Constant drift with empty tags for framework resources
4 participants