hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io
Other
42.76k stars 9.56k forks source link

Terraform Test: Add ability to restrict parallelism when creating resources #34237

Open richid opened 1 year ago

richid commented 1 year ago

Terraform Version

Terraform v1.6.3
on darwin_arm64

Use Cases

I have been converting some modules from my home-grown E2E testing pattern to using the new terraform test framework. It's been great but one issue I'm running into is that there is no ability to set the -parallelism=<N> flag when using the apply command. This is generally not a problem but there are certain AWS resources that run into problems when this is not set to 1. Specifically, certain AWS ECS resources as outlined https://github.com/hashicorp/terraform-provider-aws/issues/9777

Attempted Solutions

Tried to set the following envvar: TF_CLI_ARGS_apply="-parallelism=1". Confirmed that the -parallelism argument is not supported by the test command.

Proposal

Add a -parallelism=<N> flag to the test command that operates in the same way it does for the apply command.

References

No response

crw commented 1 year ago

Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again!