{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/1834","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/1834/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/1834/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/1834/events","html_url":"https://github.com/hashicorp/terraform/pull/1834","id":73701853,"number":1834,"title":"Expose parallelism semaphore in the cli ui as -parallelism=#","user":{"login":"knuckolls","id":91188,"avatar_url":"https://avatars.githubusercontent.com/u/91188?v=3","gravatar_id":"","url":"https://api.github.com/users/knuckolls","html_url":"https://github.com/knuckolls","followers_url":"https://api.github.com/users/knuckolls/followers","following_url":"https://api.github.com/users/knuckolls/following{/other_user}","gists_url":"https://api.github.com/users/knuckolls/gists{/gist_id}","starred_url":"https://api.github.com/users/knuckolls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knuckolls/subscriptions","organizations_url":"https://api.github.com/users/knuckolls/orgs","repos_url":"https://api.github.com/users/knuckolls/repos","events_url":"https://api.github.com/users/knuckolls/events{/privacy}","received_events_url":"https://api.github.com/users/knuckolls/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/enhancement","name":"enhancement","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-06T18:34:00Z","updated_at":"2015-05-08T07:04:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hashicorp/terraform/pulls/1834","html_url":"https://github.com/hashicorp/terraform/pull/1834","diff_url":"https://github.com/hashicorp/terraform/pull/1834.diff","patch_url":"https://github.com/hashicorp/terraform/pull/1834.patch"},"body":":mega:  **This is a WIP. Feedback appreciated.**  :mega:\r\n\r\n**Why**\r\nThere are a couple of use cases I can came up with below but in general this semaphore was available within Terraform core but wasn't exposed up to the UI. I think fundamentally that if there's a configurable that it should be exposed to the end user.\r\n\r\n**Use Cases**\r\n\r\n*Rate Limiting*\r\nFor example, if you're hitting the AWS rate limit you will be able to limit the parallelism to perhaps avoid hitting the limit. There are other proposals for putting limits on individual providers but for now this will allow you to change from the default parallelism of 10 things at a time.\r\n\r\n*Safely Rolling Stateful Services*\r\nConsider a \"clustered by default\" stateful datastore that has a replication factor (i.e hdfs, cassandra, riak, elasticsearch). If you have a need to roll the whole cluster then create before destroy isn't enough. Whereas the nodes may have come up, the data may not be entirely replicated before the destroys begin. Doing a `terraform apply -parallelism=1` gets us half of the way there by slowing down the process so that replication can occur properly. \r\n\r\nThe other part is a blocking script in a pre-destroy provisioner that checks to see if blocks have been sufficiently replicated before allowing the next destroy to occur. That will be my next PR and @phinze and I talked through the design as far as what can be done with the current internals.\r\n\r\n**TODO**\r\n- [x] `terraform apply -parallelism=n`\r\n- [x] `terraform destroy -parallelism=n`\r\n- [x] `terraform plan -parallelism=n`\r\n- [x] `terraform refresh -parallelism=n`\r\n- [x] apply test written\r\n- [ ] destroy test written\r\n- [ ] plan test written\r\n- [ ] refresh test written\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/100128501","html_url":"https://github.com/hashicorp/terraform/pull/1834#issuecomment-100128501","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/1834","id":100128501,"user":{"login":"knuckolls","id":91188,"avatar_url":"https://avatars.githubusercontent.com/u/91188?v=3","gravatar_id":"","url":"https://api.github.com/users/knuckolls","html_url":"https://github.com/knuckolls","followers_url":"https://api.github.com/users/knuckolls/followers","following_url":"https://api.github.com/users/knuckolls/following{/other_user}","gists_url":"https://api.github.com/users/knuckolls/gists{/gist_id}","starred_url":"https://api.github.com/users/knuckolls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knuckolls/subscriptions","organizations_url":"https://api.github.com/users/knuckolls/orgs","repos_url":"https://api.github.com/users/knuckolls/repos","events_url":"https://api.github.com/users/knuckolls/events{/privacy}","received_events_url":"https://api.github.com/users/knuckolls/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T07:04:58Z","updated_at":"2015-05-08T07:04:58Z","body":"Tests written and passing for `terraform apply -parallelism=1` and `terraform apply -parallelism=2`."}}