Skip to content

Commit

Permalink
update production/staging environments
Browse files Browse the repository at this point in the history
  • Loading branch information
fideloper committed Sep 21, 2021
1 parent 9bd580c commit 2a6df3e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 12 deletions.
24 changes: 18 additions & 6 deletions production/main.tf
Expand Up @@ -76,11 +76,15 @@ data "aws_ami" "app" {
owners = ["self"]
}

data "aws_s3_bucket" "artifact_bucket" {
bucket = "cloudcasts-artifacts"
}

###
# Resources
##
module "vpc" {
asource = "../modules/vpc"
source = "../modules/vpc"

infra_env = var.infra_env
vpc_cidr = "10.0.0.0/17"
Expand All @@ -90,7 +94,7 @@ module "vpc" {
}

module "autoscale_web" {
asource = "../modules/ec2"
source = "../modules/ec2"

ami = data.aws_ami.app.id
git_url = var.git_url
Expand All @@ -104,11 +108,15 @@ module "autoscale_web" {
alb_subnets = module.vpc.vpc_public_subnets
vpc_id = module.vpc.vpc_id

artifact_bucket = module.ci_cd.artifact_bucket
min_size = 0
max_size = 5
desired_capacity = 2

artifact_bucket = data.aws_s3_bucket.artifact_bucket.arn
}

module "autoscale_queue" {
asource = "../modules/ec2"
source = "../modules/ec2"

ami = data.aws_ami.app.id
git_url = var.git_url
Expand All @@ -121,11 +129,15 @@ module "autoscale_queue" {
asg_subnets = module.vpc.vpc_private_subnets
vpc_id = module.vpc.vpc_id

artifact_bucket = module.ci_cd.artifact_bucket
min_size = 0
max_size = 5
desired_capacity = 2

artifact_bucket = data.aws_s3_bucket.artifact_bucket.arn
}

module "deploy_app" {
asource = "../modules/codedeploy"
source = "../modules/codedeploy"

infra_env = var.infra_env
deploy_groups = {
Expand Down
24 changes: 18 additions & 6 deletions staging/main.tf
Expand Up @@ -76,11 +76,15 @@ data "aws_ami" "app" {
owners = ["self"]
}

data "aws_s3_bucket" "artifact_bucket" {
bucket = "cloudcasts-artifacts"
}

###
# Resources
##
module "vpc" {
asource = "../modules/vpc"
source = "../modules/vpc"

infra_env = var.infra_env
vpc_cidr = "10.0.0.0/17"
Expand All @@ -90,7 +94,7 @@ module "vpc" {
}

module "autoscale_web" {
asource = "../modules/ec2"
source = "../modules/ec2"

ami = data.aws_ami.app.id
git_url = var.git_url
Expand All @@ -104,11 +108,15 @@ module "autoscale_web" {
alb_subnets = module.vpc.vpc_public_subnets
vpc_id = module.vpc.vpc_id

artifact_bucket = module.ci_cd.artifact_bucket
min_size = 0
max_size = 2
desired_capacity = 2

artifact_bucket = data.aws_s3_bucket.artifact_bucket.arn
}

module "autoscale_queue" {
asource = "../modules/ec2"
source = "../modules/ec2"

ami = data.aws_ami.app.id
git_url = var.git_url
Expand All @@ -121,11 +129,15 @@ module "autoscale_queue" {
asg_subnets = module.vpc.vpc_private_subnets
vpc_id = module.vpc.vpc_id

artifact_bucket = module.ci_cd.artifact_bucket
min_size = 0
max_size = 2
desired_capacity = 2

artifact_bucket = data.aws_s3_bucket.artifact_bucket.arn
}

module "deploy_app" {
asource = "../modules/codedeploy"
source = "../modules/codedeploy"

infra_env = var.infra_env
deploy_groups = {
Expand Down

0 comments on commit 2a6df3e

Please sign in to comment.