hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.64k forks source link

Terraform support to restore DB from existing backup file for Azure managed PostgreSQL #19769

Open jayeshkulkarni opened 1 year ago

jayeshkulkarni commented 1 year ago

Description

I am using terraform for automating deployment in azure PG flexible server DB. But, in case of managed PostgreSQL, there is no option to crete DB from backup file.

azure sql db has https://www.terraform.io/docs/providers/azurerm/r/sql_database.html with "create_mode" = "restore"

we need similar support for PostgreSql https://registry.terraform.io/providers/hashicorp/azurerm/3.37.0/docs/resources/postgresql_flexible_server_database

Similar issue has been closed previously. Have you removed the implemented solution for PG SQL ? Because from the blow exisiting closed issue it is evident that it was implemented.

https://github.com/hashicorp/terraform-provider-azurerm/issues/6180

Can you please help in getting this through terraform.

Thanks best regards Jayesh K.

New or Affected Resource(s)/Data Source(s)

azurerm_postgresql_flexible_server_database

Potential Terraform Configuration

No response

References

No response

neil-yechenwei commented 1 year ago

Thanks for raising this issue. Seems it has been supported by create_mode of azurerm_postgresql_flexible_server.

jayeshkulkarni commented 1 year ago

Thanks for raising this issue. Seems it has been supported by create_mode of azurerm_postgresql_flexible_server.

As the description says : create_mode - (Optional) The creation mode which can be used to restore or replicate existing servers. Possible values are Default and PointInTimeRestore. Changing this forces a new PostgreSQL Flexible Server to be created.

It will create new PG server from pointinttime backup if PG server crashes. I want to just create DB not entire server from backup file.