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

Feature Request: Support for runtimePlatform #153

Closed fdobrovolny closed 1 year ago

fdobrovolny commented 2 years ago

Describe the Feature

I would like to be able to specify runtimePlatform to use arm64 arch in fargate tasks.

Expected Behavior

I'm able to optionally set a map parameter runtimePlatform.

Use Case

https://docs.aws.amazon.com/AmazonECS/latest/userguide/ecs-arm64.html

Additional Context

https://docs.aws.amazon.com/AmazonECS/latest/userguide/task_definition_parameters.html#runtime-platform

obataku commented 2 years ago

as you noted, runtimePlatform is defined at the task definition level, not in the container definitions themselves https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TaskDefinition.html#ECS-Type-TaskDefinition-runtimePlatform

example configuring it on an aws_ecs_task_definition resource here: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_task_definition#example-using-runtime_platform-and-fargate

resource "aws_ecs_task_definition" "test" {
 ...
 container_definitions    = <...>

 runtime_platform {
   operating_system_family = "WINDOWS_SERVER_2019_CORE"
   cpu_architecture        = "X86_64"
 }
}

suggest to close this PR