Open iamnothere101 opened 4 days ago
Thanks for raising this issue. Seems the resource azurerm_postgresql_flexible_server is created successfully with below tf config on my local. Could you try latest azurerm provider and below tf config to see if the issue still exists? Thanks.
tf config:
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-postgresql-test01"
location = "eastus"
}
resource "azurerm_virtual_network" "test" {
name = "acctest-vn-test01"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
address_space = ["10.0.0.0/16"]
}
resource "azurerm_subnet" "test" {
name = "acctest-sn-test01"
resource_group_name = azurerm_resource_group.test.name
virtual_network_name = azurerm_virtual_network.test.name
address_prefixes = ["10.0.2.0/24"]
service_endpoints = ["Microsoft.Storage"]
delegation {
name = "fs"
service_delegation {
name = "Microsoft.DBforPostgreSQL/flexibleServers"
actions = [
"Microsoft.Network/virtualNetworks/subnets/join/action",
]
}
}
}
resource "azurerm_private_dns_zone" "test" {
name = "accpdztest01.postgres.database.azure.com"
resource_group_name = azurerm_resource_group.test.name
}
resource "azurerm_private_dns_zone_virtual_network_link" "test" {
name = "acctestVnetZonetest01.com"
private_dns_zone_name = azurerm_private_dns_zone.test.name
virtual_network_id = azurerm_virtual_network.test.id
resource_group_name = azurerm_resource_group.test.name
depends_on = [azurerm_subnet.test]
}
resource "azurerm_postgresql_flexible_server" "test" {
name = "acctest-fs-test01"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
administrator_login = "adminTerraform"
administrator_password = "QAZwsx123"
version = "16"
backup_retention_days = 7
storage_mb = 32768
delegated_subnet_id = azurerm_subnet.test.id
private_dns_zone_id = azurerm_private_dns_zone.test.id
public_network_access_enabled = false
sku_name = "GP_Standard_D2s_v3"
zone = "1"
high_availability {
mode = "ZoneRedundant"
standby_availability_zone = "2"
}
maintenance_window {
day_of_week = 0
start_hour = 8
start_minute = 0
}
tags = {
ENV = "Test"
}
depends_on = [azurerm_private_dns_zone_virtual_network_link.test]
}
tf config:
provider "azurerm" {
features {}
}
module "naming" {
source = "Azure/naming/azurerm"
version = "~> 0.4"
}
resource "azurerm_resource_group" "my_resource_group" {
location = "eastus"
name = "acctest-pso-test01"
}
resource "random_password" "myadminpassword" {
length = 16
override_special = "_%@"
special = true
}
module "postgres-server" {
depends_on = [azurerm_resource_group.my_resource_group]
source = "Azure/avm-res-dbforpostgresql-flexibleserver/azurerm"
# version = "0.1.2"
location = "eastus"
name = "acctest-psoss-test01"
resource_group_name = azurerm_resource_group.my_resource_group.name
administrator_login = "adminTerraform"
administrator_password = "QAZwsx123"
storage_mb = 32768
storage_tier = "P4"
backup_retention_days = 7
server_version = 16
sku_name = "GP_Standard_D2s_v3"
zone = 1
high_availability = {
mode = "ZoneRedundant"
standby_availability_zone = 2
}
tags = null
}
Is there an existing issue for this?
Community Note
Terraform Version
1.0.0
AzureRM Provider Version
3.105
Affected Resource(s)/Data Source(s)
avm-res-dbforpostgresql-flexibleserver
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Postgres Module deployment should succeed.
Actual Behaviour
Terraform apply is failing at 60 mins with the error shown above.
Steps to Reproduce
I am calling the module from a parent module and running terraform apply. When I re-run the pipeline, it complains that the resource exists and I need time to import it into my state file:
Important Factoids
No response
References
No response