Chambras / terraform-github-actions-demo

HashiCorp Terraform Github Actions Demo for Github Satellite 2020.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terraform Github Actions Demo

This repository contains Terraform configuration and Github Action workflow for Collaborative application and infrastructure workflow using GitHub Actions and HashiCorp Terraform talk at Github Satellite 2020.

Overview

Overview

Prerequisites

  • HashiCorp Terraform installed. (version: > 0.12.x)
  • AWS Account.
  • Cloudflare Account.

Optional

Terraform cloud can be used to store remote state. If you want to use the Terraform cloud remote state backend you can uncomment the code in remote.tf file.

You can generate a user api token using the guide: https://www.terraform.io/docs/cloud/users-teams-organizations/users.html#api-tokens

Configure AWS authentication

export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""

Configure Terraform variables

export TF_VAR_cloudflare_email="hello@example.com"
export TF_VAR_cloudflare_api_token="abcdxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export TF_VAR_cloudflare_zone_id="a1b2xxxxxxxxxxxxxxxxxxxxxxxxxxx"

Usage

Clone the github repository

git clone https://github.com/anubhavmishra/terraform-github-actions-demo.git

Open the terraform-github-actions-demo directory.

cd terraform-github-actions-demo

Run Terraform init.

terraform init

Run Terraform plan.

terraform plan

Run Terraform apply.

terraform apply

About

HashiCorp Terraform Github Actions Demo for Github Satellite 2020.

License:Mozilla Public License 2.0


Languages

Language:HTML 85.0%Language:HCL 15.0%