Skip to content
This repository has been archived by the owner on Nov 14, 2020. It is now read-only.

Trust expected_version if provided #103

Merged
merged 2 commits into from
Dec 20, 2019
Merged

Trust expected_version if provided #103

merged 2 commits into from
Dec 20, 2019

Conversation

vboginskey
Copy link
Contributor

Fixes #2, perhaps controversially.

The reason it's not currently possible to provision, e.g., an RDS instance and modify it with a postgresql_* resource is that the postgresql provider attempts to parse the PostgreSQL version by connecting to the database during the planning phase.

This pull request allows the user to prevent this from happening by specifying the version directly via the existing expected_version parameter. In practice, you would do something like:

resource "aws_db_instance" "this" {
  [...]
}

provider "postgresql" {
  [...]
  expected_version = aws_db_instance.this.engine_version
}

The behavior of the provider if expected_version is not supplied remains the same.

@ghost ghost added the size/XS label Nov 25, 2019
@cyrilgdn
Copy link
Contributor

cyrilgdn commented Dec 2, 2019

@vboginskey Thanks for this PR, I'll take a look and test it this week!

I started to work on a fix #2 but it's a bit more complex than expected and I think meanwhile this fix could be a good workaround 👍 (and anyway it's a useful option)

Just need to check what was the goal of this expectedVersion too at the beginning 🤔

@cyrilgdn cyrilgdn self-requested a review December 2, 2019 13:58
@cyrilgdn cyrilgdn merged commit 8445816 into hashicorp:master Dec 20, 2019
@cyrilgdn
Copy link
Contributor

Thanks for your work, this little patch will help a lot!

@vboginskey
Copy link
Contributor Author

Happy to help!

@vboginskey vboginskey deleted the trust-expected-version branch December 20, 2019 16:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fail when trying to use postgressql provider against aws rds instance in same definition
2 participants