Merge branch 'main' into feature/test-filters

This commit is contained in:
sid palas
2021-05-27 16:59:25 -07:00
3 changed files with 29 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ jobs:
- name: Terraform Apply Global
if: github.event_name == 'push'
# working-directory: 07-managing-multiple-environments/file-structure/global
working-directory: 07-managing-multiple-environments/file-structure/global
run: |
echo $PWD
terraform init
@@ -95,7 +95,6 @@ jobs:
- name: Terraform Apply Staging
if: steps.check-tag.outputs.environment == 'staging' && github.event_name == 'push'
# working-directory: 07-managing-multiple-environments/file-structure/staging
run: terraform apply -var db_pass=${{secrets.DB_PASS }} -auto-approve
- name: Terraform Apply Production

View File

@@ -0,0 +1,27 @@
terraform {
# Assumes s3 bucket and dynamo DB table already set up
# See /code/03-basics/aws-backend
backend "s3" {
bucket = "devops-directive-tf-state"
key = "07-managing-multiple-environments/global/terraform.tfstate"
region = "us-east-1"
dynamodb_table = "terraform-state-locking"
encrypt = true
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
# Route53 zone is shared across staging and production
resource "aws_route53_zone" "primary" {
name = "mysuperawesomesite.com"
}

View File

@@ -39,7 +39,7 @@ module "web_app" {
domain = "mysuperawesomesite.com"
environment_name = local.environment_name
instance_type = "t2.small"
create_dns_zone = true
create_dns_zone = false
db_name = "${local.environment_name}mydb"
db_user = "foo"
db_pass = var.db_pass