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

Add PostgreSQL module #1355

Merged
merged 8 commits into from
Feb 7, 2023
Merged

Add PostgreSQL module #1355

merged 8 commits into from
Feb 7, 2023

Conversation

pamelafox
Copy link
Member

@pamelafox pamelafox commented Jan 11, 2023

This PR adds a module to /core for PostGreSQL flexible servers. I used sqlserver.bicep as inspiration, and ported over a simple Flask+PG app to use the module. You can see my usage here:
https://github.com/pamelafox/flask-db-quiz-example/blob/765f1a0abf4da055ac910a520ed8f26d0a076cd4/infra/main.bicep#L31

Design decisions made:

  • What to call the parameters: I typically called them the same thing they're called in the actual Bicep, as that seems the most obvious choice.
  • What to turn into parameters: I made SKU, storage, database name, login details, and PG version into params. That's inspired by what you customize in the portal and by what sqlserver.bicep parameterizes. It might also make sense to make highAvailability mode a parameter, as that's something that the Portal lets you specify, but none of my samples need it.
  • What properties to specify/leave out: I created a new PG server in the Portal, looked at its properties to figure out what the defaults are, and removed properties that were already the default values. I wasn't sure if High Availability is default disabled or not, since that's part of the PG server creation process, so I left it in as an explicit property.

TODO:

@ghost ghost assigned pamelafox Jan 11, 2023
@pamelafox
Copy link
Member Author

I ported another template today and had to make some changes to this to allow for Virtual Network support. That's going to be hairier so I don't have it ready yet. FYI in case you want to wait on review, or want that to be a follow-up PR. (It'll be an addition more than a change).

@jongio
Copy link
Member

jongio commented Feb 6, 2023

@weikanglim - Please merge when ready (we'll need to merge for folks that aren't in azdcore)

@weikanglim weikanglim merged commit 85cdb98 into Azure:main Feb 7, 2023
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

Successfully merging this pull request may close these issues.

4 participants