my-ecs-sgthat we’ll use.
my-clusterand the ec2 instance that belongs to the ECS Cluster. Use the
my-ecs-sgsecurity group that was created. You can get the id of the security group from the EC2 Console / Network & Security / Security Groups. It is important to select a Key pair so you can ssh into the instance later to verify things are working.
my-clusterECS cluster. You can confirm it by clicking on the ECS Instances tab under Clusters / my-cluster.
my-elband select internet-facing.
my-elb-sgand open up port 80 and source 0.0.0.0/0 so anything from the outside world can access the ELB port 80.
my-target-groupwith port 80.
my-elb-sggroup port 80 to the world. We also need to make sure that the
my-ecs-sgsecurity group associated with the instance we launched in step 1 allows traffic from the ELB. We created the
my-ecs-sggroup in step 1 at the very beginning of this tutorial. To allow all ELB traffic to hit the container instance run the following:
my-ecs-groupgroup is allowed. This a nice simple setup.
ecs-service.jsonfile with the following:
my-target-groupis showing and maintaining healthy targets. Under Load Balancing / Target Groups, click on
my-target-groupand check the Targets tab. You should see a Target that is reporting healthy.
my-ecs-sgsecurity group is allowing all traffic from the
my-elb-sgsecurity group. This was done in Step 4 with the
authorized-security-group-ingresscommand after you created the ELB.