How to deal with ECS and EC2?

What is the right way to deal with ECS?

One way:
Create cluster that create EC2 instance?

Another way
Create EC2 instance then install docker inside then connect with the ECS using IAMRole?