title: Is AWS ECS with Terraform broken?
body: <p>I am trying to spin up an ECS cluster with Terraform, but can not make EC2 instances register as container instances in the cluster. </p>
  
  <p>I first tried with the verified module from <a href="https://github.com/terraform-aws-modules/terraform-aws-ecs/tree/master/examples/complete-ecs" rel="nofollow noreferrer">Terraform</a>, but this seems out dated (ecs-instance-profile has wrong path).</p>
  
  <p>Then I tried with <a href="https://github.com/anrim/terraform-aws-ecs" rel="nofollow noreferrer">another module</a> from <em>anrim</em>, but still no container instances. Here is the script I used:</p>
  
  <pre><code>provider "aws" {
    region = "us-east-1"
  }
  
  module "vpc" {
    source  = "terraform-aws-modules/vpc/aws"
    version = "2.21.0"
  
    name               = "ecs-alb-single-svc"
    cidr               = "10.10.10.0/24"
    azs                = ["us-east-1a", "us-east-1b", "us-east-1c"]
    private_subnets    = ["10.10.10.0/27", "10.10.10.32/27", "10.10.10.64/27"]
    public_subnets     = ["10.10.10.96/27", "10.10.10.128/27", "10.10.10.160/27"]
  
    tags = {
      Owner       = "user"
      Environment = "me"
    }
  }
  
  module "ecs_cluster" {
    source = "../../modules/cluster"
  
    name        = "ecs-alb-single-svc"
    vpc_id      = module.vpc.vpc_id
    vpc_subnets = module.vpc.private_subnets
  
    tags = {
      Owner       = "user"
      Environment = "me"
    }
  }
  </code></pre>
  
  <p>I then created a new ecs cluster (from the aws console) on the same VPC and carefully compared the differences in resources. I managed to find some small differences, fixed them and tried again. But still no container instances!</p>
  
  <p>A fork of the module is available <a href="https://github.com/mlundela/terraform-aws-ecs-1" rel="nofollow noreferrer">here</a>.</p>