jbergknoff / terraform-plan-approval

Helper for approving Terraform plans in GitHub Actions
MIT License
2 stars 1 forks source link

terraform-plan-approval

This is the codebase powering https://terraform-plan-approval.herokuapp.com/.

As of August 2020, GitHub Actions has no support for prompting a user for input. When running Terraform, that's a deal breaker: the ability to review and approve/reject plans is critical. This web app is a hacky workaround to make GitHub Actions usable for this Terraform use case. It's only intended for demonstration purposes. Please don't use this for anything real.

We can POST a plan to the service, and the service will then serve a page with the plan and approve/reject buttons. The service has an endpoint where we can check the status of the plan (pending/rejected/approved). We'll poll that status endpoint, waiting for the plan to be approved or rejected by a human, and then our workflow can proceed.

Approval prompt

There is no authentication or authorization. The Heroku-hosted version of this should not be used in any important setting. Feel free to fork this and/or stand it up in a private network for internal use, though. The data is stored ephemerally in Redis.

The jbergknoff/github-action-wait-for-terraform-plan-approval GitHub Action (Marketplace) helps you use this service in a workflow.

Usage

Here's how to use this:

Development

Developing in this project requires Docker and GNU Make. Refer to the Makefile for the full set of targets, but here's a summary:

Deployment

Deploys to Heroku (https://terraform-plan-approval.herokuapp.com/) upon passing build of the master branch.