This template retrieves data for executing a basic ECS task using FARGATE launch type.

Terraform Template

data "aws_ecs_task_execution" "example" {
  cluster = "aws_ecs_cluster.example.id"
  desired_count = 1
  launch_type = "FARGATE"

  network_configuration {
    assign_public_ip = false
    security_groups = ["aws_security_group.example.id"]
    subnets = aws_subnet.example[*].id
  }
  task_definition = "aws_ecs_task_definition.example.arn"
}