I am trying to crease a managed SQL instance in Azure and keep running into issues with the timezone. I am trying to use the EST timezone. I have tried EST
and America/Indianapolis
and I am still unable to resolve the error. I keep getting this error
Failure sending request:
│ StatusCode=400 — Original Error: Code="InvalidTimezone" Message="’America/Indianapolis’ is not a supported timezone."
Below is the TF been used to create this resource. Any help is greatly appreciated.
resource "azurerm_mssql_managed_instance" "sql" {
name = var.sql_instance_name
resource_group_name = azurerm_resource_group.az-rg-details.name
location = azurerm_resource_group.az-rg-details.location
administrator_login = var.admin_login
administrator_login_password = var.admin_password
license_type = "BasePrice"
subnet_id = azurerm_subnet.sql-subnet.id
sku_name = var.sku_name
vcores = var.vcores
storage_size_in_gb = var.storage_size_in_gb
timezone_id = "America/Indianapolis"
depends_on = [
azurerm_subnet_network_security_group_association.sql-subnet-nsg-association,
azurerm_subnet_route_table_association.sql-subnet-route-table-association,
]
}
2
Answers
I can reproduce the same issue when using the same terraform code.
The cause of the issue is that the time zone value: EST or America/Indianapolis is not valid.
To solve this issue, you can set the
timezone_id
toUS Eastern Standard Time
to use the EST Time zone.Terraform sample:
The above error you encountered is due to an incorrect time zone ID being passed in the Terraform code. If you want to create the EST time zone, you can use the time zone ID below. For more details about supported Time Zone IDs for Azure SQL Managed Instance, follow the MS Doc.
Here is the updated terraform code to create Azure SQL Managed Instance in
EST Time Zone
.After running the terraform , the SQL managed instance has been created successfully in EST Time Zone.
Reference: azurerm_mssql_managed_instance