Azure PostgresSQL via Terraform

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 พ.ย. 2024

ความคิดเห็น • 7

  • @nirmesh44
    @nirmesh44 2 ปีที่แล้ว +1

    superb learning. Thanks Bro!

    • @Infrasity
      @Infrasity  2 ปีที่แล้ว

      Glad to hear that

  • @rampanwar1316
    @rampanwar1316 2 ปีที่แล้ว +1

    Very Nice all videos.

    • @Infrasity
      @Infrasity  2 ปีที่แล้ว

      My Pleasure :)

  • @aradhanasoni6616
    @aradhanasoni6616 10 หลายเดือนก่อน

    Hello sir, if we want to provision postgresql flexible server on azure portal with Microsoft intra authentication only , so how to enable Microsoft intra authentication, could you please help me out

  • @adharshnik5124
    @adharshnik5124 ปีที่แล้ว

    Hi perfect, could you please share the git repo for this postgresql setup.

    • @Infrasity
      @Infrasity  ปีที่แล้ว

      Sure, here is a basic Terraform code to create a PostgreSQL instance in Azure:
      provider "azurerm" {
      features {}
      }
      resource "azurerm_resource_group" "rg" {
      name = "my-resource-group"
      location = "East US"
      }
      resource "azurerm_postgresql_server" "pg" {
      name = "my-postgresql-server"
      location = azurerm_resource_group.rg.location
      resource_group_name = azurerm_resource_group.rg.name
      sku_name = "B_Gen5_1"
      storage_mb = 5120
      backup_retention_days = 7
      administrator_login = "myadminlogin"
      administrator_login_password = "H@Sh1CoR3!"
      }
      resource "azurerm_postgresql_database" "pgdb" {
      name = "mydatabase"
      server_name = azurerm_postgresql_server.pg.name
      resource_group_name = azurerm_resource_group.rg.name
      charset = "UTF8"
      collation = "English_United States.1252"
      }
      resource "azurerm_postgresql_firewall_rule" "fwrule" {
      name = "AllowMyIP"
      resource_group_name = azurerm_resource_group.rg.name
      server_name = azurerm_postgresql_server.pg.name
      start_ip_address = "1.2.3.4"
      end_ip_address = "1.2.3.4"
      }
      This Terraform code creates a new PostgreSQL server in Azure, a database within the server, and a firewall rule to allow traffic from a specific IP address. You can customize the code to meet your specific requirements, such as using a different SKU or storage configuration, adding additional databases or firewall rules, and so on.
      Note that you will need to have the azurerm provider installed and authenticated with your Azure account to use this code. You can also add more advanced configuration options, such as enabling high availability or creating read replicas, by referring to the Terraform documentation and Azure documentation.