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: Ignore changes to snapshot_identifier #269

Conversation

robinbowes
Copy link
Contributor

@robinbowes robinbowes commented Nov 18, 2020

Description

Ignore changes to snapshot_identifier. Fixes #270

Motivation and Context

snapshot_identifier is only used when creating the DB instance. However, if the parameter is changed post-creation it causes the DB instance to be deleted and re-created.

This is the solution recommended by Hashicorp: https://discuss.hashicorp.com/t/rds-restored-from-snapshot-is-destroyed-on-next-terraform-apply/3693/4

Breaking Changes

This change should not break anything, unless a user is relying on changing this parameter to trigger the creation of a DB instance.

How Has This Been Tested?

We are using this change in our private fork of this module.

@robinbowes robinbowes force-pushed the ignore_snapshot_identifier_changes branch from bfc7ee7 to 130d8a2 Compare November 18, 2020 09:34
@robinbowes robinbowes changed the title Ignore changes to snapshot_identifier fix: Ignore changes to snapshot_identifier Nov 18, 2020
@robinbowes robinbowes closed this Nov 18, 2020
@robinbowes
Copy link
Contributor Author

Close/re-open to re-trigger tests

@robinbowes robinbowes reopened this Nov 18, 2020
@robinbowes robinbowes force-pushed the ignore_snapshot_identifier_changes branch from 130d8a2 to 13280db Compare November 18, 2020 09:37
@okgolove
Copy link

okgolove commented Dec 3, 2020

I'd suggest having two aws_db_instance resources. One with ignore_changes, one without.
In some cases I want to trigger recreating db instance based on snapshot identifier.

@bryantbiggs
Copy link
Member

hi @robinbowes - thanks for the PR. this is always something very tricky/difficult to work with in modules (lifecycle hooks). I think the safest approach is as @okgolove stated but that adds a significant amount of overhead and complexity for little gain - I'm not sure what we will be able to do here (hoping Hashicorp provide a variabilzed version of lifecycle hooks soon 🤞🏼)

@bryantbiggs
Copy link
Member

closing this in favor of what is provided by the latest release of the upstream AWS provider hashicorp/terraform-provider-aws#18013

@github-actions
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 Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RDS is destroyed on next terraform apply if snapshot_identifier is changed
4 participants