How to Deploy a Private Access Azure PostgreSQL Flexible Server using Terraform

Guillermo Musumeci
6 min readJun 30, 2024

Azure Database for PostgreSQL Flexible Server is a relational database service based on the open-source Postgres database engine. It’s a fully managed database-as-a-service that can handle mission-critical workloads with predictable performance, security, high availability, and dynamic scalability.

In this story, we will learn how to deploy Azure PostgreSQL Flexible Server with Private Access using Terraform.

Azure PostgreSQL Flexible Server can be deployed in three ways:

  • Public Access (Allowed IP addresses): accessible from the internet, access can be restricted to specific IPs (good for dev and test environments) → check this story.
  • Public Access with Private Endpoint: accessible from the internet, access can be restricted to specific IPs (good for dev and test environments) → check this story.
  • Private access (VNET Integration): very secure server connected to VNET and only accessible from servers located in Azure (best option for production applications) — this story —

1. Defining the Azure Provider

First, we will define Azure authentication variables.

--

--

Guillermo Musumeci
Guillermo Musumeci

Written by Guillermo Musumeci

Certified AWS, Azure & GCP Architect | HashiCorp Ambassador | Terraform SME | KopiCloud Founder | ex-AWS | Entrepreneur | Book Author | Husband & Dad of ✌

No responses yet