User Tools

Site Tools


terraformpostgresql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
terraformpostgresql [2024/11/28 22:32] z0hpvkterraformpostgresql [2025/03/08 22:24] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ===== Terraform with PostgreSQL ===== ===== Terraform with PostgreSQL =====
  
-==== Microsoft Azure ====+==== Microsoft Azure and PostgreSQL Flexible Server ====
  
 === Useful Links === === Useful Links ===
Line 10: Line 10:
 [https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server] [https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server]
  
-=== providers.tf ===+The below commands will initialise Terraform, create an execution plan and apply it.\\ 
 +Afterwards you can clean up the resources created via the terraform destroy command.\\ 
 +<code> 
 +terraform init -upgrade 
 +terraform validate 
 +terraform plan -out main.tfplan 
 +terraform apply main.tfplan 
 + 
 +terraform plan -destroy -out main.destroy.tfplan 
 +terraform apply main.destroy.tfplan 
 +</code> 
 + 
 +=== Terraform Code === 
 +== providers.tf ==
 <file yaml providers.tf> <file yaml providers.tf>
 terraform { terraform {
Line 32: Line 45:
 </file> </file>
  
-=== variables.tf ===+== variables.tf ==
 <file yaml variables.tf> <file yaml variables.tf>
 variable "resource_group" { variable "resource_group" {
Line 55: Line 68:
 </file> </file>
  
-=== main.tf ===+== main.tf ==
 Uses existing resource group, virtual network and network security group Uses existing resource group, virtual network and network security group
  
Line 79: Line 92:
 </file> </file>
  
-=== postgresql-fs-db.tf ===+== postgresql-fs-db.tf ==
 <file yaml postgresql-fs-db.tf> <file yaml postgresql-fs-db.tf>
 locals { locals {
Line 106: Line 119:
 </file> </file>
  
-=== outputs.tf ===+== outputs.tf ==
 <file yaml outputs.tf> <file yaml outputs.tf>
 output "azurerm_postgresql_flexible_server" { output "azurerm_postgresql_flexible_server" {
terraformpostgresql.1732833129.txt.gz · Last modified: 2025/03/08 22:23 (external edit)