ljfranklin / terraform-resource

A concourse resource to create infrastructure via Terraform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terraform parallelism param on Apply action

tomsmallwood opened this issue · comments

The parallelism parameter could help with apply actions that modify the same underlying resource which can lead to errors.

https://www.terraform.io/docs/cli/commands/apply.html#parallelism-n

For example, modifying multiple AWS CloudFormation StackSet Instances in the same StackSet caused:

Error: error updating CloudFormation StackSet (stacksetname): OperationInProgressException: Another Operation on StackSet Arn:Aws: CloudFormation:eu-west-1:xxxxxxxxx:StackSet/stacksetid.
Status code: 409

Would need to append the -parallelism=X string to applyArgs here:
https://github.com/ljfranklin/terraform-resource/blob/master/src/terraform-resource/terraform/client.go#L243

Would also need to provide an option in Put Parameters, e.g.:

- put: terraform
  params:
      parallelism: 1

Sounds reasonable, although it's unfortunate the AWS Terraform provider can't automatically serialize operations on resources which can't be modified concurrently. I'd accept a PR which adds an optional parallelism put parameter, adding help wanted label.

Closed via #155