Terraform-provider-azurerm: [azurerm] SIGSEGV on elasticpool import

Created on 27 Nov 2019  ยท  6Comments  ยท  Source: terraform-providers/terraform-provider-azurerm

Community Note

  • 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

Terraform (and AzureRM Provider) Version

Terraform v0.12.16
+ provider.azurerm v1.37.0

Affected Resource(s)

  • azurerm_mssql_elasticpool

Terraform Configuration Files

# 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
    }
}

Debug Output

https://gist.github.com/Dehalion/744310ed8512e6607bd8bf5c2a780d46

Panic Output

https://gist.github.com/Dehalion/744310ed8512e6607bd8bf5c2a780d46

Expected Behavior

The elastic pool resource should be imported into the state.

Actual Behavior

Crash

Steps to Reproduce

  1. terraform import module.sqlserverpool.azurerm_mssql_elasticpool.ep /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlserver/providers/Microsoft.Sql/servers/sqlserver-dbs/elasticpools/sqlserver-dbep

Important Factoids

  • Running azure in West Europe
  • Similar/same crash happened with a colleague using PowerShell and azurerm=1.35.0

References

  • Seems to be similar to #4169
bug crash servicmssql

All 6 comments

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!

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!

Was this page helpful?
0 / 5 - 0 ratings