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
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Terraform-Plan-Infra-Plan"
on:
push:
branches:
- master
- dev

jobs:
terraform:
Expand All @@ -12,7 +12,7 @@ jobs:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRETE_ID }}
AWS_REGION: 'us-east-1'
AWS_REGION: 'us-west-2'

steps:
- name: Checkout
Expand All @@ -24,11 +24,13 @@ jobs:
- name: Terraform Init
id: init
run: terraform init
env:
TF_WORKSPACE: sandbox

- name: Terraform Plan
id: plan
if: github.event_name == 'push'
run: terraform plan -no-color
- name: Terraform Apply
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: terraform apply -auto-approve
# - name: Terraform Apply
# if: github.ref == 'refs/heads/master' && github.event_name == 'push'
# run: terraform apply -auto-approve
7 changes: 7 additions & 0 deletions environments/production/vpc.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module "vpc" {
source = "../../modules/vpc"
vpc_cidr = var.vpc_cidr
env = var.env
region = var.region
zones = var.zones
}
7 changes: 7 additions & 0 deletions environments/sandbox/vpc.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module "vpc" {
source = "../../modules/vpc"
vpc_cidr = var.vpc_cidr
env = var.env
region = var.region
zones = var.zones
}
2 changes: 1 addition & 1 deletion main.tf → modules/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# VPC
resource "aws_vpc" "default" {
cidr_block = var.vpc_cidr
enable_dns_hostnames = true
enable_dns_hostnames = false

tags = {
Environment = var.env
Expand Down
File renamed without changes.