Skip to content

fix bug that cause altered key value item to be deleted #43208

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

Conversation

frek818
Copy link
Contributor

@frek818 frek818 commented Jun 27, 2025

Fixes #43190

@frek818 frek818 requested a review from a team as a code owner June 27, 2025 03:08
Copy link

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

Copy link

github-actions bot commented Jun 27, 2025

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/cloudfrontkeyvaluestore Issues and PRs that pertain to the cloudfrontkeyvaluestore service. size/S Managed by automation to categorize the size of a PR. size/M Managed by automation to categorize the size of a PR. labels Jun 27, 2025
@frek818 frek818 changed the title fix bug that cause alter key value item to be deleted fix bug that cause altered key value item to be deleted Jun 27, 2025
@frek818 frek818 force-pushed the b-aws_cloudfrontkeyvaluestore_keys_exclusive-pair-update branch from c9883b8 to 543c01f Compare June 27, 2025 04:20
@frek818 frek818 force-pushed the b-aws_cloudfrontkeyvaluestore_keys_exclusive-pair-update branch from 543c01f to 54ae632 Compare June 27, 2025 04:21
@frek818 frek818 force-pushed the b-aws_cloudfrontkeyvaluestore_keys_exclusive-pair-update branch from 54ae632 to 895e76d Compare June 27, 2025 04:23
@brittandeyoung brittandeyoung added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 27, 2025
@brittandeyoung
Copy link
Collaborator

brittandeyoung commented Jun 27, 2025

@frek818 Thank you for raising the PR! I have added a few code suggestions to ensure the test case is properly testing the update flow.

Once updated. Please include the output of locally running the acceptance tests in the PR description.

frek818 and others added 3 commits June 27, 2025 11:50
Co-authored-by: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com>
Co-authored-by: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com>
Co-authored-by: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com>
@frek818
Copy link
Contributor Author

frek818 commented Jun 27, 2025

Thank you @brittandeyoung. Here are the acceptance test results.

