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
I'm running the latest version and am trying to redeploy a log analytics workspace, and for some reason it is triggering this WorkspaceMigrateState call, and this code is trying to lookup an attribute (resource_group) that isn't part of the azurerm_log_analytics_workspace definition, and as far as I can tell going back through releases back to 1.24 was not part of it then. I believe it should be looking up resource_group_name.
Anyhow, it is then triggering an error as it gets a null resource group for use.
I can't see why this code is actually being called either.
func WorkspaceMigrateState(v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) {
switch v {
case 0:
log.Println("[INFO] Migrating Log Analytics Workspace State V0 to V1")
return workspaceStateMigrateV0toV1(is, meta)
default:
return is, fmt.Errorf("Unexpected schema version: %d", v)
}
}
func workspaceStateMigrateV0toV1(is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) {
if is.Empty() {
log.Println("[DEBUG] Empty InstanceState; nothing to migrate.")
return is, nil
}
log.Printf("[DEBUG] Migrating IDs to correct casing for Log Analytics Workspace")
name := is.Attributes["name"]
resourceGroup := is.Attributes["resource_group"]
subscriptionId := meta.(*clients.Client).Account.SubscriptionId
id := parse.NewLogAnalyticsWorkspaceID(name, resourceGroup)
is.ID = id.ID(subscriptionId)
return is, nil
}
The text was updated successfully, but these errors were encountered:
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!
ghost
locked as resolved and limited conversation to collaborators
Jan 15, 2021
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm running the latest version and am trying to redeploy a log analytics workspace, and for some reason it is triggering this WorkspaceMigrateState call, and this code is trying to lookup an attribute (resource_group) that isn't part of the azurerm_log_analytics_workspace definition, and as far as I can tell going back through releases back to 1.24 was not part of it then. I believe it should be looking up resource_group_name.
Anyhow, it is then triggering an error as it gets a null resource group for use.
I can't see why this code is actually being called either.
The text was updated successfully, but these errors were encountered: