cloudposse / terraform-aws-ecs-container-definition

Terraform module to generate well-formed JSON documents (container definitions) that are passed to the aws_ecs_task_definition Terraform resource
https://cloudposse.com/accelerate
Apache License 2.0
340 stars 245 forks source link

task definition volume #142

Closed ghost closed 3 years ago

ghost commented 3 years ago

what

volume argument not supported in task definition

why

I need to mount my container on task definition volume to support lookup on docker Labels

references

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_task_definition#volume

Gowiem commented 3 years ago

/test all

nitrocode commented 3 years ago

Thank you for your contribution.

This repo will only give you the container definition

e.g.

module "container_definition" {
  source  = "cloudposse/ecs-container-definition/aws"
  version = "0.58.0"

  container_name  = "name"
  container_image = "cloudposse/geodesic"
}

resource "aws_ecs_task_definition" "service" {
  container_definitions = jsonencode([
    module.container_definition.json_map_object
  ])

  volume {
    name      = "service-storage"
    host_path = "/ecs/service-storage"
  }
}

You may be looking for https://github.com/cloudposse/terraform-aws-ecs-alb-service-task#input_volumes

ghost commented 3 years ago

That you guys that make sense to me.