{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/3254","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/3254/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/3254/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/3254/events","html_url":"https://github.com/hashicorp/terraform/issues/3254","id":106812937,"number":3254,"title":"local-exec provisioner missing 'command'","user":{"login":"felka","id":2912252,"avatar_url":"https://avatars.githubusercontent.com/u/2912252?v=3","gravatar_id":"","url":"https://api.github.com/users/felka","html_url":"https://github.com/felka","followers_url":"https://api.github.com/users/felka/followers","following_url":"https://api.github.com/users/felka/following{/other_user}","gists_url":"https://api.github.com/users/felka/gists{/gist_id}","starred_url":"https://api.github.com/users/felka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felka/subscriptions","organizations_url":"https://api.github.com/users/felka/orgs","repos_url":"https://api.github.com/users/felka/repos","events_url":"https://api.github.com/users/felka/events{/privacy}","received_events_url":"https://api.github.com/users/felka/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"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provisioner/local-exec","name":"provisioner/local-exec","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-16T16:43:52Z","updated_at":"2016-03-08T02:12:56Z","closed_at":null,"body":"Having strange issue while passing vars from one module to another. First module creates VPC incl. subnets, routing tables and SGs. Second module supposed to get vpc_name, region and run local-exec.\r\n```\r\nmodule \"vpc\" {\r\n  source = \"../../modules/vpc-terraform\"\r\n  region = \"${var.region}\"\r\n  vpc_name = \"${var.vpc_name}\"\r\n  vpc_network_prefix = \"${var.vpc_network_prefix}\"\r\n}\r\n\r\nmodule \"consul_cluster_build\" {\r\n  source = \"../../modules/cluster_build\"\r\n  vpc_name = \"${module.vpc.vpc_name}\"\r\n  region = \"${module.vpc.vpc_region}\"\r\n  service_name = \"consul\"\r\n}\r\n\r\n```\r\nOutputs are in place.\r\n\r\ncluster_build module is very simple. Get parameters and run chef-provisioning.\r\n\r\n```\r\nvariable vpc_name {}\r\nvariable vpc_region {}\r\nvariable service_name {}\r\nvariable environment {}\r\n\r\nresource \"null_resource\" \"cluster_provisioning\" {\r\n   provisioner \"local-exec\" {\r\n    command = \"EC2_VPC=${var.vpc_name} EC2_REGION=${var.vpc_region} CHEF_ENVIRONMENT=${var.environment} chef-client -z provisioning/drivers/aws-fog.rb provisioning/cluster_${var.service_name}.rb\"\r\n  }\r\n}\r\n```\r\nThe reason we are passing vars from vpc module to cluster_build is to make a dependancy working, as module resource has no depends_on.\r\nThe apply fails, after successfully creating all vpc module resources, with \r\n\r\n```\r\nError applying plan:\r\n\r\n1 error(s) occurred:\r\n\r\n* local-exec provisioner missing 'command'\r\n\r\n```\r\n\r\nIf I'm passing vars to second module from configuration itself, and not from first module, everything runs. However run fails in chef-provisioning, because we must have vpc before using SGs and subnets in chef-provisioner.\r\n\r\nAny Idea?\r\n\r\nThanks in advance! "},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/193557810","html_url":"https://github.com/hashicorp/terraform/issues/3254#issuecomment-193557810","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/3254","id":193557810,"user":{"login":"dferrantelli","id":1713422,"avatar_url":"https://avatars.githubusercontent.com/u/1713422?v=3","gravatar_id":"","url":"https://api.github.com/users/dferrantelli","html_url":"https://github.com/dferrantelli","followers_url":"https://api.github.com/users/dferrantelli/followers","following_url":"https://api.github.com/users/dferrantelli/following{/other_user}","gists_url":"https://api.github.com/users/dferrantelli/gists{/gist_id}","starred_url":"https://api.github.com/users/dferrantelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dferrantelli/subscriptions","organizations_url":"https://api.github.com/users/dferrantelli/orgs","repos_url":"https://api.github.com/users/dferrantelli/repos","events_url":"https://api.github.com/users/dferrantelli/events{/privacy}","received_events_url":"https://api.github.com/users/dferrantelli/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T02:12:56Z","updated_at":"2016-03-08T02:12:56Z","body":"I too am having this issue, but can't seem to find a workaround. (even passing vars in from config results in the error below)\r\n```\r\nError applying plan:\r\n\r\n11 error(s) occurred:\r\n\r\n* local-exec provisioner missing 'command'\r\n* local-exec provisioner missing 'command'\r\n* local-exec provisioner missing 'command'\r\n* local-exec provisioner missing 'command'\r\n* local-exec provisioner missing 'command'\r\n* local-exec provisioner missing 'command'\r\n* local-exec provisioner missing 'command'\r\n* local-exec provisioner missing 'command'\r\n* local-exec provisioner missing 'command'\r\n* local-exec provisioner missing 'command'\r\n* local-exec provisioner missing 'command'\r\n```\r\n\r\nI am trying to curl foreman to generate the necessary ENC data for puppet during creation, but I can't seem to get terraform to let me use vars in the local-exec. "}}