Author: Tran Tuan Quy
Date: Sep 24, 2017
What is AWS
Virtual Private Cloud (VPC - Networking Service)
EC2 Instance and related components (Compute Service)
ECS and related components (Compute Service)
Config autoscale (Compute Service)
Recap
Default VPC
Non-default VPC
Name | igw-demo-app |
---|---|
vpc | vpc-demo-app |
Create subnets 1a
Name | subnet-demo-app-1a |
---|---|
vpc | vpc-demo-app |
Available zone | ap-southeast-1a |
CIDR | 172.31.0.0/20 |
Auto-assign public ip | No/Yes |
Create subnets 1b
Name | subnet-demo-app-1b |
---|---|
vpc | vpc-demo-app |
Available zone | ap-southeast-1b |
CIDR | 172.31.16.0/20 |
Auto-assign public ip | No/Yes |
Name | route-table-demo-app-name |
---|---|
vpc | vpc-demo-app |
Destination | Target |
---|---|
172.31.0.0/16 | local |
0.0.0.0/0 | igw-67ad6c03 |
Type | Protocol | Port Range | Source |
---|---|---|---|
ALL TCP | TCP | All | 172.31.0.0/10 |
Create a security group for internal network
Type | Protocol | Port Range | Source |
---|---|---|---|
HTTP (80) | TCP | All | 0.0.0.0/0 |
Create a security group for public web app server
Type | Protocol | Port Range | Source |
---|---|---|---|
All TCP | TCP | All | 116.102.18.170/32 |
Create a security group for SysAdmin (DevOps)
When creating ec2 instance we can attach specific network interface with static ip or let it auto generate an ip.
Subnet | Private IP | Security Group |
---|---|---|
subnet-demo-app-1a | 172.31.0.100 or auto assign | public-web-app-server |
subnet-demo-app-1a | 172.31.16.100 or auto assign | public-web-app-server |
Source: https://www.linkedin.com/pulse/tutorial-deploying-your-first-docker-container-aws-ec2-wootton/
Clusters can contain multiple different container instance types.
Clusters are region-specific.
Container instances can only be a part of one cluster at a time.
Define IAM policies to control who can access to cluster
This is actually an EC2 instance running the ECS agent.
The recommended option is to use AWS ECS AMI but any AMI can be used as long as you add the ECS agent to it. The ECS agent is also open source
This is the agent that runs on EC2 instances to form the ECS cluster.
If you’re using the ECS optimized AMI, you don’t need to do anything as the agent comes with it.
But if you want to run your own OS/AMI, you will need to install the agent. The container agent is open source and can be found here:
An application containing one or more containers.
This is where you provide the Docker images, the amount of CPU/Memory to use, ports etc.
You can also link containers here, similar to a Docker command line.
An instance of a task definition running on a container instance.
A service in ECS allows you to run and maintain a specified number of instances of a task definition.
If a task in a service stops, the task is restarted.
Services ensure that the desired running tasks are achieved and maintained.
Services can also include things like load balancer configuration, IAM roles and placement strategies
With VPC, it allow us to define virtual private network quickly and securely.
With EC2 instance, it allow to scale system easily & automatically, increase high availability of our system.
With ECS which based on container approach, it make deploying on big system simpler.