Skip to content

Instantly share code, notes, and snippets.

@mikeatlas
Created April 3, 2023 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeatlas/5336f323297391a0bb1b47b0b620e2cc to your computer and use it in GitHub Desktop.
Save mikeatlas/5336f323297391a0bb1b47b0b620e2cc to your computer and use it in GitHub Desktop.
terraform template for applying a task
resource "aws_ecs_task_definition" "user_code_task_def" {
family = local.user_code_family
container_definitions = jsonencode([
{
"name" : "${local.user_code_family}",
"image" : "${local.ecr_repo_image_path}:${local.latest_user_code_tag}",
"portMappings" : [
{
"hostPort" : 8001,
"protocol" : "tcp",
"containerPort" : 8001
}
],
"environment" : [
{
"name" : "DAGSTER_CURRENT_IMAGE",
"value" : "${local.ecr_repo_image_path}:${local.latest_user_code_tag}"
},
{ "name" : "DAGSTER_DEPLOYMENT",
"value" : "${var.env_short_name}",
},
{
"name" : "DAGSTER_PIPELINE_TASK_ROLE_ARN",
"value" : "${aws_iam_role.user_code_task.arn}",
},
],
"logConfiguration" : {
"logDriver" : "awslogs",
"secretOptions" : [],
"options" : {
"awslogs-group" : "${aws_cloudwatch_log_group.user_code_cw_log_group.name}",
"awslogs-region" : "${var.aws_region}",
"awslogs-stream-prefix" : "${var.log_stream_prefix}"
}
},
"essential" : true
}
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment