Terraform v0.12.16
+ provider.azurerm v1.37.0
azurerm_mssql_elasticpool# main.tf
provider "azurerm" {
version = "=1.37.0"
tenant_id = local.tenant_id
subscription_id = local.dbs_subscription_id
}
module "sqlserverpool" {
source = "./modules/dbs-elastic-pool"
tenant_id = local.tenant_id
location = local.location
ressourcegroup = module.sqlserver.resource_group_name
servername = module.sqlserver.dbs_name
name = "sqlserver"
custom_tags = merge(local.default_tags, {"environment": "qa"})
}
# modules/dbs-elastic-pool/main.tf
resource "azurerm_mssql_elasticpool" "ep" {
location = var.location
resource_group_name = var.ressourcegroup
server_name = var.servername
name = "${local.project_name}-dbep"
max_size_gb = var.dbs_ep_max_size_gb
sku {
name = var.dbs_ep_sku_name
tier = var.dbs_ep_tier
capacity = var.dbs_ep_capacity
}
per_database_settings {
min_capacity = 0
max_capacity = local.max_capacity
}
}
https://gist.github.com/Dehalion/744310ed8512e6607bd8bf5c2a780d46
https://gist.github.com/Dehalion/744310ed8512e6607bd8bf5c2a780d46
The elastic pool resource should be imported into the state.
Crash
terraform import module.sqlserverpool.azurerm_mssql_elasticpool.ep /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlserver/providers/Microsoft.Sql/servers/sqlserver-dbs/elasticpools/sqlserver-dbephey @Dehalion
Thanks for opening this issue.
I've opened #5017 which fixes the crash here - but this is ultimately caused by the Resource ID using the incorrect case here - in particular with the segment elasticpools which should be elasticPools. Due to the way the Azure API behaves we're forced to treat Resource ID's as case sensitive - and whilst this isn't the best UX here - in the future we're planning to add some validation to better explain this during both Import and referencing ID's between resources.
Would you be able to take a look and see if updating the casing for elasticpools to elasticPools works for you?
Thanks!
hey @Dehalion
Thanks for opening this issue.
I've opened #5017 which fixes the crash here - but this is ultimately caused by the Resource ID using the incorrect case here - in particular with the segment elasticpools which should be elasticPools. Due to the way the Azure API behaves we're forced to treat Resource ID's as case sensitive - and whilst this isn't the best UX here - in the future we're planning to add some validation to better explain this during both Import and referencing ID's between resources.
Would you be able to take a look and see if updating the casing for elasticpools to elasticPools works for you?
Thanks!
๐ Yes, that works!
Thank you very much.
This has been released in version 1.38.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:
provider "azurerm" {
version = "~> 1.38.0"
}
# ... other configuration ...
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error ๐ค ๐ , please reach out to my human friends ๐ [email protected]. Thanks!