{"action":"closed","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/1156","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/1156/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/1156/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/1156/events","html_url":"https://github.com/hashicorp/terraform/issues/1156","id":60202548,"number":1156,"title":"Add stand-alone local-exec","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":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-07T11:25:39Z","updated_at":"2015-03-11T23:43:30Z","closed_at":"2015-03-11T23:43:30Z","body":"The provisioner `local-exec` is currently tightly coupled to an existing resource (yeah, it's a \"provisioner\" so it makes sense).\r\n\r\nIt would be IMO nice to have a stand-alone resource \"local-exec\":\r\n\r\n```ruby\r\nresource \"local-exec\" \"create_web_in_aws\" {\r\n  command = \"aws ec2 run-instances --image-id ami-123abcd | jq .Instances[0].InstanceId > web_instance_id.txt\"\r\n  unless = \"aws ec2 describe-instances --instance-ids $(cat web_instance_id.txt)\"\r\n}\r\n\r\nresource \"local-exec\" \"create_web_in_gcloud\" {\r\n  command = \"gcloud compute instances create myweb --image centos-6\"\r\n  unless = \"gcloud compute instances describe myweb\"\r\n}\r\n```\r\n\r\nInstead of custom local files it could use the chosen TF state storage, so it's easily portable (e.g. capturing stdout from `command` and passing it to `unless` as stdin)?\r\nThe resource could have a different name to prevent confusions when looking at provisioners.\r\n\r\nThis would allow using providers or features that have not even been implemented into Terraform yet."}}