Giter Club home page Giter Club logo

terraform-all-in-one's Introduction

terraform-all-in-one

Semantic Release

Run common Terraform commands in a single GitHub action

Usage

name: Deploy
on:
  push:
    branches: ["main"]
  pull_request:
    branches: ["main"]

permissions:
  contents: read

jobs:
  deploy:
    name: Deploy And Destroy
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Deploy With Value 1
        uses: "infinite-automations/[email protected]"
        with:
          directory: "./terraform"
          apply: true
        env:
          TF_VAR_my_var: "value1"
      - name: Run Test 1
        run: |
          echo "Running test 1..."
      - name: Deploy With Value 2
        uses: "infinite-automations/[email protected]"
        with:
          directory: "./terraform"
          apply: true
        env:
          TF_VAR_my_var: "value2"
      - name: Run Test 2
        uses: "infinite-automations/[email protected]"
        with:
          directory: "./terraform"
          test-directory: "./terraform"
          format: false
          validate: false
          plan: false
          test: true
      - name: Destroy
        uses: "infinite-automations/[email protected]"
        with:
          directory: "./terraform"
          setup: false
          init: false
          format: false
          validate: false
          plan: false
          apply: false
          destroy: true

You can configure additional command arguments with inputs.

Inputs

Input Name Description Required Default
directory The directory where the Terraform configuration files are located false .
test-directory The directory where the Terraform test configuration files are located false .
terraform-version The version of Terraform to use false latest
plan-file The path to the plan file false plan.json
common-args The arguments to pass to all terraform commands false
init-args The arguments to pass to terraform init false
validate-args The arguments to pass to terraform validate false
fmt-args The arguments to pass to terraform fmt false -check
test-args The arguments to pass to terraform test false
plan-args The arguments to pass to terraform plan false
apply-args The arguments to pass to terraform apply false
destroy-args The arguments to pass to terraform destroy false
setup Whether to setup false true
init Whether to init false true
format Whether to format false true
validate Whether to validate false true
test Whether to test false false
plan Whether to plan false true
apply Whether to apply false false
destroy Whether to destroy false false

Outputs

Output Name Description Value
output-json JSON formatted terraform output ${{ steps.apply.outputs.output-json }}

Changelog

See the Changelog file for details

terraform-all-in-one's People

Contributors

semantic-release-bot avatar m4s-b3n avatar kaiehrhardt avatar dependabot[bot] avatar

Stargazers

 avatar Sujith Quintelier avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.