Skip to content

Commit

Permalink
Replace secretoptions with scerets (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
SaiPrasannaGopularam authored Nov 30, 2023
1 parent 1c84032 commit 07b6601
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ data "aws_iam_policy_document" "task_execution_role_policy" {
"ecs:ExecuteCommand",
"ecs:DescribeTasks"
]
resources = ["${aws_ecs_task_definition.task.arn}:*"]
resources = [aws_ecs_task_definition.task.arn]
}
}
2 changes: 1 addition & 1 deletion files/container_definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"repositoryCredentials": {
"credentialsParameter": "${docker_secret}"
},
${secrets}
"memory": ${memory},
"cpu": ${cpu},
"essential": true,
Expand All @@ -27,7 +28,6 @@
"volumesFrom": [],
"logConfiguration": {
"logDriver": "awslogs",
${secretsoptions}
"options": {
"awslogs-group": "${awslogs_group}",
"awslogs-region": "${awslogs_region}",
Expand Down
4 changes: 2 additions & 2 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ locals {
}
}

secrets = length(var.secrets) > 0 ? "\"secretOptions\": ${jsonencode(var.secrets)}," : ""
secrets = length(var.secrets) > 0 ? "\"secrets\": ${jsonencode(var.secrets)}," : ""

container_def = templatefile("${path.module}/files/container_definition.json",
{
Expand All @@ -40,7 +40,7 @@ locals {
awslogs_region = data.aws_region.region.name
awslogs_group = aws_cloudwatch_log_group.task.name
awslogs_stream_prefix = var.service_identifier
secretsoptions = local.secrets
secrets = local.secrets
}
)
}

0 comments on commit 07b6601

Please sign in to comment.