Deploy on AWS Container Service

Deploy on AWS Container Service

First I have to admit that I am a lazy man and tired of setting a lot of things like instance, security group...

So if you are same kind of me, you can do like I did.

Prerequisite

First, you need, of course, access to you AWS console.
Then you need to install ECS AMI image, set up role, ELB, security group, VPC, and task definition. Then you can go to AWS container service to create cluster using all setting above.

For the lazy people

As I said, I am lazy, and I only need one cluster of ECS. So I recommend ECS set up wizard FirstRun. It start with one task and one service but you can modify it latter. Follow the instructions, you will be able to set up everything.

Other settings

  • If you want to pull image from private docker registry. you need to do the following things.
  1. First get your docker credential.

    cat ~/.docker/config.json
    or you want to use another kind of credential like this

    {
      "https://index.docker.io/v1/": {
        "username": "my_name",
        "password": "my_password",
        "email": "email@example.com"
      }
    }
    
  2. SSH to your instance and do sudo vi /etc/ecs/ecs.config

  3. Add the following if you use first kind.

    ECS_ENGINE_AUTH_TYPE=dockercfg
    ECS_ENGINE_AUTH_DATA={"https://index.docker.io/v1/":{"auth":"zq212MzEXAMPLE7o6T25Dk0i","email":"email@example.com"}}
    

    Or if you use second kind,

    ECS_ENGINE_AUTH_TYPE=docker
    ECS_ENGINE_AUTH_DATA=
    

{"https://index.docker.io/v1/":{"username":"my_name","password":"my_password","email":"email@example.com"}}
```

  1. Run sudo stop ecs
  2. Run sudo start ecs

Conclustion

I have to said this wizard really save me a lot of time. After two week AWS journey, I finally found something easy except finding information you want in overwhelming

Subscribe to Waiting & BN

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe