SlideShare une entreprise Scribd logo
1  sur  65
Télécharger pour lire hors ligne
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Deepak Dayama
Product Management Lead (AWS Fargate & Amazon ECS)
Amazon Web Services
SRV314
Containerized App Development with
AWS Fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Motivation for AWS Fargate
Working with AWS Fargate
What’s New for Amazon ECS and
AWS Fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Motivation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
First, there was
Amazon EC2
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Then Docker!
Customers started containerizing applications
within EC2 instances
EC2 Instance
Containers
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containers made it easy to build and scale
cloud-native applications
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Customers needed an easier way to manage large clusters of
instances, place containers, and run services
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scheduling and Orchestration
Cluster Manager Placement Engine
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ECS
Agent
Docker
Agent
OS
EC2 instance
But you still end up managing more than just containers
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Patching and upgrading OS, agents, etc.
Scaling the instance fleet for optimal utilization
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ECS
Agent
Docker
Agent
OS
EC2 instance
ECS
Agent
Docker
Agent
OS
EC2 instance
ECS
Agent
Docker
Agent
OS
EC2 instance
Elastic
Container
Service
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Your
Containerized
Applications
MANAGED BY AWS
No EC2 Instances to provision, scale, or manage
ELASTIC
Scale up & down seamlessly. Pay only for what you use
INTEGRATED
with the AWS ecosystem: VPC Networking,
Elastic Load Balancing, IAM Permissions, Amazon CloudWatch
and more.
AWS Fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Container Services Landscape
MANAGEMENT
Deployment, Scheduling,
Scaling & Management of
containerized applications
HOSTING
Where the containers run
Amazon Elastic
Container Service
Amazon Elastic
Container Service
for Kubernetes
Amazon EC2 AWS Fargate
IMAGE REGISTRY
Container Image Repository
Preview!
Amazon Elastic
Container Registry
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Entire website runs as microservices. Ruby &
GraphQL backend with node.js frontend
Needed ability to scale quickly, schedule multi-
container workloads, network layer control
All in on AWS—Moved entire infrastructure to AWS and
Fargate in Jan 2018
Fargate scales quickly with traffic spikes, running
multiple services in production
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Public
Subnet
Private
Subnet
CDN
External
ALB
Backend Web External
API External
Frontend Web
External
Card/Scraper
Service
Background
Job Queues
Background
Workers
Internal
ALB Background
Web Internal
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Fargate Customers
”We don't want to babysit
any clusters. That has
nothing to do with us”
Shimon Tolts
CTO, DATREE
“We moved to Fargate
because we need the
ability to scale quickly up
from baseline and get fine-
grained network control,
without having to manage
our own infrastructure”
Product Hunt
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Working with Fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Constructs When Using Fargate with
Amazon ECS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Define application containers: Image
URL, CPU & Memory requirements, etc.
register
Task Definition
create
Cluster
• Infrastructure Isolation boundary
• IAM Permissions boundary
run
Task
• A running instantiation of a
task definition
• Use Fargate launch type
create
Service
Elastic Load
Balancing
• Maintain n running copies
• Integrated with Elastic Load Balancing
• Unhealthy tasks automatically
replaced
Constructs When Using Fargate with
Amazon ECS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Task Definition
{
"family": “scorekeep",
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe"
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api"
}
]
}
Immutable, versioned document
Identified by family: version
Contains a list of up to 10 container definitions
All containers are colocated on the same host
Each container definition has:
• A name
• Image URL (Amazon ECR or Public
Images)
• And more…stay tuned!
Task Definition Snippet
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Registry Support
Third-Party Private Repositories (coming soon!)
Public Repositories supported
Amazon ECR
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Compute
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CPU & Memory Specification
{
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe“,
"cpu": 256,
"memoryReservation": 512
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api",
"cpu": 768,
"memoryReservation": 512
}
]
}
Task Level Resources:
• Total CPU/memory across all containers
• Required fields
• Billing dimensions
Units
• CPU: cpu-units. 1 vCPU = 1024 cpu-units
• Memory: MB
Container Level Resources:
• Defines sharing of task resources among containers
• Optional fields
Task
Level
Resources
Container
Level
Resources
Task Definition Snippet
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Task CPU Memory Configurations
50 different CPU/memory configurations to choose from
CPU Memory
256 (.25 vCPU) 512 MB, 1 GB, 2 GB
512 (.5 vCPU) 1 GB, 2 GB, 3 GB, 4 GB
1024 (1 vCPU) 2 GB, 3 GB, 4 GB, 5 GB, 6 GB, 7 GB, 8 GB
2048 (2 vCPU) Between 4 GB and 16 GB in 1-GB increments
4096 (4 vCPU) Between 8 GB and 30 GB in 1-GB increments
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Pricing
Per-second billing. One minute minimum
Pay for what you provision
Billed for task level CPU and memory
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Networking
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
VPC Integration
172.31.0.0/16
Subnet
172.31.1.0/24
Internet
Other Entities in VPC
EC2 LB DB etc.
Private IP
172.31.1.164
Launch your Fargate Tasks into subnets
Under the hood :
• We create an Elastic Network Interface (ENI)
• The ENI is allocated a private IP from your subnet
• The ENI is attached to your task
• Your task now has a private IP from your subnet!
You can assign public IPs to your tasks
Configure security groups to control inbound & outbound traffic
ENI Fargate
TaskPublic /
208.57.73.13 /
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
VPC Configuration
{
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"networkMode": "awsvpc",
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe",
"cpu": 256,
"memoryReservation": 512
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api",
"cpu": 768,
"memoryReservation": 512
}
]
}
$ aws ecs run-task ...
-- task-definition scorekeep:1
-- network-configuration
“awsvpcConfiguration = {
subnets=[subnet1-id, subnet2-id],
securityGroups=[sg-id]
}”
Enables ENI
creation &
attachment
to Task
Run Task
Task Definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Internet Access
The Task elastic network interface is used for all inbound & outbound network traffic to and from
your task
It is also used for:
• Image Pull (from Amazon ECR or a public repository)
• Pushing logs to CloudWatch
These endpoints need to be reachable via your task elastic network interface
Two common modes of setup:
• Private with no inbound internet traffic, but allows outbound internet access
• Public task with both inbound and outbound internet access
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Private Task Setup
Public subnet Private subnet
Fargate
TaskENI
Private IP
172.31.1.164
NAT Gateway
Public EIP
34.214.162.237
Internet
Gateway
172.31.0.0/16
172.31.2.0/24 172.31.1.0/24
Destination Target
172.31.0.0/16 local
0.0.0.0/0 NAT Gateway
Destination Target
172.31.0.0/16 local
0.0.0.0/0 Internet Gateway
Route Tables
Internet
Attach Internet Gateway to VPC
Set up a Public Subnet with
• Route to Internet Gateway
• NAT Gateway
Setup Private Subnet with
• Fargate Task
• Route to NAT Gateway
Security Group to allow outbound traffic
Type Port Destination
All Traffic ALL 0.0.0.0/0
Outbound Security Group Rules
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Outbound
Inbound
Public Task Setup
Public subnet
Fargate
Task
Public IP
54.191.135.66
Internet
Gateway
172.31.0.0/16
172.31.2.0/24
Destination Target
172.31.0.0/16 local
0.0.0.0/0 Internet Gateway
Route Table
Internet
ENI
$ aws ecs run-task ...
-- network-configuration
“awsvpcConfiguration = {
subnets=[public-subnet],
securityGroups=[sg-id],
}”
Launch the task into a Public subnet
Give it a public IP address
Security Group to allow the expected inbound traffic
Type Port Source
HTTP 8080 0.0.0.0/0
Inbound Security Group Rule
Type Port Destination
All Traffic ALL 0.0.0.0/0
Outbound Security Group Rules
assignPublicIp=ENABLED
Run Task
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Elastic Load Balancing Configuration
{
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"networkMode": “awsvpc“,
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe",
"cpu": 256,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 8080 }
]
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api",
"cpu": 768,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 5000 }
]
}
]
}
$ aws ecs create-service ...
-- task-definition scorekeep:1
-- network-configuration
“awsvpcConfiguration = {
subnets=[subnet-id],
securityGroups=[sg-id]
}”
-- load-balancers
“[
{
"targetGroupArn": “<insert arn>",
"containerName": “scorekeep-frontend",
"containerPort": 8080
}
]”
Create Service
Task Definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Internet Facing Elastic Load Balancing VPC
Setup
Public subnet Private subnet
Fargate
TaskENI
Private IP
172.31.1.164
:8080
ALB
Public IP
208.57.73.13
:80
172.31.0.0/16
172.31.2.0/24 172.31.1.0/24
Internet
Task in private subnet with private IP
ALB in public subnet with public IP
Make sure the AZs of the two subnets match
ALB security group to allow inbound traffic the from
internet
Task security group to allow inbound traffic from the
ALB’s security group
Task Security GroupALB Security Group
Type Port Source
HTTP 80 0.0.0.0/0
Inbound Rule
Type Port Source
Custom TCP 8080 ALB Security Group
Inbound Rule
us-east-1a us-east-1a
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Storage
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Disk Storage
Amazon EBS backed Ephemeral storage provided in the form of:
Volume Storage
Writable Layer Storage
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Layer Storage
• Docker images are composed of layers
The topmost layer is the “writable” layer to
capture file changes made by the running
container
• 10-GB layer storage available per task,
across all containers, including image
layers
• Writes are not visible across containers
• Ephemeral. Storage is not available after
the task stops.
Image Layers
Writable Layer
Image Layers
Writable Layer
Container 1 Container 2
10 GB per Task
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Volume Storage
• Need writes to be visible across containers?
• Fargate provides 4 GB volume space per task
• Configure via volume mounts in task definition
• Can mount at different containerPaths
• Do not specify host sourcePath
• Remember this is also ephemeral, i.e. not
available after the task stops
Container 1 Container 2
4 GB Volume Storage
mount
/var/container1/data /var/container2/data
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
IAM Permissions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Permission Tiers
Cluster
Permissions
Application
Permissions
Task
Housekeeping
Permissions
Cluster
Fargate Task
Cluster Permissions:
Control who can launch/describe tasks in your cluster
Application Permissions:
Allows your application containers to access AWS resources
securely
Housekeeping Permissions:
Allows us to perform housekeeping activities around your task:
• Amazon ECR Image Pull
• CloudWatch Logs pushing
• ENI creation
• Register/Deregister targets into Elastic Load
Balancing
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cluster Permissions
{
"Effect": "Allow",
"Action": [ "ecs:RunTask" ],
"Condition": {
"ArnEquals": {"ecs:cluster":"<cluster-arn>"}
},
"Resource": [ “<task_def_family>:*" ]
}
You can tailor IAM policies for fine grained access control to your clusters
Attach these policies to IAM Users and/or Roles as necessary
Some example policies:
Example 1: Allow RunTask in a specific cluster
with a specific task definition only
{
"Effect": "Allow",
"Action": [ "ecs:ListTasks“,
“ecs:DescribeTasks” ],
"Condition": {
"ArnEquals": {"ecs:cluster":"<cluster-arn>"}
},
"Resource": “*”
}
Example 2: Read-only access to tasks in a
specific cluster
And many more!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Application Permissions
Do your application containers access other AWS resources?
Need to get credentials down to the task?
Create an IAM Role with the requisite permissions that your
application needs. In our scorekeep example, DDB & SNS
permissions.
Establish a trust relationship with ecs-tasks.amazonaws.com
on that role. This lets us assume the role and wire the
credentials down to your task.
Add the role arn to your task definition and you’re done!
We issue and rotate temporary credentials
AWS CLI/SDK calls from within your application will
automatically use the Task Role credentials
Use a Task Role
{
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"networkMode": “awsvpc“,
“taskRoleArn": “arn:aws...role/scorekeepRole“,
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe",
"cpu": 256,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 8080 }
]
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api",
"cpu": 768,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 5000 }
]
}
]
}
Task Definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Housekeeping Permissions
• We need certain permissions in your account to bootstrap your task and keep it
running.
• Execution Role gives us permissions for:
• ECR Image Pull
• Pushing CloudWatch Logs
• ECS Service Linked Role gives us permissions for:
• ENI Management
• ELB Target Registration/Deregistration
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Execution Role
• Using an ECR Image or CloudWatch Logs?
• Create an IAM Role and add Read Permissions to Amazon
ECR
• ecr:GetAuthorizationToken & ecr:BatchGetImage
• Or use AmazonEC2ContainerRegistryReadOnly
managed policy
• Add Write Permissions to CloudWatch Logs
• logs:CreateLogStream & logs:PutLogEvents
• Or use CloudWatchLogsFullAccess managed policy
• Establish trust relationship with ecs-tasks.amazonaws.com.
This lets us assume the role
• Add the execution role arn into your task definition
Give us permissions via an Execution Role {
"family": "scorekeep",
"cpu": "1 vCpu",
"memory": "2 gb",
"networkMode": “awsvpc“,
“taskRoleArn": “arn:aws...role/scorekeepRole“,
“executionRoleArn":
“arn:aws...role/scorekeepExecutionRole“,
"containerDefinitions": [
{
"name":“scorekeep-frontend",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe",
"cpu": 256,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 8080 }
]
},
{
"name":“scorekeep-api",
"image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api",
"cpu": 768,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 5000 }
]
}
]
}
Task Definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS Service Linked Role
• A service-linked role is a unique type of IAM role that is linked directly to an AWS service, in this case,
Amazon ECS
• It is automatically created in your account at first cluster creation
• It has a predefined policy, that is immutable. In this case, ENI & ELB permissions.
• You don’t have to explicitly pass this role in the task definition or any API call.
Just know about it in case you stumble upon it in the IAM console
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Visibility & Monitoring
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CloudWatch Logs Configuration
• Use the awslogs driver to send
stdout from your application to
Cloudwatch logs
• Create a log group in CloudWatch
• Configure the log driver in your
task definition
• Remember to add permissions via
the Task Execution Role
{
"family": "scorekeep",
...
"containerDefinitions": [
{
"name":“scorekeep-frontend",
...
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "scorekeep",
"awslogs-region": “us-east-1",
"awslogs-stream-prefix": "scorekeep/frontend“}}
},
{
"name":“scorekeep-api",
...
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "scorekeep",
"awslogs-region": “us-east-1",
"awslogs-stream-prefix": "scorekeep/api"}}
}
]}
Task Definition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CloudWatch Logs
Logs Tab in the
Task Detail Page
View logs in the Amazon ECS or CloudWatch Console
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Other Visibility Tools
Service CPU/memory utilization metrics
available in CloudWatch
CloudWatch Events on task state changes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What’s New?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Query environmental data and statistics for running tasks from within the Task!
Enables monitoring tools like Datadog, etc.
• Endpoints available:
Task Level (for all containers)
• 169.254.170.2/v2/metadata – Metadata JSON for Task
• 169.254.170.2/v2/stats - Docker stats JSON for all containers in the Task
Container Level
• 169.254.170.2/v2/metadata/<container-id>
• 169.254.170.2/v2/stats/<container-id>
Task Metadata
NEW!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
"Cluster": "default",
"TaskARN": "arn:aws:ecs:us-west-
2:012345678910:task/9781c248-0edd-4cdb-
9a93-f63cb662a5d3",
"Family": "nginx",
"Revision": "5",
"DesiredStatus": "RUNNING",
"KnownStatus": "RUNNING",
"Containers": [
{
"DockerId":
"731a0d6a3b4210e2448339bc7015aaa",
"Name": "~internal~ecs~pause",
"DockerName": "ecs-nginx-5-
internalecspause-1234",
Task Metadata
NEW!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
{
"Containers": [
{
"DockerId":
"731a0d6a3b4210e2448339bc7015aaa",
"Name": "~internal~ecs~pause",
"DockerName": "ecs-nginx-5-
internalecspause-1234",
"Image": "amazon/amazon-ecs-
pause:0.1.0",
"ImageID": "",
"Labels": {
"com.amazonaws.ecs.cluster":
"default",
"com.amazonaws.ecs.task-arn":
"com.amazonaws.ecs.task-definition-
family": "nginx",
"com.amazonaws.ecs.task-
definition-version": "5"
},
Task Metadata
NEW!
"DesiredStatus":
"RESOURCES_PROVISIONED",
"KnownStatus":
"RESOURCES_PROVISIONED",
"Limits": {
"CPU": 512,
"Memory": 512
}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Monitoring with Datadog Autodiscovery and
Fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Container Health Checks
- Define custom health check commands in the ECS Task Definition
NEW!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Managed Service Discovery for ECS
NEW!
• Service registry:
• Predictable Names for services
• Auto updated with latest, healthy
IP, port
• Managed: No overhead of installation or
monitoring
• High availability, high scale
• Extensible: Flexible boundaries for auto
discovery
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Route 53 Auto Naming Provides Service
Registry
Amazon Route 53 provides APIs to
create
• Namespace
• CNAME per service autoname
• A records per task IP
• SRV records per task IP + port
Service
CNAME: A / SRV record
Namespac
e
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ECS Schedules & Places Service Endpoints
ECS Scheduler updates on:
• Service scaling
• Task registrations
• Task de-registrations
• Task health
• Scheduling / Placement changes
• ECS instance changes
ECS maintains latest state of the
dynamic environment in Service
Registry
Cluster: myapp
app
IP
web
IP
app
IP
web
IP
AZ 1 AZ 2
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ECS Updates Service Endpoints in Amazon Route 53
Cluster: myapp
AZ 1 AZ 2
app
10.0.6.5:8080
web
10.0.8.6:8080
app
10.0.4.5:8080
web
10.0.3.6:8080
Namespace: myapp.local
Service
web.myapp.local CNAME
10.0.4.5:8080
10.0.3.6:8080
Service
app.myapp.local CNAME
10.0.6.5:8080
10.0.8.6:8080
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Services Connect To Latest Endpoints Via DNS
Service
web.myapp.local CNAME
10.0.4.5:8080
10.0.3.6:8080
app
>dig web.myapp.local
> 10.0.4.5:8080
>
app web
web
Cluster: myapp DNS Server:
AZ
1
AZ
2
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Benefits of This Approach
Cluster: myapp
AZ
1
AZ
2
Service
Namespace Managed
Just turn on
Highly available
Tied to Amazon Route 53
availability, scale
Extensible
Public APIs that can be
used across AWS
Works across clusters,
accounts, AZs
Works across AWS
services
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Takeaways
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Takeaways
• Fargate is a new launch type within ECS to run containers without having to manage EC2 instances
• If you’re debating between EC2 v/s Fargate mode, start architecting with Fargate.
It forces good design practice by keeping your application containers truly independent
of the underlying host.
• If you think you must have access to the underlying host, think again.
• There are some good reasons : special instance type needs, EC2 dedicated instances, utilizing EC2
reserved instances, GPUs, Windows workloads
• And tell us about your use case, we want to support it on Fargate!
• Start using Fargate today!
• Fargate works with your Docker container images
• You can run existing task definitions on Fargate with only minor modifications.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Learn more at aws.amazon.com/Fargate
Thank You!
@saysdd
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Please complete the session survey in
the summit mobile app.
Submit Session Feedback
1. Tap the Schedule icon. 2. Select the session
you attended.
3. Tap Session
Evaluation to submit your
feedback.

Contenu connexe

Tendances

SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
 SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact CenterAmazon Web Services
 
SID304 Threat Detection and Remediation with Amazon GuardDuty
 SID304 Threat Detection and Remediation with Amazon GuardDuty SID304 Threat Detection and Remediation with Amazon GuardDuty
SID304 Threat Detection and Remediation with Amazon GuardDutyAmazon Web Services
 
SRV313 Introduction to Building Web Apps on AWS
 SRV313 Introduction to Building Web Apps on AWS SRV313 Introduction to Building Web Apps on AWS
SRV313 Introduction to Building Web Apps on AWSAmazon Web Services
 
SRV318 Running Kubernetes with Amazon EKS
SRV318 Running Kubernetes with Amazon EKSSRV318 Running Kubernetes with Amazon EKS
SRV318 Running Kubernetes with Amazon EKSAmazon Web Services
 
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...Amazon Web Services
 
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech TalksAnalyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech TalksAmazon Web Services
 
SRV208 S3 One Zone-IA and S3 Select GA
SRV208 S3 One Zone-IA and S3 Select GASRV208 S3 One Zone-IA and S3 Select GA
SRV208 S3 One Zone-IA and S3 Select GAAmazon Web Services
 
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...Amazon Web Services
 
SRV320 Deep Dive on VMware Cloud on AWS
 SRV320 Deep Dive on VMware Cloud on AWS SRV320 Deep Dive on VMware Cloud on AWS
SRV320 Deep Dive on VMware Cloud on AWSAmazon Web Services
 
Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018
Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018
Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018Amazon Web Services
 
Ionic and React Hybrid Web/Native Mobile Applications with Mobile Hub - AWS O...
Ionic and React Hybrid Web/Native Mobile Applications with Mobile Hub - AWS O...Ionic and React Hybrid Web/Native Mobile Applications with Mobile Hub - AWS O...
Ionic and React Hybrid Web/Native Mobile Applications with Mobile Hub - AWS O...Amazon Web Services
 
Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate Amazon Web Services
 
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...Amazon Web Services
 
Increase the Value of Video with ML & Media Services - SRV322 - New York AWS ...
Increase the Value of Video with ML & Media Services - SRV322 - New York AWS ...Increase the Value of Video with ML & Media Services - SRV322 - New York AWS ...
Increase the Value of Video with ML & Media Services - SRV322 - New York AWS ...Amazon Web Services
 
SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
 SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDSAmazon Web Services
 
DEM18 How SendBird Built a Serverless Log-Processing Pipeline in a Week
DEM18 How SendBird Built a Serverless Log-Processing Pipeline in a WeekDEM18 How SendBird Built a Serverless Log-Processing Pipeline in a Week
DEM18 How SendBird Built a Serverless Log-Processing Pipeline in a WeekAmazon Web Services
 
Achieving Business Value with AWS - AWS Online Tech Talks
Achieving Business Value with AWS - AWS Online Tech TalksAchieving Business Value with AWS - AWS Online Tech Talks
Achieving Business Value with AWS - AWS Online Tech TalksAmazon Web Services
 
Running Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day IsraelRunning Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day IsraelAmazon Web Services
 
SID305 AWS Certificate Manager Private CA
SID305 AWS Certificate Manager Private CASID305 AWS Certificate Manager Private CA
SID305 AWS Certificate Manager Private CAAmazon Web Services
 
SRV315 Building Enterprise-Grade Serverless Apps
 SRV315 Building Enterprise-Grade Serverless Apps SRV315 Building Enterprise-Grade Serverless Apps
SRV315 Building Enterprise-Grade Serverless AppsAmazon Web Services
 

Tendances (20)

SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
 SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
SRV326 Build a Voice-based Chatbot for Your Amazon Connect Contact Center
 
SID304 Threat Detection and Remediation with Amazon GuardDuty
 SID304 Threat Detection and Remediation with Amazon GuardDuty SID304 Threat Detection and Remediation with Amazon GuardDuty
SID304 Threat Detection and Remediation with Amazon GuardDuty
 
SRV313 Introduction to Building Web Apps on AWS
 SRV313 Introduction to Building Web Apps on AWS SRV313 Introduction to Building Web Apps on AWS
SRV313 Introduction to Building Web Apps on AWS
 
SRV318 Running Kubernetes with Amazon EKS
SRV318 Running Kubernetes with Amazon EKSSRV318 Running Kubernetes with Amazon EKS
SRV318 Running Kubernetes with Amazon EKS
 
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...
BDA301 Working with Machine Learning in Amazon SageMaker: Algorithms, Models,...
 
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech TalksAnalyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
Analyze your Data Lake, Fast @ Any Scale - AWS Online Tech Talks
 
SRV208 S3 One Zone-IA and S3 Select GA
SRV208 S3 One Zone-IA and S3 Select GASRV208 S3 One Zone-IA and S3 Select GA
SRV208 S3 One Zone-IA and S3 Select GA
 
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
 
SRV320 Deep Dive on VMware Cloud on AWS
 SRV320 Deep Dive on VMware Cloud on AWS SRV320 Deep Dive on VMware Cloud on AWS
SRV320 Deep Dive on VMware Cloud on AWS
 
Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018
Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018
Driving DevOps Transformation in Enterprises (DEV320) - AWS re:Invent 2018
 
Ionic and React Hybrid Web/Native Mobile Applications with Mobile Hub - AWS O...
Ionic and React Hybrid Web/Native Mobile Applications with Mobile Hub - AWS O...Ionic and React Hybrid Web/Native Mobile Applications with Mobile Hub - AWS O...
Ionic and React Hybrid Web/Native Mobile Applications with Mobile Hub - AWS O...
 
Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate
 
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...
Architecting ASP.NET Core Microservices Applications on AWS (WIN401) - AWS re...
 
Increase the Value of Video with ML & Media Services - SRV322 - New York AWS ...
Increase the Value of Video with ML & Media Services - SRV322 - New York AWS ...Increase the Value of Video with ML & Media Services - SRV322 - New York AWS ...
Increase the Value of Video with ML & Media Services - SRV322 - New York AWS ...
 
SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
 SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
SRV310 Optimizing Relational Databases on AWS: Deep Dive on Amazon RDS
 
DEM18 How SendBird Built a Serverless Log-Processing Pipeline in a Week
DEM18 How SendBird Built a Serverless Log-Processing Pipeline in a WeekDEM18 How SendBird Built a Serverless Log-Processing Pipeline in a Week
DEM18 How SendBird Built a Serverless Log-Processing Pipeline in a Week
 
Achieving Business Value with AWS - AWS Online Tech Talks
Achieving Business Value with AWS - AWS Online Tech TalksAchieving Business Value with AWS - AWS Online Tech Talks
Achieving Business Value with AWS - AWS Online Tech Talks
 
Running Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day IsraelRunning Container on AWS - Builders Day Israel
Running Container on AWS - Builders Day Israel
 
SID305 AWS Certificate Manager Private CA
SID305 AWS Certificate Manager Private CASID305 AWS Certificate Manager Private CA
SID305 AWS Certificate Manager Private CA
 
SRV315 Building Enterprise-Grade Serverless Apps
 SRV315 Building Enterprise-Grade Serverless Apps SRV315 Building Enterprise-Grade Serverless Apps
SRV315 Building Enterprise-Grade Serverless Apps
 

Similaire à SRV314 Containerized App Development with AWS Fargate

[AWS Container Service] Introducing AWS Fargate
[AWS Container Service] Introducing AWS Fargate[AWS Container Service] Introducing AWS Fargate
[AWS Container Service] Introducing AWS FargateAmazon Web Services Korea
 
Introducing AWS Fargate - AWS Online Tech Talks
Introducing AWS Fargate - AWS Online Tech TalksIntroducing AWS Fargate - AWS Online Tech Talks
Introducing AWS Fargate - AWS Online Tech TalksAmazon Web Services
 
Exciting world of Amazon container services with AWS Fargate and Amazon EKS
Exciting world of Amazon container services with AWS Fargate and Amazon EKSExciting world of Amazon container services with AWS Fargate and Amazon EKS
Exciting world of Amazon container services with AWS Fargate and Amazon EKSAmazon Web Services
 
Introducing AWS Fargate - Tiffany Jernigan
Introducing AWS Fargate - Tiffany JerniganIntroducing AWS Fargate - Tiffany Jernigan
Introducing AWS Fargate - Tiffany JerniganAmazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 
Deep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveDeep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveAmazon Web Services
 
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018Amazon Web Services
 
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018Amazon Web Services
 
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...Amazon Web Services Japan
 
AWS ECS Workshop A Journey to Modern Applications
AWS ECS Workshop A Journey to Modern ApplicationsAWS ECS Workshop A Journey to Modern Applications
AWS ECS Workshop A Journey to Modern ApplicationsAmazon Web Services
 
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...Amazon Web Services
 
AWSome Day Online Conference 2018 - Module 2
AWSome Day Online Conference 2018 -  Module 2AWSome Day Online Conference 2018 -  Module 2
AWSome Day Online Conference 2018 - Module 2Amazon Web Services
 
Getting-started-with-containers on AWS
Getting-started-with-containers on AWSGetting-started-with-containers on AWS
Getting-started-with-containers on AWSAmazon Web Services
 
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...Amazon Web Services
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesAmazon Web Services
 

Similaire à SRV314 Containerized App Development with AWS Fargate (20)

[AWS Container Service] Introducing AWS Fargate
[AWS Container Service] Introducing AWS Fargate[AWS Container Service] Introducing AWS Fargate
[AWS Container Service] Introducing AWS Fargate
 
Introducing AWS Fargate - AWS Online Tech Talks
Introducing AWS Fargate - AWS Online Tech TalksIntroducing AWS Fargate - AWS Online Tech Talks
Introducing AWS Fargate - AWS Online Tech Talks
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Deep Dive into Amazon Fargate
Deep Dive into Amazon FargateDeep Dive into Amazon Fargate
Deep Dive into Amazon Fargate
 
Exciting world of Amazon container services with AWS Fargate and Amazon EKS
Exciting world of Amazon container services with AWS Fargate and Amazon EKSExciting world of Amazon container services with AWS Fargate and Amazon EKS
Exciting world of Amazon container services with AWS Fargate and Amazon EKS
 
Introducing AWS Fargate - Tiffany Jernigan
Introducing AWS Fargate - Tiffany JerniganIntroducing AWS Fargate - Tiffany Jernigan
Introducing AWS Fargate - Tiffany Jernigan
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 
Deep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveDeep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep Dive
 
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018
 
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
 
Containers - State of the Union
Containers - State of the UnionContainers - State of the Union
Containers - State of the Union
 
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...
AWS Black Belt Online Seminar 2018 re:Invent Recap: Compute, Container and Ne...
 
AWS ECS Workshop A Journey to Modern Applications
AWS ECS Workshop A Journey to Modern ApplicationsAWS ECS Workshop A Journey to Modern Applications
AWS ECS Workshop A Journey to Modern Applications
 
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
 
AWSome Day Online Conference 2018 - Module 2
AWSome Day Online Conference 2018 -  Module 2AWSome Day Online Conference 2018 -  Module 2
AWSome Day Online Conference 2018 - Module 2
 
Getting-started-with-containers on AWS
Getting-started-with-containers on AWSGetting-started-with-containers on AWS
Getting-started-with-containers on AWS
 
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation Slides
 

Plus de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSAmazon Web Services
 

Plus de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Come costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWSCome costruire un'architettura Serverless nel Cloud AWS
Come costruire un'architettura Serverless nel Cloud AWS
 

SRV314 Containerized App Development with AWS Fargate

  • 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deepak Dayama Product Management Lead (AWS Fargate & Amazon ECS) Amazon Web Services SRV314 Containerized App Development with AWS Fargate
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Motivation for AWS Fargate Working with AWS Fargate What’s New for Amazon ECS and AWS Fargate
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Motivation
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. First, there was Amazon EC2
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Then Docker! Customers started containerizing applications within EC2 instances EC2 Instance Containers
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containers made it easy to build and scale cloud-native applications
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Customers needed an easier way to manage large clusters of instances, place containers, and run services
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Scheduling and Orchestration Cluster Manager Placement Engine
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ECS Agent Docker Agent OS EC2 instance But you still end up managing more than just containers
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Patching and upgrading OS, agents, etc. Scaling the instance fleet for optimal utilization
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ECS Agent Docker Agent OS EC2 instance ECS Agent Docker Agent OS EC2 instance ECS Agent Docker Agent OS EC2 instance Elastic Container Service
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Your Containerized Applications MANAGED BY AWS No EC2 Instances to provision, scale, or manage ELASTIC Scale up & down seamlessly. Pay only for what you use INTEGRATED with the AWS ecosystem: VPC Networking, Elastic Load Balancing, IAM Permissions, Amazon CloudWatch and more. AWS Fargate
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Container Services Landscape MANAGEMENT Deployment, Scheduling, Scaling & Management of containerized applications HOSTING Where the containers run Amazon Elastic Container Service Amazon Elastic Container Service for Kubernetes Amazon EC2 AWS Fargate IMAGE REGISTRY Container Image Repository Preview! Amazon Elastic Container Registry
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Entire website runs as microservices. Ruby & GraphQL backend with node.js frontend Needed ability to scale quickly, schedule multi- container workloads, network layer control All in on AWS—Moved entire infrastructure to AWS and Fargate in Jan 2018 Fargate scales quickly with traffic spikes, running multiple services in production
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Public Subnet Private Subnet CDN External ALB Backend Web External API External Frontend Web External Card/Scraper Service Background Job Queues Background Workers Internal ALB Background Web Internal
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Fargate Customers ”We don't want to babysit any clusters. That has nothing to do with us” Shimon Tolts CTO, DATREE “We moved to Fargate because we need the ability to scale quickly up from baseline and get fine- grained network control, without having to manage our own infrastructure” Product Hunt
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Working with Fargate
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Constructs When Using Fargate with Amazon ECS
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Define application containers: Image URL, CPU & Memory requirements, etc. register Task Definition create Cluster • Infrastructure Isolation boundary • IAM Permissions boundary run Task • A running instantiation of a task definition • Use Fargate launch type create Service Elastic Load Balancing • Maintain n running copies • Integrated with Elastic Load Balancing • Unhealthy tasks automatically replaced Constructs When Using Fargate with Amazon ECS
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Task Definition { "family": “scorekeep", "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe" }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api" } ] } Immutable, versioned document Identified by family: version Contains a list of up to 10 container definitions All containers are colocated on the same host Each container definition has: • A name • Image URL (Amazon ECR or Public Images) • And more…stay tuned! Task Definition Snippet
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Registry Support Third-Party Private Repositories (coming soon!) Public Repositories supported Amazon ECR
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Compute
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CPU & Memory Specification { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe“, "cpu": 256, "memoryReservation": 512 }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api", "cpu": 768, "memoryReservation": 512 } ] } Task Level Resources: • Total CPU/memory across all containers • Required fields • Billing dimensions Units • CPU: cpu-units. 1 vCPU = 1024 cpu-units • Memory: MB Container Level Resources: • Defines sharing of task resources among containers • Optional fields Task Level Resources Container Level Resources Task Definition Snippet
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Task CPU Memory Configurations 50 different CPU/memory configurations to choose from CPU Memory 256 (.25 vCPU) 512 MB, 1 GB, 2 GB 512 (.5 vCPU) 1 GB, 2 GB, 3 GB, 4 GB 1024 (1 vCPU) 2 GB, 3 GB, 4 GB, 5 GB, 6 GB, 7 GB, 8 GB 2048 (2 vCPU) Between 4 GB and 16 GB in 1-GB increments 4096 (4 vCPU) Between 8 GB and 30 GB in 1-GB increments
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Pricing Per-second billing. One minute minimum Pay for what you provision Billed for task level CPU and memory
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Networking
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. VPC Integration 172.31.0.0/16 Subnet 172.31.1.0/24 Internet Other Entities in VPC EC2 LB DB etc. Private IP 172.31.1.164 Launch your Fargate Tasks into subnets Under the hood : • We create an Elastic Network Interface (ENI) • The ENI is allocated a private IP from your subnet • The ENI is attached to your task • Your task now has a private IP from your subnet! You can assign public IPs to your tasks Configure security groups to control inbound & outbound traffic ENI Fargate TaskPublic / 208.57.73.13 /
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. VPC Configuration { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "networkMode": "awsvpc", "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe", "cpu": 256, "memoryReservation": 512 }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api", "cpu": 768, "memoryReservation": 512 } ] } $ aws ecs run-task ... -- task-definition scorekeep:1 -- network-configuration “awsvpcConfiguration = { subnets=[subnet1-id, subnet2-id], securityGroups=[sg-id] }” Enables ENI creation & attachment to Task Run Task Task Definition
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Internet Access The Task elastic network interface is used for all inbound & outbound network traffic to and from your task It is also used for: • Image Pull (from Amazon ECR or a public repository) • Pushing logs to CloudWatch These endpoints need to be reachable via your task elastic network interface Two common modes of setup: • Private with no inbound internet traffic, but allows outbound internet access • Public task with both inbound and outbound internet access
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Private Task Setup Public subnet Private subnet Fargate TaskENI Private IP 172.31.1.164 NAT Gateway Public EIP 34.214.162.237 Internet Gateway 172.31.0.0/16 172.31.2.0/24 172.31.1.0/24 Destination Target 172.31.0.0/16 local 0.0.0.0/0 NAT Gateway Destination Target 172.31.0.0/16 local 0.0.0.0/0 Internet Gateway Route Tables Internet Attach Internet Gateway to VPC Set up a Public Subnet with • Route to Internet Gateway • NAT Gateway Setup Private Subnet with • Fargate Task • Route to NAT Gateway Security Group to allow outbound traffic Type Port Destination All Traffic ALL 0.0.0.0/0 Outbound Security Group Rules
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Outbound Inbound Public Task Setup Public subnet Fargate Task Public IP 54.191.135.66 Internet Gateway 172.31.0.0/16 172.31.2.0/24 Destination Target 172.31.0.0/16 local 0.0.0.0/0 Internet Gateway Route Table Internet ENI $ aws ecs run-task ... -- network-configuration “awsvpcConfiguration = { subnets=[public-subnet], securityGroups=[sg-id], }” Launch the task into a Public subnet Give it a public IP address Security Group to allow the expected inbound traffic Type Port Source HTTP 8080 0.0.0.0/0 Inbound Security Group Rule Type Port Destination All Traffic ALL 0.0.0.0/0 Outbound Security Group Rules assignPublicIp=ENABLED Run Task
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Load Balancing Configuration { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "networkMode": “awsvpc“, "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe", "cpu": 256, "memoryReservation": 512, "portMappings": [ { "containerPort": 8080 } ] }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api", "cpu": 768, "memoryReservation": 512, "portMappings": [ { "containerPort": 5000 } ] } ] } $ aws ecs create-service ... -- task-definition scorekeep:1 -- network-configuration “awsvpcConfiguration = { subnets=[subnet-id], securityGroups=[sg-id] }” -- load-balancers “[ { "targetGroupArn": “<insert arn>", "containerName": “scorekeep-frontend", "containerPort": 8080 } ]” Create Service Task Definition
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Internet Facing Elastic Load Balancing VPC Setup Public subnet Private subnet Fargate TaskENI Private IP 172.31.1.164 :8080 ALB Public IP 208.57.73.13 :80 172.31.0.0/16 172.31.2.0/24 172.31.1.0/24 Internet Task in private subnet with private IP ALB in public subnet with public IP Make sure the AZs of the two subnets match ALB security group to allow inbound traffic the from internet Task security group to allow inbound traffic from the ALB’s security group Task Security GroupALB Security Group Type Port Source HTTP 80 0.0.0.0/0 Inbound Rule Type Port Source Custom TCP 8080 ALB Security Group Inbound Rule us-east-1a us-east-1a
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Storage
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Disk Storage Amazon EBS backed Ephemeral storage provided in the form of: Volume Storage Writable Layer Storage
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Layer Storage • Docker images are composed of layers The topmost layer is the “writable” layer to capture file changes made by the running container • 10-GB layer storage available per task, across all containers, including image layers • Writes are not visible across containers • Ephemeral. Storage is not available after the task stops. Image Layers Writable Layer Image Layers Writable Layer Container 1 Container 2 10 GB per Task
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Volume Storage • Need writes to be visible across containers? • Fargate provides 4 GB volume space per task • Configure via volume mounts in task definition • Can mount at different containerPaths • Do not specify host sourcePath • Remember this is also ephemeral, i.e. not available after the task stops Container 1 Container 2 4 GB Volume Storage mount /var/container1/data /var/container2/data
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. IAM Permissions
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Permission Tiers Cluster Permissions Application Permissions Task Housekeeping Permissions Cluster Fargate Task Cluster Permissions: Control who can launch/describe tasks in your cluster Application Permissions: Allows your application containers to access AWS resources securely Housekeeping Permissions: Allows us to perform housekeeping activities around your task: • Amazon ECR Image Pull • CloudWatch Logs pushing • ENI creation • Register/Deregister targets into Elastic Load Balancing
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Cluster Permissions { "Effect": "Allow", "Action": [ "ecs:RunTask" ], "Condition": { "ArnEquals": {"ecs:cluster":"<cluster-arn>"} }, "Resource": [ “<task_def_family>:*" ] } You can tailor IAM policies for fine grained access control to your clusters Attach these policies to IAM Users and/or Roles as necessary Some example policies: Example 1: Allow RunTask in a specific cluster with a specific task definition only { "Effect": "Allow", "Action": [ "ecs:ListTasks“, “ecs:DescribeTasks” ], "Condition": { "ArnEquals": {"ecs:cluster":"<cluster-arn>"} }, "Resource": “*” } Example 2: Read-only access to tasks in a specific cluster And many more!
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Application Permissions Do your application containers access other AWS resources? Need to get credentials down to the task? Create an IAM Role with the requisite permissions that your application needs. In our scorekeep example, DDB & SNS permissions. Establish a trust relationship with ecs-tasks.amazonaws.com on that role. This lets us assume the role and wire the credentials down to your task. Add the role arn to your task definition and you’re done! We issue and rotate temporary credentials AWS CLI/SDK calls from within your application will automatically use the Task Role credentials Use a Task Role { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "networkMode": “awsvpc“, “taskRoleArn": “arn:aws...role/scorekeepRole“, "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe", "cpu": 256, "memoryReservation": 512, "portMappings": [ { "containerPort": 8080 } ] }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api", "cpu": 768, "memoryReservation": 512, "portMappings": [ { "containerPort": 5000 } ] } ] } Task Definition
  • 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Housekeeping Permissions • We need certain permissions in your account to bootstrap your task and keep it running. • Execution Role gives us permissions for: • ECR Image Pull • Pushing CloudWatch Logs • ECS Service Linked Role gives us permissions for: • ENI Management • ELB Target Registration/Deregistration
  • 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Execution Role • Using an ECR Image or CloudWatch Logs? • Create an IAM Role and add Read Permissions to Amazon ECR • ecr:GetAuthorizationToken & ecr:BatchGetImage • Or use AmazonEC2ContainerRegistryReadOnly managed policy • Add Write Permissions to CloudWatch Logs • logs:CreateLogStream & logs:PutLogEvents • Or use CloudWatchLogsFullAccess managed policy • Establish trust relationship with ecs-tasks.amazonaws.com. This lets us assume the role • Add the execution role arn into your task definition Give us permissions via an Execution Role { "family": "scorekeep", "cpu": "1 vCpu", "memory": "2 gb", "networkMode": “awsvpc“, “taskRoleArn": “arn:aws...role/scorekeepRole“, “executionRoleArn": “arn:aws...role/scorekeepExecutionRole“, "containerDefinitions": [ { "name":“scorekeep-frontend", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/fe", "cpu": 256, "memoryReservation": 512, "portMappings": [ { "containerPort": 8080 } ] }, { "name":“scorekeep-api", "image":"xxx.dkr.ecr.us-east-1.amazonaws.com/api", "cpu": 768, "memoryReservation": 512, "portMappings": [ { "containerPort": 5000 } ] } ] } Task Definition
  • 44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS Service Linked Role • A service-linked role is a unique type of IAM role that is linked directly to an AWS service, in this case, Amazon ECS • It is automatically created in your account at first cluster creation • It has a predefined policy, that is immutable. In this case, ENI & ELB permissions. • You don’t have to explicitly pass this role in the task definition or any API call. Just know about it in case you stumble upon it in the IAM console
  • 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Visibility & Monitoring
  • 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CloudWatch Logs Configuration • Use the awslogs driver to send stdout from your application to Cloudwatch logs • Create a log group in CloudWatch • Configure the log driver in your task definition • Remember to add permissions via the Task Execution Role { "family": "scorekeep", ... "containerDefinitions": [ { "name":“scorekeep-frontend", ... "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "scorekeep", "awslogs-region": “us-east-1", "awslogs-stream-prefix": "scorekeep/frontend“}} }, { "name":“scorekeep-api", ... "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "scorekeep", "awslogs-region": “us-east-1", "awslogs-stream-prefix": "scorekeep/api"}} } ]} Task Definition
  • 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CloudWatch Logs Logs Tab in the Task Detail Page View logs in the Amazon ECS or CloudWatch Console
  • 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Other Visibility Tools Service CPU/memory utilization metrics available in CloudWatch CloudWatch Events on task state changes
  • 49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What’s New?
  • 50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Query environmental data and statistics for running tasks from within the Task! Enables monitoring tools like Datadog, etc. • Endpoints available: Task Level (for all containers) • 169.254.170.2/v2/metadata – Metadata JSON for Task • 169.254.170.2/v2/stats - Docker stats JSON for all containers in the Task Container Level • 169.254.170.2/v2/metadata/<container-id> • 169.254.170.2/v2/stats/<container-id> Task Metadata NEW!
  • 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { "Cluster": "default", "TaskARN": "arn:aws:ecs:us-west- 2:012345678910:task/9781c248-0edd-4cdb- 9a93-f63cb662a5d3", "Family": "nginx", "Revision": "5", "DesiredStatus": "RUNNING", "KnownStatus": "RUNNING", "Containers": [ { "DockerId": "731a0d6a3b4210e2448339bc7015aaa", "Name": "~internal~ecs~pause", "DockerName": "ecs-nginx-5- internalecspause-1234", Task Metadata NEW!
  • 52. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. { "Containers": [ { "DockerId": "731a0d6a3b4210e2448339bc7015aaa", "Name": "~internal~ecs~pause", "DockerName": "ecs-nginx-5- internalecspause-1234", "Image": "amazon/amazon-ecs- pause:0.1.0", "ImageID": "", "Labels": { "com.amazonaws.ecs.cluster": "default", "com.amazonaws.ecs.task-arn": "com.amazonaws.ecs.task-definition- family": "nginx", "com.amazonaws.ecs.task- definition-version": "5" }, Task Metadata NEW! "DesiredStatus": "RESOURCES_PROVISIONED", "KnownStatus": "RESOURCES_PROVISIONED", "Limits": { "CPU": 512, "Memory": 512 }
  • 53. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Monitoring with Datadog Autodiscovery and Fargate
  • 54. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Container Health Checks - Define custom health check commands in the ECS Task Definition NEW!
  • 55. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Managed Service Discovery for ECS NEW! • Service registry: • Predictable Names for services • Auto updated with latest, healthy IP, port • Managed: No overhead of installation or monitoring • High availability, high scale • Extensible: Flexible boundaries for auto discovery
  • 56. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Route 53 Auto Naming Provides Service Registry Amazon Route 53 provides APIs to create • Namespace • CNAME per service autoname • A records per task IP • SRV records per task IP + port Service CNAME: A / SRV record Namespac e
  • 57. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ECS Schedules & Places Service Endpoints ECS Scheduler updates on: • Service scaling • Task registrations • Task de-registrations • Task health • Scheduling / Placement changes • ECS instance changes ECS maintains latest state of the dynamic environment in Service Registry Cluster: myapp app IP web IP app IP web IP AZ 1 AZ 2
  • 58. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ECS Updates Service Endpoints in Amazon Route 53 Cluster: myapp AZ 1 AZ 2 app 10.0.6.5:8080 web 10.0.8.6:8080 app 10.0.4.5:8080 web 10.0.3.6:8080 Namespace: myapp.local Service web.myapp.local CNAME 10.0.4.5:8080 10.0.3.6:8080 Service app.myapp.local CNAME 10.0.6.5:8080 10.0.8.6:8080
  • 59. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Services Connect To Latest Endpoints Via DNS Service web.myapp.local CNAME 10.0.4.5:8080 10.0.3.6:8080 app >dig web.myapp.local > 10.0.4.5:8080 > app web web Cluster: myapp DNS Server: AZ 1 AZ 2
  • 60. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Benefits of This Approach Cluster: myapp AZ 1 AZ 2 Service Namespace Managed Just turn on Highly available Tied to Amazon Route 53 availability, scale Extensible Public APIs that can be used across AWS Works across clusters, accounts, AZs Works across AWS services
  • 61. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Takeaways
  • 62. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Takeaways • Fargate is a new launch type within ECS to run containers without having to manage EC2 instances • If you’re debating between EC2 v/s Fargate mode, start architecting with Fargate. It forces good design practice by keeping your application containers truly independent of the underlying host. • If you think you must have access to the underlying host, think again. • There are some good reasons : special instance type needs, EC2 dedicated instances, utilizing EC2 reserved instances, GPUs, Windows workloads • And tell us about your use case, we want to support it on Fargate! • Start using Fargate today! • Fargate works with your Docker container images • You can run existing task definitions on Fargate with only minor modifications.
  • 63. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Learn more at aws.amazon.com/Fargate Thank You! @saysdd
  • 64. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Please complete the session survey in the summit mobile app.
  • 65. Submit Session Feedback 1. Tap the Schedule icon. 2. Select the session you attended. 3. Tap Session Evaluation to submit your feedback.