{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/16380","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/16380/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/16380/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/16380/events","html_url":"https://github.com/hashicorp/terraform/issues/16380","id":266321272,"number":16380,"title":"Data sources should allow empty results without failing","user":{"login":"clstokes","id":293763,"avatar_url":"https://avatars1.githubusercontent.com/u/293763?v=4","gravatar_id":"","url":"https://api.github.com/users/clstokes","html_url":"https://github.com/clstokes","followers_url":"https://api.github.com/users/clstokes/followers","following_url":"https://api.github.com/users/clstokes/following{/other_user}","gists_url":"https://api.github.com/users/clstokes/gists{/gist_id}","starred_url":"https://api.github.com/users/clstokes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clstokes/subscriptions","organizations_url":"https://api.github.com/users/clstokes/orgs","repos_url":"https://api.github.com/users/clstokes/repos","events_url":"https://api.github.com/users/clstokes/events{/privacy}","received_events_url":"https://api.github.com/users/clstokes/received_events","type":"User","site_admin":false},"labels":[{"id":85946959,"url":"https://api.github.com/repos/hashicorp/terraform/labels/enhancement","name":"enhancement","color":"d4c5f9","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2017-10-18T00:21:37Z","updated_at":"2018-04-10T05:28:15Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"This is an enhancement request. Data sources should allow empty results without failing the plan or apply. This would allow for fallback or fallthrough scenarios that are needed in certain situations. An optional `allow_empty_result` attribute on the data source would support many use cases where a datasource value is not explicitly required. The specific attribute name isn't important to me.\r\n\r\nAs an example, the configuration below currently fails because the `aws_ami` datasource will not find any results. However I still want the apply to continue using a fallback AMI. \r\n\r\n```\r\ndata \"aws_ami\" \"main\" {\r\n  most_recent = true\r\n\r\n  filter {\r\n    name   = \"name\"\r\n    values = [\"blah-blah\"]\r\n  }\r\n}\r\n\r\noutput \"ami\" {\r\n  value = \"${coalesce(data.aws_ami.main.id,\"ami-abc-123\")}\"\r\n}\r\n```\r\n\r\n(This is just an example so please don't get hung up on this specific use case.)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/379978360","html_url":"https://github.com/hashicorp/terraform/issues/16380#issuecomment-379978360","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/16380","id":379978360,"user":{"login":"kanawaden","id":11599458,"avatar_url":"https://avatars2.githubusercontent.com/u/11599458?v=4","gravatar_id":"","url":"https://api.github.com/users/kanawaden","html_url":"https://github.com/kanawaden","followers_url":"https://api.github.com/users/kanawaden/followers","following_url":"https://api.github.com/users/kanawaden/following{/other_user}","gists_url":"https://api.github.com/users/kanawaden/gists{/gist_id}","starred_url":"https://api.github.com/users/kanawaden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanawaden/subscriptions","organizations_url":"https://api.github.com/users/kanawaden/orgs","repos_url":"https://api.github.com/users/kanawaden/repos","events_url":"https://api.github.com/users/kanawaden/events{/privacy}","received_events_url":"https://api.github.com/users/kanawaden/received_events","type":"User","site_admin":false},"created_at":"2018-04-10T05:28:15Z","updated_at":"2018-04-10T05:28:15Z","author_association":"NONE","body":"I have a similar issue but with security group. While creating a new environment, I get \"data.aws_security_group.XXXXXX_sg: no matching SecurityGroup found\"."}}
{"actor":{"display_login":"kanawaden"}}