Skip to content

Commit

Permalink
Removed cooker code and reset the ecs.tf to remove commets
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLinden committed May 15, 2024
1 parent 7b10581 commit a1c21b0
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 93 deletions.
25 changes: 0 additions & 25 deletions terraform/environments/cooker/macie.tf

This file was deleted.

13 changes: 0 additions & 13 deletions terraform/environments/example/data.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
#### This file can be used to store data specific to the member account ####

# For macie code
data "aws_s3_bucket" "bucket1" {
bucket = "bastion-example-example-development-jxaebg"
}

data "aws_s3_bucket" "bucket2" {
bucket = "config-20220505080423816000000003"
}

data "aws_s3_bucket" "bucket3" {
bucket = "s3-bucket-example20240430100555519600000006"
}
110 changes: 55 additions & 55 deletions terraform/environments/example/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,61 @@
###########################################################################################


# module "ecs-cluster" {
# source = "github.com/ministryofjustice/modernisation-platform-terraform-ecs-cluster//cluster?ref=v4.0.3"

# ec2_capacity_instance_type = local.application_data.accounts[local.environment].container_instance_type
# ec2_capacity_max_size = local.application_data.accounts[local.environment].ec2_max_size
# ec2_capacity_min_size = local.application_data.accounts[local.environment].ec2_min_size
# ec2_capacity_security_group_id = aws_security_group.cluster_ec2.id
# ec2_subnet_ids = [
# data.aws_subnet.private_subnets_a.id,
# data.aws_subnet.private_subnets_b.id,
# data.aws_subnet.private_subnets_c.id
# ]
# environment = local.environment
# name = local.ecs_application_name
# namespace = "platforms"

# tags = local.tags
# }

# module "service" {
# source = "git::https://github.com/ministryofjustice/modernisation-platform-terraform-ecs-cluster//service?ref=v3.0.0"

# container_definition_json = templatefile("${path.module}/templates/task_definition.json.tftpl", {})
# ecs_cluster_arn = module.ecs-cluster.ecs_cluster_arn
# name = "${local.ecs_application_name}-task_definition_volume"
# namespace = "platforms"
# vpc_id = local.vpc_all

# launch_type = local.application_data.accounts[local.environment].launch_type
# network_mode = local.application_data.accounts[local.environment].network_mode

# task_cpu = local.application_data.accounts[local.environment].container_cpu
# task_memory = local.application_data.accounts[local.environment].container_memory

# task_exec_role_arn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${local.ecs_application_name}-ecs-task-execution-role"

# environment = local.environment
# ecs_load_balancers = [
# {
# target_group_arn = aws_lb_target_group.ecs_target_group.arn
# container_name = local.ecs_application_name
# container_port = 80
# }
# ]

# subnet_ids = [
# data.aws_subnet.private_subnets_a.id,
# data.aws_subnet.private_subnets_b.id,
# data.aws_subnet.private_subnets_c.id
# ]

# ignore_changes_task_definition = false

# tags = local.tags
# }
module "ecs-cluster" {
source = "github.com/ministryofjustice/modernisation-platform-terraform-ecs-cluster//cluster?ref=v4.0.3"

ec2_capacity_instance_type = local.application_data.accounts[local.environment].container_instance_type
ec2_capacity_max_size = local.application_data.accounts[local.environment].ec2_max_size
ec2_capacity_min_size = local.application_data.accounts[local.environment].ec2_min_size
ec2_capacity_security_group_id = aws_security_group.cluster_ec2.id
ec2_subnet_ids = [
data.aws_subnet.private_subnets_a.id,
data.aws_subnet.private_subnets_b.id,
data.aws_subnet.private_subnets_c.id
]
environment = local.environment
name = local.ecs_application_name
namespace = "platforms"

tags = local.tags
}

module "service" {
source = "git::https://github.com/ministryofjustice/modernisation-platform-terraform-ecs-cluster//service?ref=v3.0.0"

container_definition_json = templatefile("${path.module}/templates/task_definition.json.tftpl", {})
ecs_cluster_arn = module.ecs-cluster.ecs_cluster_arn
name = "${local.ecs_application_name}-task_definition_volume"
namespace = "platforms"
vpc_id = local.vpc_all

launch_type = local.application_data.accounts[local.environment].launch_type
network_mode = local.application_data.accounts[local.environment].network_mode

task_cpu = local.application_data.accounts[local.environment].container_cpu
task_memory = local.application_data.accounts[local.environment].container_memory

task_exec_role_arn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${local.ecs_application_name}-ecs-task-execution-role"

environment = local.environment
ecs_load_balancers = [
{
target_group_arn = aws_lb_target_group.ecs_target_group.arn
container_name = local.ecs_application_name
container_port = 80
}
]

subnet_ids = [
data.aws_subnet.private_subnets_a.id,
data.aws_subnet.private_subnets_b.id,
data.aws_subnet.private_subnets_c.id
]

ignore_changes_task_definition = false

tags = local.tags
}

locals {
ecs_application_name = "example-app"
Expand Down

0 comments on commit a1c21b0

Please sign in to comment.