Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] Unable to destroy IP Access Lists #426

Closed
joselcaguilar opened this issue Dec 2, 2020 · 1 comment · Fixed by #464
Closed

[ISSUE] Unable to destroy IP Access Lists #426

joselcaguilar opened this issue Dec 2, 2020 · 1 comment · Fixed by #464
Assignees
Labels
azure Occurring on Azure cloud
Milestone

Comments

@joselcaguilar
Copy link

joselcaguilar commented Dec 2, 2020

Terraform Version

0.13.5 (tested on Windows x64 and Linux x64)

Affected Resource(s)

  • databricks_ip_access_list
  • databricks_workspace_conf (destroy not tested yet because databricks_ip_access_list has a depends_on applied to databricks_workspace_conf, so it should be destroyed later)

Environment variable names

Terraform Configuration Files

resource "databricks_workspace_conf" "adbWorkspaceConf" {
  count = var.sku == "premium" ? 1 : 0
  custom_config = {
    "enableIpAccessLists" : true
  }
  depends_on = [azurerm_databricks_workspace.adb]
}

resource "databricks_ip_access_list" "adbWorkspaceIPsAllowed" {
  count        = var.sku == "premium" ? 1 : 0
  label        = "AllowedIPs"
  list_type    = "ALLOW"
  ip_addresses = ["w.x.y.z/32","a.b.c.d/24"]
  depends_on   = [databricks_workspace_conf.adbWorkspaceConf]
}

Debug Output

module.databricks-vnt.databricks_ip_access_list.adbWorkspaceIPsAllowed[0]: Still destroying... [id=xyz, 40s elapsed]
[INFO] 200 OK {
  "id": "/subscriptions/xyz/resourceGroups/rg/providers... (50 more bytes)",
  "location": "westeurope",
  "name": "adb1",
  "properties": {
    "authorizations": [
      {
        "principalId": "xyz",
        "roleDefinitionId": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635"
      }
    ],
    "createdBy": {
      "applicationId": "foo-guid",
      "oid": "foo-guid2",
      "puid": "pu-id"
    },
    "createdDateTime": "2020-12-02T09:37:53.2337342Z",
    "managedResourceGroupId": "/subscriptions/xyz/resourceGroups/rg-adb-mg",
    "parameters": {
      "customPrivateSubnetName": {
        "type": "String",
        "value": "privateSubnet"
      },
      "customPublicSubnetName": {
        "type": "String",
        "value": "publicSubnet"
      },
      "customVirtualNetworkId": {
        "type": "String",
... (1553 more bytes) <- GET https://management.azure.com/subscriptions/xyz/resourceGroups/rg/providers/Microsoft.Databricks/workspaces/adbvnt?api-version=2018-04-01
[INFO] Refreshed OAuth token for xyz from Azure CLI, which expires on 2020-12-02 12:25:54.875047
[INFO] DELETE /ip-access-lists/abc-guid null
[INFO] 400 Bad Request {
  "error_code": "MALFORMED_REQUEST",
  "message": "Invalid JSON given in the body of the request - expected a map"
}
2020/12/02 11:29:01 [DEBUG] module.databricks-vnt.databricks_ip_access_list.adbWorkspaceIPsAllowed[0]: apply errored, but we're indicating that via the Error pointer rather than returning it: Invalid JSON given in the body of the request - expected a map
Please consult API docs at https://docs.databricks.com/dev-tools/api/latest/ip-access-lists.html for details.

Panic Output

N/A

Expected Behavior

Both databricks_ip_access_list and databricks_workspace_conf resources should be destroyed as expected (error raised with databricks_ip_access_list at the moment)

Actual Behavior

When terraform destroy is running, we can see the error raised below:

module.databricks.databricks_ip_access_list.adbWorkspaceIPsAllowed[0]: Destroying... [id=xyz]
Error: Invalid JSON given in the body of the request - expected a map
Please consult API docs at https://docs.databricks.com/dev-tools/api/latest/ip-access-lists.html for details.

Steps to Reproduce

Please list the steps required to reproduce the issue:

  1. terraform destroy

Important Factoids

terraform plan and terraform apply worked as expected, this error is only showed on terraform destroy

@nfx nfx added this to the v0.3.0 milestone Dec 2, 2020
@nfx nfx assigned nfx and unassigned jarobey Jan 29, 2021
@nfx nfx linked a pull request Jan 29, 2021 that will close this issue
@nfx
Copy link
Contributor

nfx commented Jan 29, 2021

Fixed in 0.3.0

@nfx nfx closed this as completed Jan 29, 2021
nfx added a commit that referenced this issue Jan 29, 2021
nfx added a commit that referenced this issue Jan 29, 2021
* Simplified instance pool tests
* Fixed concurrent testing for instance profiles
* Added 0.3.0 migration instructions
* Fix minor inconsistencies
* Verified state upgraders for notebooks and files
* Add global rate limit to HTTP calls
* Fixed redundant multiple mounting clusters (#445)
* Sort outputs in group data source (#467)
* Use correct Azure environment for management endpoint (#470)
* Increased code coverage
* Added databricks_current_user data
* Send empty JSON body while deleting IP ACL (#426)
* Locking single EC2 Instance profile for tests
* Use Terraform 0.14+ as primary testing binary

Co-authored-by: Serge Smertin <serge.smertin@databricks.com>
@nfx nfx added the azure Occurring on Azure cloud label Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure Occurring on Azure cloud
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants