All Projects → WahlNetwork → github-action-terraform

WahlNetwork / github-action-terraform

Licence: MIT license
An example of Continuous Integration with GitHub Actions and HashiCorp Terraform

Programming Languages

HCL
1544 projects

Projects that are alternatives of or similar to github-action-terraform

apparmor
Development repository for the apparmor cookbook
Stars: ✭ 13 (-43.48%)
Mutual labels:  managed-by-terraform
yum-epel
Development repository for the yum-epel cookbook
Stars: ✭ 23 (+0%)
Mutual labels:  managed-by-terraform
memcached
Development repository for the memcached cookbook
Stars: ✭ 50 (+117.39%)
Mutual labels:  managed-by-terraform
certified-kubernetes-administrator-cka-exam
Resources to prepare for the Certified Kubernetes Administrator exam
Stars: ✭ 140 (+508.7%)
Mutual labels:  managed-by-terraform
samba
Development repository for the samba cookbook
Stars: ✭ 30 (+30.43%)
Mutual labels:  managed-by-terraform
freebsd
Development repository for the freebsd cookbook
Stars: ✭ 27 (+17.39%)
Mutual labels:  managed-by-terraform
reprepro
Development repository for the reprepro cookbook
Stars: ✭ 11 (-52.17%)
Mutual labels:  managed-by-terraform
busser-serverspec
A Busser runner plugin for the serverspec testing library
Stars: ✭ 51 (+121.74%)
Mutual labels:  managed-by-terraform
app-stores-prometheus-exporter
Prometheus exporter that exports metrics (score, ratings, reviews, app version, etc.) from the Apple App Store and Google Play Store
Stars: ✭ 80 (+247.83%)
Mutual labels:  managed-by-terraform
selinux
Development repository for the selinux cookbook
Stars: ✭ 57 (+147.83%)
Mutual labels:  managed-by-terraform
dokken-images
Minimal Docker Images for testing
Stars: ✭ 20 (-13.04%)
Mutual labels:  managed-by-terraform
rust-eventsource-client
Server-sent events (SSE) client implementation for Rust
Stars: ✭ 24 (+4.35%)
Mutual labels:  managed-by-terraform
sssd ldap
Development repository for the sssd_ldap cookbook
Stars: ✭ 17 (-26.09%)
Mutual labels:  managed-by-terraform
busser-rspec
Run RSpec tests through busser
Stars: ✭ 12 (-47.83%)
Mutual labels:  managed-by-terraform
confluence
Development repository for the confluence cookbook
Stars: ✭ 42 (+82.61%)
Mutual labels:  managed-by-terraform
vagrant
Development repository for the vagrant cookbook
Stars: ✭ 54 (+134.78%)
Mutual labels:  managed-by-terraform
github
Development repository for the github cookbook
Stars: ✭ 22 (-4.35%)
Mutual labels:  managed-by-terraform
kitchen-google
Google Compute Engine driver for Test-Kitchen
Stars: ✭ 47 (+104.35%)
Mutual labels:  managed-by-terraform
firewall
Development repository for the firewall cookbook
Stars: ✭ 97 (+321.74%)
Mutual labels:  managed-by-terraform
drbd
Development repository for the drbd cookbook
Stars: ✭ 19 (-17.39%)
Mutual labels:  managed-by-terraform

Continuous Integration with GitHub Actions and HashiCorp Terraform

Based on this blog post

Overview

In this scenario, continuous integration of an AWS environment is desired. Configuration is managed via HashiCorp Terraform. Continuous Integration is managed via GitHub Actions. By loading the necessary Terraform configuration files into this repository along with two GitHub Workflows, the Terraform files can be used to Plan and Apply into the target environment.

NOTE: GitHub Actions are disabled for this repository to prevent abuse. You can view previous runs here.

Details

This repository contains two GitHub Workflow files:

Terraform Plan

  • Checks the Terraform configuration for security vulnerabilities with tfsec.

  • Constructs AWS credentials using a Secrets stored in this repository.

  • Loads the Terraform CLI wrapper with Setup Terraform

  • Terraform CLI performs an Init and Plan based on the pull request's configuration.

  • GitHub Actions Bot adds a comment to the pull request with the results. Example: Pull Request 1

You can view pervious Terraform Plan workflows here.

Terraform Apply

  • Constructs AWS credentials using a Secrets stored in this repository.

  • Loads the Terraform CLI wrapper with Setup Terraform

  • Terraform CLI performs an Init and Apply based on the new push configuration.

You can view pervious Terraform Apply workflows here.

Credentials

Credentials should be stored in the user\.aws\credential file using Secrets stored in this repository.

Example:

mkdir -p ~/.aws
echo "[default]" > ~/.aws/credentials
echo "aws_access_key_id = ${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials
echo "aws_secret_access_key = ${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].