$ make testacc TESTS=TestAccCloudFrontKeyValueStoreKeysExclusive_itemRemainsAfterValueChange PKG=cloudfrontkeyvaluestore

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.4 test ./internal/service/cloudfrontkeyvaluestore/... -v -count 1 -parallel 20 -run='TestAccCloudFrontKeyValueStoreKeysExclusive_itemRemainsAfterValueChange'  -timeout 360m -
vet=off
2025/06/27 09:12:07 Creating Terraform AWS Provider (SDKv2-style)...
2025/06/27 09:12:07 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccCloudFrontKeyValueStoreKeysExclusive_itemRemainsAfterValueChange
=== PAUSE TestAccCloudFrontKeyValueStoreKeysExclusive_itemRemainsAfterValueChange
=== CONT  TestAccCloudFrontKeyValueStoreKeysExclusive_itemRemainsAfterValueChange
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_itemRemainsAfterValueChange (40.12s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/cloudfrontkeyvaluestore    40.256s

@brittandeyoung
Copy link
Collaborator

LGTM

make testacc TESTARGS='-run=TestAccCloudFrontKeyValueStoreKeysExclusive' PKG=cloudfrontkeyvaluestore 
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.4 test ./internal/service/cloudfrontkeyvaluestore/... -v -count 1 -parallel 20  -run=TestAccCloudFrontKeyValueStoreKeysExclusive -timeout 360m -vet=off
2025/06/27 12:57:41 Creating Terraform AWS Provider (SDKv2-style)...
2025/06/27 12:57:41 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccCloudFrontKeyValueStoreKeysExclusive_basic
=== PAUSE TestAccCloudFrontKeyValueStoreKeysExclusive_basic
=== RUN   TestAccCloudFrontKeyValueStoreKeysExclusive_disappears_KeyValueStore
=== PAUSE TestAccCloudFrontKeyValueStoreKeysExclusive_disappears_KeyValueStore
=== RUN   TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandAddition
=== PAUSE TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandAddition
=== RUN   TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandRemoval
=== PAUSE TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandRemoval
=== RUN   TestAccCloudFrontKeyValueStoreKeysExclusive_value
=== PAUSE TestAccCloudFrontKeyValueStoreKeysExclusive_value
=== RUN   TestAccCloudFrontKeyValueStoreKeysExclusive_empty
=== PAUSE TestAccCloudFrontKeyValueStoreKeysExclusive_empty
=== RUN   TestAccCloudFrontKeyValueStoreKeysExclusive_maxBatchSize
=== PAUSE TestAccCloudFrontKeyValueStoreKeysExclusive_maxBatchSize
=== RUN   TestAccCloudFrontKeyValueStoreKeysExclusive_itemRemainsAfterValueChange
=== PAUSE TestAccCloudFrontKeyValueStoreKeysExclusive_itemRemainsAfterValueChange
=== CONT  TestAccCloudFrontKeyValueStoreKeysExclusive_basic
=== CONT  TestAccCloudFrontKeyValueStoreKeysExclusive_value
=== CONT  TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandAddition
=== CONT  TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandRemoval
=== CONT  TestAccCloudFrontKeyValueStoreKeysExclusive_maxBatchSize
=== CONT  TestAccCloudFrontKeyValueStoreKeysExclusive_itemRemainsAfterValueChange
=== CONT  TestAccCloudFrontKeyValueStoreKeysExclusive_disappears_KeyValueStore
=== CONT  TestAccCloudFrontKeyValueStoreKeysExclusive_empty
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_disappears_KeyValueStore (32.54s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_value (41.92s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandRemoval (43.64s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandAddition (44.48s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_basic (45.28s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_maxBatchSize (45.35s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_itemRemainsAfterValueChange (48.62s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_empty (60.02s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/cloudfrontkeyvaluestore    65.958s

@jar-b jar-b self-assigned this Jul 7, 2025
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jul 7, 2025
jar-b added 3 commits July 7, 2025 13:23
```console
% make testacc PKG=cloudfrontkeyvaluestore TESTS=TestAccCloudFrontKeyValueStoreKeysExclusive_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.4 test ./internal/service/cloudfrontkeyvaluestore/... -v -count 1 -parallel 20 -run='TestAccCloudFrontKeyValueStoreKeysExclusive_'  -timeout 360m -vet=off
2025/07/07 13:20:31 Creating Terraform AWS Provider (SDKv2-style)...
2025/07/07 13:20:31 Initializing Terraform AWS Provider (SDKv2-style)...

--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_disappears_KeyValueStore (29.38s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_value (38.49s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandRemoval (40.03s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_basic (40.04s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandAddition (40.41s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_valueUpdate (47.01s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_maxBatchSize (49.63s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_empty (49.80s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/cloudfrontkeyvaluestore    55.867s
```
```console
% make testacc PKG=cloudfrontkeyvaluestore TESTS=TestAccCloudFrontKeyValueStoreKeysExclusive_valueUpdate
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.4 test ./internal/service/cloudfrontkeyvaluestore/... -v -count 1 -parallel 20 -run='TestAccCloudFrontKeyValueStoreKeysExclusive_valueUpdate'  -timeout 360m -vet=off
2025/07/07 13:29:14 Creating Terraform AWS Provider (SDKv2-style)...
2025/07/07 13:29:14 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccCloudFrontKeyValueStoreKeysExclusive_valueUpdate
=== PAUSE TestAccCloudFrontKeyValueStoreKeysExclusive_valueUpdate
=== CONT  TestAccCloudFrontKeyValueStoreKeysExclusive_valueUpdate
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_valueUpdate (44.56s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/cloudfrontkeyvaluestore    50.354s
```
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

% make testacc PKG=cloudfrontkeyvaluestore TESTS=TestAccCloudFrontKeyValueStoreKeysExclusive_
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.4 test ./internal/service/cloudfrontkeyvaluestore/... -v -count 1 -parallel 20 -run='TestAccCloudFrontKeyValueStoreKeysExclusive_'  -timeout 360m -vet=off
2025/07/07 13:20:31 Creating Terraform AWS Provider (SDKv2-style)...
2025/07/07 13:20:31 Initializing Terraform AWS Provider (SDKv2-style)...

--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_disappears_KeyValueStore (29.38s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_value (38.49s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandRemoval (40.03s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_basic (40.04s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_outOfBandAddition (40.41s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_valueUpdate (47.01s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_maxBatchSize (49.63s)
--- PASS: TestAccCloudFrontKeyValueStoreKeysExclusive_empty (49.80s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/cloudfrontkeyvaluestore    55.867s

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 🚀.

@jar-b
Copy link
Member

jar-b commented Jul 7, 2025

Thanks for the fix, @frek818! 👍

@jar-b jar-b merged commit 6311e34 into hashicorp:main Jul 7, 2025
39 checks passed
Copy link

github-actions bot commented Jul 7, 2025

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v6.3.0 milestone Jul 7, 2025
@frek818 frek818 deleted the b-aws_cloudfrontkeyvaluestore_keys_exclusive-pair-update branch July 9, 2025 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/cloudfrontkeyvaluestore Issues and PRs that pertain to the cloudfrontkeyvaluestore service. size/M Managed by automation to categorize the size of a PR. size/S 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.

aws_cloudfrontkeyvaluestore_keys_exclusive: modifying the value of resource_key_value_pair causes it to be deleted
4 participants