From 20a814028d29fe1da6a05c1372e2b6a56b64edfa Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 6 Mar 2019 09:25:36 -0500 Subject: [PATCH] command: Consistency implement and document parallelism default of 10 References: * https://github.com/hashicorp/terraform/blob/f4da82a023bf6db1fa8da24236882d874ff0a87e/command/command.go#L41 * https://github.com/hashicorp/terraform/blob/b9d8e96e0c7c52487e45eaab1aa6dacc39997b47/terraform/context.go#L149-L155 --- command/import.go | 2 +- command/refresh.go | 2 +- website/docs/commands/apply.html.markdown | 3 ++- website/docs/commands/import.html.md | 4 ++++ website/docs/commands/plan.html.markdown | 3 ++- website/docs/commands/refresh.html.markdown | 4 ++++ 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/command/import.go b/command/import.go index 0b6bde83e..b566ee9fc 100644 --- a/command/import.go +++ b/command/import.go @@ -38,7 +38,7 @@ func (c *ImportCommand) Run(args []string) int { } cmdFlags := c.Meta.extendedFlagSet("import") - cmdFlags.IntVar(&c.Meta.parallelism, "parallelism", 0, "parallelism") + cmdFlags.IntVar(&c.Meta.parallelism, "parallelism", DefaultParallelism, "parallelism") cmdFlags.StringVar(&c.Meta.statePath, "state", "", "path") cmdFlags.StringVar(&c.Meta.stateOutPath, "state-out", "", "path") cmdFlags.StringVar(&c.Meta.backupPath, "backup", "", "path") diff --git a/command/refresh.go b/command/refresh.go index 79dab83c0..db7ca9c43 100644 --- a/command/refresh.go +++ b/command/refresh.go @@ -23,7 +23,7 @@ func (c *RefreshCommand) Run(args []string) int { cmdFlags := c.Meta.extendedFlagSet("refresh") cmdFlags.StringVar(&c.Meta.statePath, "state", DefaultStateFilename, "path") - cmdFlags.IntVar(&c.Meta.parallelism, "parallelism", 0, "parallelism") + cmdFlags.IntVar(&c.Meta.parallelism, "parallelism", DefaultParallelism, "parallelism") cmdFlags.StringVar(&c.Meta.stateOutPath, "state-out", "", "path") cmdFlags.StringVar(&c.Meta.backupPath, "backup", "", "path") cmdFlags.BoolVar(&c.Meta.stateLock, "lock", true, "lock state") diff --git a/website/docs/commands/apply.html.markdown b/website/docs/commands/apply.html.markdown index f8a63746d..11c372469 100644 --- a/website/docs/commands/apply.html.markdown +++ b/website/docs/commands/apply.html.markdown @@ -38,7 +38,8 @@ The command-line flags are all optional. The list of available flags are: * `-no-color` - Disables output with coloring. * `-parallelism=n` - Limit the number of concurrent operation as Terraform - [walks the graph](/docs/internals/graph.html#walking-the-graph). + [walks the graph](/docs/internals/graph.html#walking-the-graph). Defaults to + 10. * `-refresh=true` - Update the state for each resource prior to planning and applying. This has no effect if a plan file is given directly to diff --git a/website/docs/commands/import.html.md b/website/docs/commands/import.html.md index 2662b72ed..e177641ab 100644 --- a/website/docs/commands/import.html.md +++ b/website/docs/commands/import.html.md @@ -48,6 +48,10 @@ The command-line flags are all optional. The list of available flags are: * `-no-color` - If specified, output won't contain any color. +* `-parallelism=n` - Limit the number of concurrent operation as Terraform + [walks the graph](/docs/internals/graph.html#walking-the-graph). Defaults + to 10. + * `-provider=provider` - Specified provider to use for import. The value should be a provider alias in the form `TYPE.ALIAS`, such as "aws.eu". This defaults to the normal provider based on the prefix of the resource being imported. You usually diff --git a/website/docs/commands/plan.html.markdown b/website/docs/commands/plan.html.markdown index bb97a5bc6..1cc63eb93 100644 --- a/website/docs/commands/plan.html.markdown +++ b/website/docs/commands/plan.html.markdown @@ -60,7 +60,8 @@ The command-line flags are all optional. The list of available flags are: plans below. * `-parallelism=n` - Limit the number of concurrent operation as Terraform - [walks the graph](/docs/internals/graph.html#walking-the-graph). + [walks the graph](/docs/internals/graph.html#walking-the-graph). Defaults + to 10. * `-refresh=true` - Update the state prior to checking for differences. diff --git a/website/docs/commands/refresh.html.markdown b/website/docs/commands/refresh.html.markdown index 659bea372..c03e68911 100644 --- a/website/docs/commands/refresh.html.markdown +++ b/website/docs/commands/refresh.html.markdown @@ -37,6 +37,10 @@ The command-line flags are all optional. The list of available flags are: * `-no-color` - If specified, output won't contain any color. +* `-parallelism=n` - Limit the number of concurrent operation as Terraform + [walks the graph](/docs/internals/graph.html#walking-the-graph). Defaults + to 10. + * `-state=path` - Path to read and write the state file to. Defaults to "terraform.tfstate". Ignored when [remote state](/docs/state/remote.html) is used.