I am creating a postgres server and postgres database using terraform.
postgres server and database part of template:
resource "azurerm_postgresql_flexible_server" "example" {
name = "${azurerm_resource_group.postgres_rg.name}-${var.environment}"
resource_group_name = azurerm_resource_group.postgres_rg.name
location = azurerm_resource_group.postgres_rg.location
version = "13"
delegated_subnet_id = azurerm_subnet.example2.id
private_dns_zone_id = azurerm_private_dns_zone.example.id
administrator_login = var.administrator_login
administrator_password = var.administrator_password
zone = "3"
storage_mb = 131072
sku_name = var.postgres_sku #"GP_Standard_D2s_v3"
depends_on = [azurerm_private_dns_zone_virtual_network_link.example]
}
resource "azurerm_postgresql_database" "example" {
name = "martdatabase"
resource_group_name = azurerm_resource_group.postgres_rg.name
server_name = azurerm_postgresql_flexible_server.example.name
collation = "en_US.utf8"
charset = "utf8"
depends_on = [azurerm_postgresql_flexible_server.example]
}
Server got created and even I cross checked in the azure portal.
But during database creation, getting below error.
│ Error: creating/updating Database: (Name "martdatabase" / Server Name "deletek8s-del-postgres-del" / Resource Group "deletek8s-del-postgres"): postgresql.DatabasesClient#CreateOrUpdate: Failure sending request: StatusCode=404 -- Original Error: Code="ResourceNotFound" Message="The Resource 'Microsoft.DBforPostgreSQL/servers/deletek8s-del-postgres-del' under resource group 'deletek8s-del-postgres' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"
│
│ with azurerm_postgresql_database.example,
│ on 12-postgres.tf line 33, in resource "azurerm_postgresql_database" "example":
│ 33: resource "azurerm_postgresql_database" "example" {
I even reapplied, to cross check if any delay in updation, but same errror.
there is no proper resolution from the support team, what is the use of sharing the support case ID here anyway?
And also it is generic issue with your product, not to our specific project and no resolution provided by your team also yet.
Fix your postgres servers and share the resolution here.
Hi, @Uday Kiran Reddy (ureddy) I can understand your problem the reason for asking the support ticket is to understand what resolution they have provided and what is missing. however my internal team took a look at the error you mentioned below, and it seems to be looking for a single server instance with the name deletek8s-del-postgres-del as opposed to a flexible server. Can you double check the azurerm_postgresql_database. an example is pointing to the correct resource?
Regards
Geetha
even the sample provided here also getting same issue:
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server_database
you can check from your end also
Sign in to comment