diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa8a5e5..84239cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: "Terraform-Plan-Infra-Plan" on: push: branches: - - master + - dev jobs: terraform: @@ -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 @@ -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 \ No newline at end of file + # - name: Terraform Apply + # if: github.ref == 'refs/heads/master' && github.event_name == 'push' + # run: terraform apply -auto-approve \ No newline at end of file diff --git a/environments/production/vpc.tf b/environments/production/vpc.tf new file mode 100644 index 0000000..5ba3782 --- /dev/null +++ b/environments/production/vpc.tf @@ -0,0 +1,7 @@ +module "vpc" { + source = "../../modules/vpc" + vpc_cidr = var.vpc_cidr + env = var.env + region = var.region + zones = var.zones +} diff --git a/environments/sandbox/vpc.tf b/environments/sandbox/vpc.tf new file mode 100644 index 0000000..5ba3782 --- /dev/null +++ b/environments/sandbox/vpc.tf @@ -0,0 +1,7 @@ +module "vpc" { + source = "../../modules/vpc" + vpc_cidr = var.vpc_cidr + env = var.env + region = var.region + zones = var.zones +} diff --git a/main.tf b/modules/vpc/main.tf similarity index 99% rename from main.tf rename to modules/vpc/main.tf index ce1d93a..341708f 100644 --- a/main.tf +++ b/modules/vpc/main.tf @@ -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 diff --git a/variables.tf b/modules/vpc/variables.tf similarity index 100% rename from variables.tf rename to modules/vpc/variables.tf