{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/6471","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/6471/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/6471/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/6471/events","html_url":"https://github.com/hashicorp/terraform/issues/6471","id":152996223,"number":6471,"title":"provider/consul: `consul_key_prefix.subkeys` improperly handles keys containing '.'","user":{"login":"gechr","id":7656560,"avatar_url":"https://avatars.githubusercontent.com/u/7656560?v=3","gravatar_id":"","url":"https://api.github.com/users/gechr","html_url":"https://github.com/gechr","followers_url":"https://api.github.com/users/gechr/followers","following_url":"https://api.github.com/users/gechr/following{/other_user}","gists_url":"https://api.github.com/users/gechr/gists{/gist_id}","starred_url":"https://api.github.com/users/gechr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gechr/subscriptions","organizations_url":"https://api.github.com/users/gechr/orgs","repos_url":"https://api.github.com/users/gechr/repos","events_url":"https://api.github.com/users/gechr/events{/privacy}","received_events_url":"https://api.github.com/users/gechr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-04T12:11:51Z","updated_at":"2016-05-04T14:02:01Z","closed_at":null,"body":"### Terraform Version\r\n`Terraform v0.6.15`\r\n\r\n### Affected Resource(s)\r\n- consul_key_prefix\r\n\r\n### Terraform Configuration Files\r\n```hcl\r\nresource \"consul_key_prefix\" \"bug\" {\r\n  datacenter  = \"eu\"\r\n  token       = \"dummy-token-abcdef\"\r\n  path_prefix = \"test/prefix/\"\r\n\r\n  subkeys = {\r\n    \"this/is.a.test\" = \"foobar\"\r\n    \"this/is/a/test\" = \"foobar\"\r\n    \"this-is-a/test\" = \"foobar\"\r\n    \"this-is-a-test\" = \"foobar\"\r\n  }\r\n}\r\n```\r\n\r\n### Expected Behavior\r\n```\r\n+ consul_key_prefix.bug\r\n    datacenter:             \"\" => \"eu\"\r\n    path_prefix:            \"\" => \"test/prefix/\"\r\n    subkeys.#:              \"\" => \"4\"\r\n    subkeys.this-is-a-test: \"\" => \"foobar\"\r\n    subkeys.this-is-a/test: \"\" => \"foobar\"\r\n    subkeys.this/is.a.test: \"\" => \"foobar\"\r\n    subkeys.this/is/a/test: \"\" => \"foobar\"\r\n    token:                  \"\" => \"dummy-token-abcdef\"\r\n```\r\n\r\n### Actual Behavior\r\n```\r\n+ consul_key_prefix.bug\r\n    datacenter:             \"\" => \"eu\"\r\n    path_prefix:            \"\" => \"test/prefix/\"\r\n    subkeys.#:              \"\" => \"4\"\r\n    subkeys.this-is-a-test: \"\" => \"foobar\"\r\n    subkeys.this-is-a/test: \"\" => \"foobar\"\r\n    subkeys.this/is.a.test: \"\" => \"\"\r\n    subkeys.this/is/a/test: \"\" => \"foobar\"\r\n    token:                  \"\" => \"dummy-token-abcdef\"\r\n```\r\n\r\n### Steps to Reproduce\r\nPlease list the steps required to reproduce the issue, for example:\r\n\r\n1. Specify resource `consul_key_prefix` with `subkeys` key containing a `.` character\r\n2. Run `terraform plan` or `terraform apply`\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/216874573","html_url":"https://github.com/hashicorp/terraform/issues/6471#issuecomment-216874573","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/6471","id":216874573,"user":{"login":"radeksimko","id":287584,"avatar_url":"https://avatars.githubusercontent.com/u/287584?v=3","gravatar_id":"","url":"https://api.github.com/users/radeksimko","html_url":"https://github.com/radeksimko","followers_url":"https://api.github.com/users/radeksimko/followers","following_url":"https://api.github.com/users/radeksimko/following{/other_user}","gists_url":"https://api.github.com/users/radeksimko/gists{/gist_id}","starred_url":"https://api.github.com/users/radeksimko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radeksimko/subscriptions","organizations_url":"https://api.github.com/users/radeksimko/orgs","repos_url":"https://api.github.com/users/radeksimko/repos","events_url":"https://api.github.com/users/radeksimko/events{/privacy}","received_events_url":"https://api.github.com/users/radeksimko/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T14:02:01Z","updated_at":"2016-05-04T14:02:01Z","body":"The way we worked around this in some API Gateway resources recently was to add a field `field_in_json`, which was effectively (un)marshalled under the hood as map (I know, 🐽  yucky, isn't it).\r\n\r\nI think that such workarounds should be limited to cases where map keys are not fully in user's control (i.e. keys are prescribed by the API) and also such workarounds will be deprecated once we get the core bug fixed.\r\n"}}