Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions modules/services/cloud-connector/ecs-service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ resource "aws_ecs_task_definition" "task_definition" {
family = var.name
requires_compatibilities = ["FARGATE"]
network_mode = "awsvpc"
execution_role_arn = aws_iam_role.execution.arn # ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume
task_role_arn = local.ecs_task_role_arn # ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
cpu = var.ecs_task_cpu
memory = var.ecs_task_memory
execution_role_arn = aws_iam_role.execution.arn
# ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume
task_role_arn = local.ecs_task_role_arn
# ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
cpu = var.ecs_task_cpu
memory = var.ecs_task_memory

container_definitions = jsonencode([
{
Expand All @@ -39,9 +41,11 @@ resource "aws_ecs_task_definition" "task_definition" {
valueFrom = var.secure_api_token_secret_name
}
]
portMappings = [{
containerPort = 5000
}]
portMappings = [
{
containerPort = 5000
}
]
logConfiguration = {
logDriver = "awslogs"
options = {
Expand All @@ -64,7 +68,7 @@ locals {
value = tostring(local.verify_ssl)
},
{
name = "telemetryDeploymentMethod"
name = "TELEMETRY_DEPLOYMENT_METHOD"
value = "terraform_aws_ecs_${local.suffix_org}"
},
{
Expand All @@ -75,9 +79,13 @@ locals {
name = "SECURE_URL",
value = data.sysdig_secure_connection.current.secure_url
}
], flatten([for env_key, env_value in var.extra_env_vars : [{
name = env_key,
value = env_value
}]])
], flatten([
for env_key, env_value in var.extra_env_vars : [
{
name = env_key,
value = env_value
}
]
])
)
}