Skip to content

Commit

Permalink
working modules
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharth-singh1 committed Dec 6, 2024
1 parent b38abba commit 80f916f
Show file tree
Hide file tree
Showing 29 changed files with 464 additions and 846 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/aws/ecs/${cluster_name_full}/${service_name_full}",
"awslogs-group": "${log_group_name}",
"awslogs-region": "${aws_region}",
"awslogs-stream-prefix": "proxy"
"awslogs-stream-prefix" : "ecs"
}
}
}
Expand Down
55 changes: 30 additions & 25 deletions example/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ terraform {
}
}

provider "aws" {
region = "us-east-1"
}

################################################################################
## ecs cluster
################################################################################

module "ecs" {
source = "../modules/ecs"

create = true
module "ecs-cluster" {
source = "../../modules/ecs-cluster"

ecs_cluster = {
name = "arc-ecs-module-poc"
Expand All @@ -37,14 +39,11 @@ module "ecs" {
}

capacity_provider = {
autoscaling_capacity_providers = {}
autoscaling_capacity_providers = {}
default_capacity_provider_use_fargate = true
fargate_capacity_providers = {
fargate_cp = {
name = "FARGATE"
tags = {
Environment = "develop"
}
}
}
}
Expand All @@ -62,7 +61,7 @@ module "ecs" {
module "alb" {
source = "../../modules/alb"

vpc_id = "vpc-12345"
vpc_id = "vpc-123445"

alb = {
name = "arc-poc-alb"
Expand All @@ -71,10 +70,11 @@ module "alb" {
}

alb_target_group = [{
name = "arc-poc-alb-tg"
port = 80
protocol = "HTTP"
vpc_id = "vpc-12345"
name = "arc-poc-alb-tg"
port = 80
protocol = "HTTP"
vpc_id = "vpc-123445"
target_type = "ip"
health_check = {
enabled = true
path = "/"
Expand All @@ -86,30 +86,35 @@ module "alb" {


################################################################################
## health check service
## ecs service
################################################################################

module "health-check" {
source = "../../modules/health-check"
module "ecs-service" {
source = "../../modules/ecs-service"

vpc_id = "vpc-12345"
vpc_id = "vpc-123445"
environment = "develop"

ecs = {
cluster_name = module.ecs.ecs_cluster.name
service_name = "arc-ecs-module-service-poc"
repository_name = "12345.dkr.ecr.us-east-1.amazonaws.com/arc/arc-poc-ecs"
enable_load_balancer = false
cluster_name = module.ecs-cluster.ecs_cluster.name
service_name = "arc-ecs-module-service-poc"
repository_name = "23112.dkr.ecr.us-east-1.amazonaws.com/arc/arc-poc-ecs"
enable_load_balancer = false
aws_lb_target_group_name = "arc-poc-alb-tg"
}

task = {
container_port = 8100
tasks_desired = 1
container_port = 8100
container_memory = 1024
container_vcpu = 256
container_definition = "container/container_definition.json.tftpl"
}

alb = {
name = module.alb.name
name = module.alb.alb.name
listener_port = 8100
security_group_id = ""
security_group_id = module.alb.alb_security_group_id
}
depends_on = [ module.alb ]
depends_on = [module.alb]
}
20 changes: 2 additions & 18 deletions example/ecs-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,11 @@ terraform {
}
}

module "tags" {
source = "sourcefuse/arc-tags/aws"
version = "1.2.3"
environment = var.environment
project = "Example"

extra_tags = {
RepoName = "terraform-aws-refarch-ecs"
Example = "true"
}
}

provider "aws" {
region = var.region
}

################################################################################
## ecs
################################################################################
module "ecs" {
source = "../modules/ecs"
module "ecs-cluster" {
source = "../modules/ecs-cluster"

create = true

Expand Down
68 changes: 0 additions & 68 deletions example/ecs-cluster/variables.tf

This file was deleted.

25 changes: 25 additions & 0 deletions example/ecs-service/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ terraform {
}
}

module "health-check" {
source = "../../modules/health-check"
module "ecs-service" {
source = "../../modules/ecs-service"

vpc_id = "vpc-0e6c09980580ecbf6"
vpc_id = "vpc-12345"
environment = "develop"
aws_region = "us-east-1"

ecs = {
cluster_name = "arc-ecs-module-poc"
service_name = "arc-ecs-module-service-poc"
repository_name = "884360309640.dkr.ecr.us-east-1.amazonaws.com/arc/arc-poc-ecs"
repository_name = "12345.dkr.ecr.us-east-1.amazonaws.com/arc/arc-poc-ecs"
enable_load_balancer = false
}

Expand Down
29 changes: 0 additions & 29 deletions iam.tf

This file was deleted.

74 changes: 0 additions & 74 deletions locals.tf

This file was deleted.

Loading

0 comments on commit 80f916f

Please sign in to comment.