Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nozaq/terraform-deployment-with-environments-example
An example Terraform project demonstrating continuous deployment pipeline using GitHub Actions' environment function.
https://github.com/nozaq/terraform-deployment-with-environments-example
cicd continuous-deployment devops github-actions terraform
Last synced: about 2 months ago
JSON representation
An example Terraform project demonstrating continuous deployment pipeline using GitHub Actions' environment function.
- Host: GitHub
- URL: https://github.com/nozaq/terraform-deployment-with-environments-example
- Owner: nozaq
- License: mit
- Created: 2022-06-11T21:36:18.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T07:52:49.000Z (3 months ago)
- Last Synced: 2024-10-06T01:41:27.238Z (3 months ago)
- Topics: cicd, continuous-deployment, devops, github-actions, terraform
- Language: HCL
- Homepage: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
- Size: 27.3 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# terraform-deployment-with-environments-example
An example Terraform project demonstrating continuous deployment pipeline using GitHub Actions' environment function.
## Overview
- Deployment workflow runs every time `main` branch is updated. It first runs `terraform plan` and require a manual approval. `terraform apply` will be executed when the job is approved.
- Preview workflow runs `terraform plan` for each pull request and comment the plan result. The comment is updated when new commits are added to the pull request.## Prerequisites
- Create two environments `production` and `production-readonly`.
- Set required reviewers to `production` environment.
- Associate credentials which has sufficient permissions to run `terraform plan` to `production-readonly` environment.
- Associate credentials which has sufficient permissions to run `terraform apply` to `production` environment.
- Terraform project is assumed to have [a non-local backend](https://www.terraform.io/cdktf/concepts/remote-backends) to host state files.## References
- [Using environments for deployment | GitHub Docs](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment)
- [Backend Overview | Terraform](https://www.terraform.io/language/settings/backends)