-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
computed_major_engine_version not working for postgres 9.6.18 #82
Comments
Without this change, setting `var.major_engine_version` has no effect. Setting `var.major_engine_version` manually can be used as a workaround for cloudposse#82
Actually, my expectation that the Open questions:
Maybe it is infeasible to calculate If that's the case, I might suggest making For now, I'll be specifying the |
If it's of use, we're using a different way to calculate this internally: # leave the regex open ended, Aurora, Oracle and SQLServer can all contain characters
version_parts = regex("^(?P<major>[0-9]+)(?:\\.(?P<minor>[0-9]+))?", var.engine_version)
version_parts_number = {
major = tonumber(local.version_parts["major"])
}
is_postgres = var.engine == "postgres"
uses_shorthand_major_version = local.is_postgres && local.version_parts_number["major"] >= 10
computed_major_engine_version = local.uses_shorthand_major_version ? local.version_parts["major"] : "${local.version_parts["major"]}.${local.version_parts["minor"]}"
major_engine_version = var.major_engine_version == "" ? local.computed_major_engine_version : var.major_engine_version It's working for postgres 9.6, 11, and 12. while the comment talks about other databases, this has only been tested with Postgres. Looking at the docs for sqlserver and oracle, it should still work as expected. |
Describe the Bug
computed major_engine_version fails when...
The computed value should be
9.6
but actually results in9
and the following error:Expected Behavior
When
var.engine_version == "9.6.18"
, thecomputed_major_engine_version
should be9.6
.Steps to Reproduce
Steps to reproduce the behavior:
fixtures.us-east-2.tfvars
:terraform plan -var-file="fixtures.us-east-2.tfvars"
. Observe that...terraform apply -var-file="fixtures.us-east-2.tfvars
Environment (please complete the following information):
Anything that will help us triage the bug will help. Here are some ideas:
The text was updated successfully, but these errors were encountered: