Open YevheniiPokhvalii opened 1 month ago
Voting for Prioritization
Volunteering to Work on This Issue
Would you not use a lifecycle block for this:-
lifecycle {
ignore_changes = [
engine_version
]
}
Would you not use a lifecycle block for this:-
lifecycle { ignore_changes = [ engine_version ] }
This block is not a solution. It will not allow to update to major Postgres versions in the future. Someone fixed the same issue for MySQL versioning: https://github.com/hashicorp/terraform-provider-aws/issues/1198 But that solution does not work for Postgres versioning: https://www.postgresql.org/docs/release/
If
auto_minor_version_upgrade
is enabled, you can provide a prefix of the version such as8.0
(for8.0.36
).
So, how about setting engine_version to 13
instead of 13.13
?
If
auto_minor_version_upgrade
is enabled, you can provide a prefix of the version such as8.0
(for8.0.36
).So, how about setting engine_version to
13
instead of13.13
?
I tired that. I does not work. It tries to downgrade the database to 13 in this case. You'll see something like that:
# aws_db_instance.db_instance will be updated in-place
~ resource "aws_db_instance" "db_instance" {
~ engine_version = "13.15" -> "13"
id = "db-someID"
}
Yes... I was falling into the same situation, too. It seems that this document was added at https://github.com/hashicorp/terraform-provider-aws/pull/3886 several years ago, but I don't know this is the intended behavior.
Terraform Core Version
1.9.5
AWS Provider Version
5.69.0
Affected Resource(s)
aws_db_instance
Expected Behavior
Terraform should ignore the minor Postgres versions upgrade when
auto_minor_version_upgrade = true
. (auto_minor_version_upgrade
is true by default)Actual Behavior
api error InvalidParameterCombination: Cannot upgrade postgres from 13.15 to 13.13
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Run
terraform plan
Terraform will perform the following actions:
Run
terraform apply
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
This patch does not seem to fix the issue with Postgres versions: https://github.com/hashicorp/terraform-provider-aws/issues/1198
Postgres versioning: https://www.postgresql.org/docs/release/
Would you like to implement a fix?
None