{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/5694","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/5694/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/5694/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/5694/events","html_url":"https://github.com/hashicorp/terraform/issues/5694","id":141595835,"number":5694,"title":"Need a \"GetExists\" or similar for determining if a key is set in a configuration ","user":{"login":"catsby","id":61721,"avatar_url":"https://avatars.githubusercontent.com/u/61721?v=3","gravatar_id":"","url":"https://api.github.com/users/catsby","html_url":"https://github.com/catsby","followers_url":"https://api.github.com/users/catsby/followers","following_url":"https://api.github.com/users/catsby/following{/other_user}","gists_url":"https://api.github.com/users/catsby/gists{/gist_id}","starred_url":"https://api.github.com/users/catsby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/catsby/subscriptions","organizations_url":"https://api.github.com/users/catsby/orgs","repos_url":"https://api.github.com/users/catsby/repos","events_url":"https://api.github.com/users/catsby/events{/privacy}","received_events_url":"https://api.github.com/users/catsby/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-17T14:17:04Z","updated_at":"2016-03-17T14:26:43Z","closed_at":null,"body":"For AWS AutoScaling groups, `max/min/desired` capacity can be `0`, so we added the code in https://github.com/hashicorp/terraform/pull/4693 to no longer use `GetOk` in checking these values, and instead just use `Get`. \r\n\r\nhttps://github.com/hashicorp/terraform/issues/5681 reminds us that simply omitting `desired_capacity` should be allowed, too, since it's not actually required in the API. \r\n\r\nWe need to be know if a key was set at all, not just if it was set and not a non-default value. \r\n\r\n`d.Get`: \r\n\r\n    // If you want to test if something is set at all in the configuration,\r\n    // use GetOk.\r\n\r\n`d.GetOk`:\r\n\r\n    // GetOk returns the data for the given key and whether or not the key\r\n    // has been set to a non-zero value at some point.\r\n\r\nWe need to check if it's been set, regardless of the non-default status or not"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/197901823","html_url":"https://github.com/hashicorp/terraform/issues/5694#issuecomment-197901823","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/5694","id":197901823,"user":{"login":"stack72","id":227823,"avatar_url":"https://avatars.githubusercontent.com/u/227823?v=3","gravatar_id":"","url":"https://api.github.com/users/stack72","html_url":"https://github.com/stack72","followers_url":"https://api.github.com/users/stack72/followers","following_url":"https://api.github.com/users/stack72/following{/other_user}","gists_url":"https://api.github.com/users/stack72/gists{/gist_id}","starred_url":"https://api.github.com/users/stack72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stack72/subscriptions","organizations_url":"https://api.github.com/users/stack72/orgs","repos_url":"https://api.github.com/users/stack72/repos","events_url":"https://api.github.com/users/stack72/events{/privacy}","received_events_url":"https://api.github.com/users/stack72/received_events","type":"User","site_admin":false},"created_at":"2016-03-17T14:26:43Z","updated_at":"2016-03-17T14:26:43Z","body":"This ^^ :) Will be an awesome addition!"}}