Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

osinfra-io/github-kitchen-terraform-action

Kitchen-Terraform Github Action

Warning

With the announcement of a native test framework with Terraform 1.6 and the announcement of deprecating Kitchen-Terraform we have archived this repository.

GitHub Actions:

Dependabot CodeQL Docker Build and Push

Kitchen-Terraform provides a set of Kitchen plugins that enable the use of Kitchen to converge a Terraform configuration and verify the resulting infrastructure systems with InSpec controls.

Inputs

kitchen-command

Required The name of the command to run. Default "help".

More Examples:

  converge [INSTANCE|REGEXP|all]    # Change instance state to converge. Use a provisioner to configure...
  create [INSTANCE|REGEXP|all]      # Change instance state to create. Start one or more instances
  destroy [INSTANCE|REGEXP|all]     # Change instance state to destroy. Delete all information for one ...
  help [COMMAND]                    # Describe available commands or one specific command
  test [INSTANCE|REGEXP|all]        # Test (destroy, create, converge, setup, verify and destroy) one o...
  verify [INSTANCE|REGEXP|all]      # Change instance state to verify. Run automated tests on one or mo...
  version                           # Print Kitchen's version information

kitchen-instance

Optional The name of the instance to run the command on. You can run kitchen list to see the available instances.

This is useful when you have multiple instances in your .kitchen.yml file and you want to run the command on a specific instance for example if you need to destroy a specific instance when dealing with more complex test scenarios.

Example usage

- name: Kitchen Converge
  uses: osinfra-io/github-kitchen-terraform-action@v2.5.0
  with:
    kitchen-command: "converge"
- name: Kitchen Destroy
  uses: osinfra-io/github-kitchen-terraform-action@v2.5.0
  with:
    kitchen-command: "destroy"
    kitchen-instance: "default-test-gcp"

An example called workflow can be found here.