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

production db seeding #58

Open
ausfestivus opened this issue Dec 10, 2019 · 4 comments
Open

production db seeding #58

ausfestivus opened this issue Dec 10, 2019 · 4 comments

Comments

@ausfestivus
Copy link
Contributor

Evening,

Quick Q. Im working on an Azure production deployment stack for TFE using this module.
The stack creates the necessary Storage Account and Postgres DB for the production deployment. I can pass the attributes for these resources into the TFE module, no problem.

The tricky part is to seed the database with the necessary SQL.
Anyone got any tips to share on solving this need?

Im going to be scouring the internet looking for a suitable and workable approach. Figured I would put it here as well to see if any Hashicorp or other TFE users have solved this?

At the back of my mind is to actually put the SA and DBS provisioning into an entirely seperate TF stack. That would give me more flexibility I think and also achieve a nice logical separation between the TFE app layer and a persistent data layer.

@erindatkinson
Copy link
Contributor

That's (separate state for data layer) definitely an option, I've done similar things and used a remote state data source to pull the resulting resource parameters. Using a postgres provider in the data layer environment, you should be able to set up the database/schemas/extensions pretty consistently and be able to either implicitly or explicitly set the dependency.

@ausfestivus
Copy link
Contributor Author

Hey @erindatkinson, I got all excited about using the postgresql provider to do the DB seeding but then I ran into hashicorp/terraform-provider-postgresql#2 at a screaming pace.

Le sigh.

@ausfestivus
Copy link
Contributor Author

A wild blocker appeared.
hashicorp/terraform-provider-postgresql#107

@ausfestivus
Copy link
Contributor Author

hashicorp/terraform-provider-postgresql#2 has now been closed with a fix/workaround. Im going to rework this to see if it does indeed work as advertised and will update this accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants