Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/terraform_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ on:
required: false
type: boolean
default: false
description: 'Set true to to destroy terraform infrastructure.'
description: 'Set true to destroy terraform infrastructure.'
approvers:
required: false
type: string
description: 'Approvals list to approve apply or destroy'
terraform_version:
type: string
default: 1.3.6
description: 'Required erraform version '
description: 'Required Terraform version'
timeout:
required: false
type: number
Expand Down Expand Up @@ -76,6 +76,11 @@ on:
required: false
type: string
default: ""
plan_only:
description: "Set this to `true` to run `terraform plan` only"
required: false
type: boolean
default: false
secrets:
AZURE_CREDENTIALS:
required: false
Expand Down Expand Up @@ -239,6 +244,7 @@ jobs:
echo "${delimiter}" >> $GITHUB_OUTPUT

- name: ✅ Accept plan or deny
if: ${{ inputs.plan_only != true }}
uses: trstringer/manual-approval@v1
timeout-minutes: ${{ inputs.timeout }}
with:
Expand All @@ -248,7 +254,7 @@ jobs:
issue-title: "Terraform Plan for Infrastructure Update"

- name: 🚀 terraform apply
if: ${{ inputs.destroy != true }}
if: ${{ inputs.destroy != true && inputs.plan_only != true }}
run: |
if [ -n "${{ inputs.var_file }}" ]; then
cd ${{ inputs.working_directory }}
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ Above example is just a simple example to call workflow from github shared workf
* [Example for scan and push docker image on Dockerhub](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/03.docker.md#example-for-scan-and-push-docker-image-on-dockerhub)
* [Example for scan and push docker image on ECR](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/03.docker.md#example-for-scan-and-push-docker-image-on-ecr)
4. [Auto Assign Assignee Workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/04.auto-assignee.md)
5. [Terraform Checks Workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/05.terraform-checks.md)
* [Example for terraform checks with azure cloud](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/05.terraform-checks.md#example-for-terraform-checks-with-azure-cloud)
* [Example for terraform checks with aws cloud](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/0.5.terraform-checks.md#example-for-terraform-checks-with-aws-cloud)
* [Example for terraform checks with digitalocean cloud](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/05.terraform-checks.md#example-for-terraform-checks-with-digitalocean-cloud)
5. [Terraform Checks Workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/05.tf-checks.md)
* [Example for terraform checks with azure cloud](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/05.tf-checks.md#example-for-terraform-checks-with-azure-cloud)
* [Example for terraform checks with aws cloud](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/0.5.tf-checks.md#example-for-terraform-checks-with-aws-cloud)
* [Example for terraform checks with digitalocean cloud](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/05.tf-checks.md#example-for-terraform-checks-with-digitalocean-cloud)
6. [Terraform Lint Workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/06.terraform-lint.md)
7. [Terraform Checks Workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/07.terraform-checks.md)
7. [Terraform Checks Workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/07.tf-checks.md)
8. [Checkov Workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/08.checkov.md)
9. [Terraform Workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/09.terraform_workflow.md)
10. [Infracost workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/docs/10.infracost.md)
Expand Down Expand Up @@ -114,11 +114,11 @@ Above example is just a simple example to call workflow from github shared workf
20. [SST Workflow](./docs/20.sst.md)
21. [Stale PR workflow](./docs/21.stale-pr.md)
22. [Tag Release workflow](./docs/22.tag-release.md)
23. [Terraform Checks Workflow](./docs/23.terraform-checks.md)
* [Example for terraform checks with azure cloud](./docs/23.terraform-checks.md#example-for-terraform-checks-with-azure-cloud)
* [Example for terraform checks with aws cloud](./docs/23.terraform-checks.md#example-for-terraform-checks-with-aws-cloud)
* [Example for terraform checks with digitalocean cloud](./docs/23.terraform-checks.md#example-for-terraform-checks-with-digitalocean-cloud)
24. [Terraform Checks Workflow](./docs/24.terraform-checks.md)
23. [Terraform Checks Workflow](./docs/23.tf-checks.md)
* [Example for terraform checks with azure cloud](./docs/23.tf-checks.md#example-for-terraform-checks-with-azure-cloud)
* [Example for terraform checks with aws cloud](./docs/23.tf-checks.md#example-for-terraform-checks-with-aws-cloud)
* [Example for terraform checks with digitalocean cloud](./docs/23.tf-checks.md#example-for-terraform-checks-with-digitalocean-cloud)
24. [Terraform Checks Workflow](./docs/24.tf-checks.md)
25. [Terraform Lint Workflow](./docs/25.terraform-lint.md)
26. [Terraform Module Tag Release Workflow (Shared)](./docs/25.tf-monorepo-tag-release.md)
27. [Terraform PR Plan Diff workflow](./docs/27.tf-pr-checks.md)
Expand Down
1 change: 1 addition & 0 deletions docs/23.terraform-checks.md → docs/23.tf-checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
with:
working_directory: './_example/complete/'
provider: aws
# terraform_version: 0.12.31 // Specify the Terraform version to use. Uncomment and provide your desired version, or leave it as is to use the latest version.
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
5 changes: 3 additions & 2 deletions docs/27.terraform_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ jobs:
uses: clouddrove/github-shared-workflows/.github/workflows/terraform_workflow.yml@master
with:
provider: # aws
working_directory: # Specify terraform code directory in repo
var_file: # name of tfvar file e.g "variable.tfvar"
working_directory: # Specify terraform code directory in repo, eg. './_example/complete/'
var_file: # name of tfvar file, eg. "variable.tfvar"
aws_region: # specify region eg. us-east-2
approvers: # Assignee name for approve apply or destroy step
minimum-approvals: # Minimum number of approvals required to progress the workflow, deafault value is 1
terraform_version: # Specify terraform version e.g 1.3.6
plan_only: # If the value is set to true, the workflow will only show terraform plan
destroy: # If the value is set to true, the workflow proceeds to the destroy step. However, the default value is false
secrets:
AWS_ACCESS_KEY_ID: # Specify AWS Access key ID
Expand Down