Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/tf_plan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

name: 'Terraform Plan & Apply'

on:
push:
branches: [ "test" ]
pull_request:

jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest

steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3

- name: Configure AWS Credentials Action For GitHub Actions
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Setup Terraform CLI
uses: hashicorp/setup-terraform@v2.0.2


- name: Terraform Init & Dry Apply
run: |
cd dev-resources
echo "** Running Terraform Init**"
terraform init

echo "** Running Terraform Validate**"
terraform validate

echo "** Running Terraform Plan**"
terraform plan

echo "** Running Terraform Dry Apply**"
terraform apply -auto-approve --dry-run
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.DS_Store

# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log

# Kitchen files
**/inspec.lock
**/.kitchen
**/.kitchen.local.yml
**/Gemfile.lock

# Ignore any .tfvars files that are generated automatically for each Terraform
# run. Most .tfvars files are managed as part of configuration and so should be
# included in version control.
#
# example.tfvars
**/terraform.tfvars
6 changes: 6 additions & 0 deletions dev-resources/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
terraform {
backend "s3" {
bucket = "iac-devops-playground"
region = "us-east-1"
}
}
3 changes: 3 additions & 0 deletions dev-resources/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module "dev_load_balancer" {
source = "./AWS Module/Load Balancer"
}
3 changes: 3 additions & 0 deletions dev-resources/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
provider "aws" {
region = "us-east-1"
}