{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/1495","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/1495/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/1495/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/1495/events","html_url":"https://github.com/hashicorp/terraform/pull/1495","id":67829144,"number":1495,"title":"config: Add length to built-in functions","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-04-11T20:17:44Z","updated_at":"2015-04-15T15:29:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hashicorp/terraform/pulls/1495","html_url":"https://github.com/hashicorp/terraform/pull/1495","diff_url":"https://github.com/hashicorp/terraform/pull/1495.diff","patch_url":"https://github.com/hashicorp/terraform/pull/1495.patch"},"body":"Related issue: #1389\r\n\r\nI would really welcome some feedback regarding expected use-cases of this function - i.e. see the test cases and input/output.\r\n\r\nI've taken certain assumptions about edge cases like **empty members** and **strings** generally.\r\n\r\n1. Some people may expect `${length(split(\",one,\"))}` to return `3`, but I can't think of any real use case for empty strings here, so `${length(split(\",one,\"))}` = `1`\r\n2. Some people may expect `${length(\"string\")}` to return `6` instead of `1`. <del>I could try and search for `InterpSplitDelim` and if it's not there, just treat the input as string.</del> done.\r\n\r\nOnce you'll be happy with the behaviour, I can add some docs too (and describe the behaviour there as well).\r\n\r\nI'm not entirely sure @mitchellh will want to see this implemented before a real support for arrays."},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/93449524","html_url":"https://github.com/hashicorp/terraform/pull/1495#issuecomment-93449524","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/1495","id":93449524,"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":"2015-04-15T15:29:06Z","updated_at":"2015-04-15T15:29:06Z","body":"PR updated accordingly, please let me know if there's anything else you'd change or if it's good to go."}}