项目作者: sukhchander

项目描述 :
ecs-demo
高级语言: Shell
项目地址: git://github.com/sukhchander/ecs-demo.git
创建时间: 2016-08-25T19:35:19Z
项目社区:https://github.com/sukhchander/ecs-demo

开源协议:

下载


AWS ECS Demo

Requirements

Clone

  1. git clone https://github.com/sukhchander/ecs-demo
  2. cd ecs-demo

AWS CLI

Ensure AWS CLI is set to use a region where Amazon ECS is available ie:
(us-east-1, us-west1, us-west-2)

view:

  1. aws configure list

modify:

  1. aws configure

Setup and Configuration

Run the following command:

  1. ./setup.sh

Output:

  1. Creating ECS cluster (ecs-demo-cluster) ...
  2. Creating VPC (ecs-demo-vpc) ...
  3. Creating Subnet (ecs-demo-subnet) ...
  4. Creating Internet Gateway (ecs-demo) ...
  5. Creating Security Group (ecs-demo) ...
  6. Creating Key Pair (ecs-demo-key.pem) ...
  7. Creating IAM role (ecs-role) ...
  8. Creating Launch Configuration (ecs-launch-configuration) ...
  9. Creating Auto Scaling Group (ecs-demo-group) with 3 instances ...
  10. Waiting for instances to join the cluster (this may take a moment) ...
  11. Registering ECS Task Definition (ecs-demo-task) ...
  12. Creating ECS Service with 3 tasks (ecs-demo-service) ...
  13. Waiting for tasks to start running ...
  14. ECS cluster contains:
  15. http://ec2-52-43-201-147.us-west-2.compute.amazonaws.com
  16. http://ec2-52-43-162-49.us-west-2.compute.amazonaws.com
  17. http://ec2-52-38-20-31.us-west-2.compute.amazonaws.com
  18. ECS cluster launched ...

Result

setup.sh:

  • Created an Amazon ECS cluster
  • Spawned 3 EC2 instances that are now part of the ECS cluster
  • Created an ECS task family that describes the HTTP Server and API containers

Verify

Navigate to one of 3 instances (response is from HTTP Server container):

  1. launchy http://ec2-52-43-201-147.us-west-2.compute.amazonaws.com