Skip to content

Commit

Permalink
Merge pull request #27 from aodn/allow_existing_cluster
Browse files Browse the repository at this point in the history
refactor: allow specifying an existing cluster
  • Loading branch information
digorgonzola authored Dec 15, 2023
2 parents 6d96526 + 036f9d0 commit 7de7f31
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 195 deletions.
26 changes: 26 additions & 0 deletions deploy/tf/cluster.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module "cluster" {
source = "terraform-aws-modules/ecs/aws//modules/cluster"
version = "~> 5.7.0"

create = var.create_cluster ? true : false

# Cluster Configuration
cluster_name = "${var.app_name}-${var.environment}"
cluster_configuration = {
name = "containerInsights"
value = "enabled"
}
create_task_exec_iam_role = true
fargate_capacity_providers = {
FARGATE = {
default_capacity_provider_strategy = {
weight = 50
}
}
FARGATE_SPOT = {
default_capacity_provider_strategy = {
weight = 50
}
}
}
}
191 changes: 0 additions & 191 deletions deploy/tf/ecs.tf

This file was deleted.

8 changes: 6 additions & 2 deletions deploy/tf/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ output "buckets" {
value = module.s3.wrapper
}

output "ecs" {
value = module.ecs
output "cluster" {
value = module.cluster
}

output "service" {
value = module.service
}
Loading

0 comments on commit 7de7f31

Please sign in to comment.