{"action":"opened","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-cloudflare/issues/134","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-cloudflare","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-cloudflare/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-cloudflare/issues/134/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-cloudflare/issues/134/events","html_url":"https://github.com/terraform-providers/terraform-provider-cloudflare/issues/134","id":373347729,"node_id":"MDU6SXNzdWUzNzMzNDc3Mjk=","number":134,"title":"Error during import of cloudflare_zone_lockdown","user":{"login":"jphilaine","id":707933,"node_id":"MDQ6VXNlcjcwNzkzMw==","avatar_url":"https://avatars2.githubusercontent.com/u/707933?v=4","gravatar_id":"","url":"https://api.github.com/users/jphilaine","html_url":"https://github.com/jphilaine","followers_url":"https://api.github.com/users/jphilaine/followers","following_url":"https://api.github.com/users/jphilaine/following{/other_user}","gists_url":"https://api.github.com/users/jphilaine/gists{/gist_id}","starred_url":"https://api.github.com/users/jphilaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jphilaine/subscriptions","organizations_url":"https://api.github.com/users/jphilaine/orgs","repos_url":"https://api.github.com/users/jphilaine/repos","events_url":"https://api.github.com/users/jphilaine/events{/privacy}","received_events_url":"https://api.github.com/users/jphilaine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-24T07:45:56Z","updated_at":"2018-10-24T07:45:56Z","closed_at":null,"author_association":"NONE","body":"Hi there,\r\n\r\nI can't import a Cloudflare zone lockdown, probably due to recently API update.\r\nTerraform use `zones/firewall/lockdowns/xxxxxxxxxxxxxxxxxxxxxxxx`\r\n instead of `zones/yyyyyyyyyyyyyyyyyyyyyyyyy/firewall/lockdowns/xxxxxxxxxxxxxxxxxxxxxxxx`.\r\n\r\nCloudflare API return this error:\r\n```\r\n{\"success\":false,\"errors\":[{\"code\":7003,\"message\":\"Could not route to \\/zones\\/firewall\\/lockdowns\\/xxxxxxxxxxxxxxxxxxxxxxxx, perhaps your object identifier is invalid?\"},{\"code\":7000,\"message\":\"No route for that URI\"}],\"messages\":[],\"result\":null}\r\n```\r\n\r\n### Terraform Version\r\nterraform version is 0.11.10\r\nterraform-provider-cloudflare version is 1.7.0\r\n\r\n### Affected Resource(s)\r\n- cloudflare_zone_lockdown\r\n\r\n### Terraform Configuration Files\r\n```hcl\r\nprovider \"cloudflare\" {\r\n  email = \"${var.cloudflare[\"email\"]}\"\r\n  token = \"${var.cloudflare[\"token\"]}\"\r\n}\r\n\r\n# Restrict access to these endpoints to requests from a known IP address.\r\nresource \"cloudflare_zone_lockdown\" \"endpoint_lockdown\" {\r\n  zone        = \"hubside-preprod.com\"\r\n  paused      = \"false\"\r\n  description = \"Restrict access to these endpoints to requests from a known IP address\"\r\n  urls = [\r\n    \"api.mysite.com/some/endpoint*\",\r\n  ]\r\n  configurations = [\r\n    {\r\n      \"target\" = \"ip\"\r\n      \"value\" = \"198.51.100.4\"\r\n    },\r\n  ]\r\n}\r\n```\r\n\r\n### Debug Output\r\nSee an anonymous debug output:\r\nhttps://gist.github.com/jphilaine/3f7db1eb37971d4650fe8b2da1a9bdbc\r\n\r\n### Panic Output\r\nNothing\r\n\r\n### Expected Behavior\r\nTerraform can refreshing state at the end of import and successfuly  import Cloudflare zone lockdown.\r\n\r\n### Actual Behavior\r\nAn error occured due to malformed Cloudflare API URLs: missing zone ID\r\n\r\n### Steps to Reproduce\r\n1. Create a zone lockdown into Cloudflare\r\n2. Create a terraform cloudflare_zone_lockdown ressource\r\n3. Import existing Cloudflare lockdown into state using `terraform import` command\r\n\r\n### Important Factoids\r\n\r\n### References\r\n- Cloudflare zone lockdown API documentation: https://api.cloudflare.com/#zone-lockdown-properties\r\n"}}
{"actor":{"display_login":"jphilaine"}}