Search code examples
amazon-web-servicesaws-cloudformationamazon-ecs

AWS ECS cluster is not showing container


I am trying to create an ECS cluster(using cloudformation template), where i can create an instance installed with an provided AMI through Yaml file But the problem i am facing -

In Yaml file -

I am creating a cluster then creating a service and task with minimum required values

The cluster is creating service is also creating but I can't see any Container instance there.

How can I be able to see container instance, what kind of changes/modifications I need to make in my YAML file?

enter image description here


Solution

  • ECS is amazon manage service you donot have any type of access to underlying resources.

    ECS also known as fargate and in that task is there it & not create container instances.

    there is total two launch type in ECS where

    • ECS fargate launch type
    • EC2 launch type

    in second launch type ec2 only it create container instance and you can watch it in ec2 section while with fargate you have to manage it as task defination

    Launch type definition documentation : https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html

    you can read more here : https://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html

    For EC2 launch type your cluster type will be same

    Type: AWS::ECS::Cluster

    But SG, VPC,NATGateway and other resources will change

    EcsHostSecurityGroup:
        Type: AWS::EC2::SecurityGroup
        Properties:
          GroupDescription: Access to the ECS hosts that run containers
          VpcId: !Ref 'VPC'