scottwinkler / terraform-provider-shell

Terraform provider for executing shell commands and saving output to state file
Mozilla Public License 2.0
279 stars 60 forks source link

add enable_parallelism #58

Closed scottwinkler closed 4 years ago

scottwinkler commented 4 years ago

Adding a new argument to the provider config to enable parallelism (default is false). This will make it harder to debug things, but also much faster.

provider "shell" {
    enable_parallelism = true
}

data "shell_script" "weather" {
 count = 100
  lifecycle_commands {
    read = <<-EOF
        echo "{\"SanFrancisco\": \"$(curl wttr.in/SanFrancisco?format="%l:+%c+%t")\"}"
    EOF
  }
}

For the above example, it is 5.2s vs 42.7s without parallelism turned on.