feat: Add global_upgradable variable to support major engine version upgrades to global clusters. #426
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #425. A much more thorough explanation is provided in examples/global-cluster/README.md.
I recognize this adds complexity just to ignore
engine_version
, but ... I don't know another way around this issue.Upgrading major version of global clusters
Upgrading the major version of global clusters is possible, but due to a limitation in terraform, it requires some special consideration. As documented in the provider:
In order to accomplish this in a module that is otherwise used for non-global clusters, we must duplicate the cluster resource. The limitation that requires this is, terraform lifecycle meta-arguments can contain only literal values:
That means, that to ignore the
engine_version
in some cases but not in others, we need another resource. So, if you intend to upgrade your global cluster in the future, you must set the new variableglobal_upgradable
totrue
.Migrating the resource
If you already have a global cluster created with this module, and would like to make use of this feature, you'll need to move the cluster resource. That can be done with the cli:
Or via a new moved block:
After that, changing the major version should work without issue.
Breaking Changes
This is not a breaking change, but if people start using this variable without exercising caution they could wipe a database, but that is the nature of it all I suppose. It could possibly be considered a bug fix on the other hand.
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)pre-commit run -a
on my pull request