Skip to content

Fix update loop of the mq.User by adding new plan modifiers - #300

Merged
sergenyalcin merged 1 commit into
upbound:upjet-v6.13.0from
sergenyalcin:update-loop-fix-v2
Dec 4, 2025
Merged

Fix update loop of the mq.User by adding new plan modifiers#300
sergenyalcin merged 1 commit into
upbound:upjet-v6.13.0from
sergenyalcin:update-loop-fix-v2

Conversation

@sergenyalcin

Copy link
Copy Markdown
Member

Description

Adds support for tracking pending changes in the aws_mq_user resource and implements a custom plan modifier to prevent unnecessary API calls when console_access and groups changes are already queued in AWS MQ.

New pending Computed Attribute

  • Adds a computed-only pending attribute to the resource schema that tracks pending changes returned by the AWS MQ API
  • Introduces pendingModel struct with two fields:
    • console_access: Tracks pending console access changes
    • pending_change: Tracks the type of pending change (CREATE, UPDATE, DELETE)
    • groups: Tracks pending groups changes

Console Access Plan Modifier

  • Implements consoleAccessPlanModifier to optimize the update workflow
  • Implements groupsPlanModifier to optimize the update workflow
  • Key behavior: When the planned console_access value matches a pending change already queued in AWS, the modifier keeps the current state value instead of triggering an unnecessary update. Same for groups
  • This prevents redundant API calls and potential conflicts when AWS is already processing the requested change

How it works:

  1. During refresh, the provider captures any pending changes from the AWS API
  2. When planning an update to console_access, the plan modifier checks if that exact change is already pending in AWS
  3. If the change is already queued, the modifier preserves the current state value, signaling to Terraform that no update is needed

Tested in the provider-upjet-aws after generation. Two important observations:

  • There is no update loop anymore.
  • The user can track the pending modifications via the status.atProvider.pending field.

Thank you, @erhancagirici, for his guidance on the TF plugin framework implementation details, and @ulucinar for the direction he gave.

…tatus field pending

Signed-off-by: Sergen Yalçın <yalcinsergen97@gmail.com>
@github-actions

github-actions Bot commented Dec 4, 2025

Copy link
Copy Markdown

Welcome @sergenyalcin 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider repository. Thank you very much for taking the time to do so, and welcome to the community! 🎉


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.

@erhancagirici erhancagirici left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@sergenyalcin Thanks for resolving this! Approved

@sergenyalcin
sergenyalcin merged commit 7049bcc into upbound:upjet-v6.13.0 Dec 4, 2025
16 of 24 checks passed
@sergenyalcin
sergenyalcin deleted the update-loop-fix-v2 branch December 4, 2025 20:26
@github-actions

github-actions Bot commented Dec 4, 2025

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants