{"action":"opened","issue":{"url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/190","repository_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws","labels_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/190/comments","events_url":"https://api.github.com/repos/terraform-providers/terraform-provider-aws/issues/190/events","html_url":"https://github.com/terraform-providers/terraform-provider-aws/issues/190","id":235632146,"number":190,"title":"aws_instance should allow to specify the instance state","user":{"login":"hashibot","id":26720499,"avatar_url":"https://avatars2.githubusercontent.com/u/26720499?v=3","gravatar_id":"","url":"https://api.github.com/users/hashibot","html_url":"https://github.com/hashibot","followers_url":"https://api.github.com/users/hashibot/followers","following_url":"https://api.github.com/users/hashibot/following{/other_user}","gists_url":"https://api.github.com/users/hashibot/gists{/gist_id}","starred_url":"https://api.github.com/users/hashibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashibot/subscriptions","organizations_url":"https://api.github.com/users/hashibot/orgs","repos_url":"https://api.github.com/users/hashibot/repos","events_url":"https://api.github.com/users/hashibot/events{/privacy}","received_events_url":"https://api.github.com/users/hashibot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-13T17:39:13Z","updated_at":"2017-06-13T17:39:13Z","closed_at":null,"body":"_This issue was originally opened by @FlorinAndrei as hashicorp/terraform#7262. It was migrated here as part of the [provider split](https://www.hashicorp.com/blog/upcoming-provider-changes-in-terraform-0-10/). The original body of the issue is below._\r\n\r\n<hr>\r\n\r\n### Terraform Version\n\nTerraform v0.6.16\n### Affected Resource(s)\n- aws_instance\n\nThere seems to be no way to specify the instance state in a template. I would like to be able to do something like this:\n\n```\nresource \"aws_instance\" \"web\" {\n    ami = \"ami-408c7f28\"\n    instance_type = \"t1.micro\"\n    state = \"stopped\"\n#    state = \"running\"\n    tags {\n        Name = \"HelloWorld\"\n    }\n}\n```\n\nThe default value for state should be \"running\".\n\nUse case: Terraform is great for creating / destroying test or development environments quickly (semi-temporary environments). But sometimes creating an environment may include a long initial step, like importing a DB from backups. If that's the case, I don't want to create the environment every morning, wait for DB to be imported, and then destroy it in the evening.\n\nInstead, I want to create the environment today, in the morning, and wait for the DB import once. Then, at the end of the day, turn off all instances and go home. That could be accomplished by specifying the state for all instances in a global variable, and changing that variable from \"running\" to \"stopped\", then run terraform apply.\n\nThen the next morning I'll just change the state back to \"running\", run terraform apply and have the environment up and running very quickly. The initial DB import would not have to be performed again every day. This would save a lot of time in such cases.\n"}}
{"actor":{"display_login":"hashibot"}}