You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.
Terraform Version
1.8.1
AzureRM Provider Version
3.96.0
Affected Resource(s)/Data Source(s)
azurerm_postgresql_flexible_server
Terraform Configuration Files
# Copied from https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server#example-usageprovider"azurerm" {
features {}
}
resource"azurerm_resource_group""example" {
name="example-resources"location="Australia East"## Changed from West Europe
}
resource"azurerm_virtual_network""example" {
name="example-vn"location=azurerm_resource_group.example.locationresource_group_name=azurerm_resource_group.example.nameaddress_space=["10.0.0.0/16"]
}
resource"azurerm_subnet""example" {
name="example-sn"resource_group_name=azurerm_resource_group.example.namevirtual_network_name=azurerm_virtual_network.example.nameaddress_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""example" {
name="example.postgres.database.azure.com"resource_group_name=azurerm_resource_group.example.name
}
resource"azurerm_private_dns_zone_virtual_network_link""example" {
name="exampleVnetZone.com"private_dns_zone_name=azurerm_private_dns_zone.example.namevirtual_network_id=azurerm_virtual_network.example.idresource_group_name=azurerm_resource_group.example.namedepends_on=[azurerm_subnet.example]
}
resource"azurerm_postgresql_flexible_server""example" {
name="example-psqlflexibleserver"resource_group_name=azurerm_resource_group.example.namelocation=azurerm_resource_group.example.locationversion="12"delegated_subnet_id=azurerm_subnet.example.idprivate_dns_zone_id=azurerm_private_dns_zone.example.idadministrator_login="psqladmin"administrator_password="H@Sh1CoR3!"zone="1"### This line costs 4.42 USD/month.storage_mb=32768### This line costs 136.89 USD/month!storage_tier="P30"### This line costs 343.10 USD/month!sku_name="GP_Standard_D4s_v3"depends_on=[azurerm_private_dns_zone_virtual_network_link.example]
}
Debug Output/Panic Output
n/a
Expected Behaviour
As Terraform doesn't show the cost of resources (like the Azure Portal does), an example resource should be optimised for cost, to minimise the risk of bill shock.
By comparison, using storage_tier = "P4" and sku_name = "B_Standard_B1ms" results in a 23 USD/month bill.
Actual Behaviour
The example resource appears to be optimised for performance, resulting in a 484 USD/month PostgreSQL bill.
Related to this issue, I think it's worth going over the other example resources in the AzureRM provider to see if there are other high-cost configurations like this one.
Is there an existing issue for this?
Community Note
Terraform Version
1.8.1
AzureRM Provider Version
3.96.0
Affected Resource(s)/Data Source(s)
azurerm_postgresql_flexible_server
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
As Terraform doesn't show the cost of resources (like the Azure Portal does), an example resource should be optimised for cost, to minimise the risk of bill shock.
By comparison, using
storage_tier = "P4"
andsku_name = "B_Standard_B1ms"
results in a 23 USD/month bill.Actual Behaviour
The example resource appears to be optimised for performance, resulting in a 484 USD/month PostgreSQL bill.
Steps to Reproduce
Important Factoids
running from Australia East
References
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server#example-usage
The text was updated successfully, but these errors were encountered: