Skip to content

Terraform Destroy

Description

This workflow destroys Terraform resources.

Inputs

name description type required default
environment

Environment to deploy.

string false ""
aws_account_id

The AWS account ID.

string false ""
aws_region

The AWS region.

string false ""
aws_role_name

The name of the role to assume with OIDC.

string false ""
aws_oidc_role_arn

AWS OIDC IAM role to assume

string false ""
gh_checkout_ref

The branch, tag or SHA to checkout.

string false ""
tf_dir

Path to the Terraform root module to apply.

string false ""
tf_backend_configs

List of Terraform backend config values, one per line.

string false ""
tf_backend_config_files

List of Terraform backend config files to use, one per line. Paths should be relative to the GitHub Actions workspace.

string false ""
tf_var_files

List of tfvars files to use, one per line. Paths should be relative to the GitHub Actions workspace.

string false ""
tf_vars

Variables to set for the Terraform plan. This should be valid Terraform syntax.

string false ""
tf_pre_run

Command to run before Terraform is executed.

string false ""

Usage

jobs:
  job1:
    uses: tx-pts-dai/github-workflows/.github/workflows/tf-destroy.yaml@v2
    with:
      environment:
      # Environment to deploy.
      #
      # Type: string
      # Required: false
      # Default: ""

      aws_account_id:
      # The AWS account ID.
      #
      # Type: string
      # Required: false
      # Default: ""

      aws_region:
      # The AWS region.
      #
      # Type: string
      # Required: false
      # Default: ""

      aws_role_name:
      # The name of the role to assume with OIDC.
      #
      # Type: string
      # Required: false
      # Default: ""

      aws_oidc_role_arn:
      # AWS OIDC IAM role to assume
      #
      # Type: string
      # Required: false
      # Default: ""

      gh_checkout_ref:
      # The branch, tag or SHA to checkout.
      #
      # Type: string
      # Required: false
      # Default: ""

      tf_dir:
      # Path to the Terraform root module to apply.
      #
      # Type: string
      # Required: false
      # Default: ""

      tf_backend_configs:
      # List of Terraform backend config values, one per line.
      #
      # Type: string
      # Required: false
      # Default: ""

      tf_backend_config_files:
      # List of Terraform backend config files to use, one per line. Paths should be relative to the GitHub Actions workspace.
      #
      # Type: string
      # Required: false
      # Default: ""

      tf_var_files:
      # List of tfvars files to use, one per line. Paths should be relative to the GitHub Actions workspace.
      #
      # Type: string
      # Required: false
      # Default: ""

      tf_vars:
      # Variables to set for the Terraform plan. This should be valid Terraform syntax.
      #
      # Type: string
      # Required: false
      # Default: ""

      tf_pre_run:
      # Command to run before Terraform is executed.
      #
      # Type: string
      # Required: false
      # Default: ""

Example

FAQ