Skip to content

Commit

Permalink
feat: adding the ability to define the parallel settings for terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
gambol99 committed Dec 24, 2024
1 parent 5aa5043 commit 0895ddf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
1 change: 0 additions & 1 deletion .checkov.yml

This file was deleted.

20 changes: 18 additions & 2 deletions .github/workflows/terraform-plan-and-apply-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ on:
required: false
type: string

terraform-parallelism:
default: 20
description: "The number of parallel operations to run"
required: false
type: number

terraform-version:
default: "1.9.0"
description: "The version of terraform to use"
Expand Down Expand Up @@ -414,7 +420,12 @@ jobs:
id: plan
run: |
set -o pipefail
terraform -chdir=${{ inputs.terraform-dir }} plan -var-file="${TF_VAR_FILE}" -no-color -input=false -out=tfplan -lock-timeout=${{ inputs.terraform-lock-timeout }} 2>&1 | tee tfplan.stdout
terraform -chdir=${{ inputs.terraform-dir }} plan \
-var-file="${TF_VAR_FILE}" \
-no-color -input=false \
-out=tfplan \
-parallelism=${{ inputs.terraform-parallelism }} \
-lock-timeout=${{ inputs.terraform-lock-timeout }} 2>&1 | tee tfplan.stdout
- name: Terraform Plan JSON Output
run: |
terraform -chdir=${{ inputs.terraform-dir }} show -json tfplan > tfplan.json
Expand Down Expand Up @@ -728,4 +739,9 @@ jobs:
name: additional-dir-${{ inputs.environment }}
path: ${{ inputs.additional-dir }}
- name: Terraform Apply
run: terraform apply -auto-approve -input=false -lock-timeout=${{ inputs.terraform-lock-timeout }} tfplan
run: |
terraform apply \
-auto-approve \
-input=false \
-parallelism=${{ inputs.terraform-parallelism }} \
-lock-timeout=${{ inputs.terraform-lock-timeout }} tfplan

0 comments on commit 0895ddf

Please sign in to comment.