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

docs: db_instance_role_association: add replace_triggered_by to example config #39054

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

justinretzolk
Copy link
Member

Description

I wrote quite a long comment on the referenced issue that gives more detail as to what's going on here. The tl;dr is:

  • You can use a known, static string for aws_db_instance.example.identifier
  • Since it's known, if aws_db_instance.example is recreated, Terraform has no reason to recreate the aws_db_instance_role_association, since the db_instance_identifier is unchanged
  • On a second apply, the drift is detected/corrected

I didn't dig too far into when this became necessary, but I suspect it may have been when the id / identifier / resource_id changes happened ("Schema notes" in references).

I'm a bit on the fence on exactly how to document this. It's not required in all cases (using identifier_prefix or omitting both of those arguments negates the need), but it also might not be immediately clear that this is necessary, or exactly what is necessary (I got the "solution" wrong at first, for example). Adding the lifecycle block with a note to the example config seemed like a decent compromise.

Relations

Closes #38765

References

Output from Acceptance Testing

n/a, docs

@justinretzolk justinretzolk requested a review from a team as a code owner August 27, 2024 17:48
Copy link

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 documentation Introduces or discusses updates to documentation. service/rds Issues and PRs that pertain to the rds service. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels Aug 27, 2024
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 🚀

@justinretzolk justinretzolk merged commit bf72bc0 into main Aug 29, 2024
27 of 28 checks passed
@justinretzolk justinretzolk deleted the d-db_instance_role_association-example branch August 29, 2024 16:35
@github-actions github-actions bot added this to the v5.65.0 milestone Aug 29, 2024
terraform-aws-provider bot pushed a commit that referenced this pull request Aug 29, 2024
Copy link

This functionality has been released in v5.65.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 29, 2024
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 Sep 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: aws_db_instance_role_association not applied when recreating aws_db_instance
2 participants