SlideShare a Scribd company logo
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
AWS Fargate deep dive
Brent Langston
Sr. Developer Advocate
AWS
M A D 3 0 3
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
A container is an atomic, self-contained package of software that
includes everything it needs to run (code, runtime, libraries,
packages, etc.)
A popular, widely used container platform with a suite of open-
source tools and public registry is Docker
More on that here: https://docker.com
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Why are containers so popular?
• Portable
• Lightweight
• Standardized
• Easy to deploy
• Facilitate implementing microservice architecture
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
What are microservices?
”Service-oriented architecture
composed of loosely coupled elements
that have bounded contexts.”
—Adrian Cockroft
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
How are microservices and containers related?
• One job/one service → container
• Can independently
• Develop
• Deploy
• Scale
• Can use different languages and runtimes
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Managing one container is easy
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Managing many containers is much harder
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Server
Guest OS
Managing multiple containers is hard
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Orchestration tools help us deploy, manage,
and scale our containers so that we don’t need
to do all the heavy lifting ourselves
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Examples of container orchestration systems
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
You have options on AWS for orchestration as a
managed container service
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Amazon ECS Amazon EKS AWS Fargate for ECS AWS Fargate for EKS
(on the roadmap)
Managed containers on AWS
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Managed container services
Choose your orchestration tool1
Choose your launch type2
ECS EKS
EC2 Fargate EC2 Fargate
Deploying to AWS managed container services
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Running one container is easy…
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Server
Guest
OS
Managing many containers is hard!
Remember this?
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
*For distributed state management
Availability zone 1 Availability zone 2 Availability zone 3
Amazon ECS: Cluster management as a hosted service
Scheduling and orchestration
Cluster manager* Placement engine
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Amazon ECS: Cluster management as a hosted service
ECS
agent
Docker
agent
OS
EC2 instance
ECS
agent
Docker
agent
OS
EC2 instance
ECS
agent
Docker
agent
OS
EC2 instance
Availability zone
Availability zone
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Amazon ECS: Cluster management as a hosted service
• Scheduling
• Placement
• Task management (health checks)
• Management control plane updates
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Amazon ECS
Highly scalable,
high-performance container
management system
ECS
A managed platform
Cluster
management
Container
orchestration
Deep AWS
integration
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
But you are responsible for the provisioning and
maintenance of the container instances in the cluster
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Serverless
No EC2 container instances to provision, scale,
or manage
Elastic
Scale up and down seamlessly; pay for only for what you
use
Integrated with the AWS ecosystem:
VPC networking, Elastic Load Balancing, IAM permissions,
Amazon CloudWatch, and more
AWS FARGATE
Your containers
AWS Fargate simplifies the burden
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
And lets you focus on the application
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Container instances
Standard EC2 virtual
machines; once
registered to a cluster,
your tasks run on these
compute resources
Services
Abstraction over one
(or more replicated)
tasks; basis for load
balancing, scaling, and
discovery
Tasks
The isolation boundary for
containerized workloads
deployed as a unit within the
cluster
Amazon ECS: EC2 launch type
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Container instances Services Tasks
EC2 launch type: You're responsible for…
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
EC2 launch type: Configuration
• EC2 container instances for ECS are generally configured using the ECS-
optimized AMI, along with any additional optionally supplied
user data
• Services/tasks/containers are configured through the ECS API, which you can
either access directly, by going through the CLI, or by using AWS
CloudFormation
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
EC2 launch type: Compute
• You can choose your own instance type with any combination of resources
• Controlled through the service ASG launch configuration, like with any other
EC2 cluster
• Supports GPUs, spot instances, RIs, etc.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Services Tasks
Fargate launch type: You're responsible for…
Container instances
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Same task definition
schema
Use ECS APIs to
launch Fargate
containers
Easy migration –
Run Fargate and
EC2 launch type
tasks in the same
cluster
Share primitives
like VPC,
CloudWatch, IAM
with ECS
In common with EC2 launch type
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Fargate launch type: Compute
50 different CPU/memory configurations per task 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
1,024 (1 vCPU) 2 GB, 3 GB, 4 GB, 5 GB, 6 GB, 7 GB, 8 GB
2,048 (2 vCPU) 4–16 GB (in 1 GB increments)
4,096 (4 vCPU) 8–30 GB (in 1 GB increments)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Fargate launch type: Pricing
Per-second billing, 1 minute minimum
Pay for what you provision
Billed for task-level CPU and memory units
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Fargate compute constructs
Define application containers:
Image, CPU, and memory
requirements, etc.
register
Task definition
Cluster
• Infrastructure isolation boundary
• IAM permissions boundary
run
Task
• A running instantiation of a
task definition
• Use FARGATE launch type
create
Service
Elastic load
balancer
• Maintain n running copies
• Integrated with ELB
• Unhealthy tasks automatically
replaced
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
{
"family": “mytask",
"containerDefinitions": [
{
"name":“container1",
"image":"..."
},
{
"name":“container2",
"image":"..."
}
]
}
• Immutable, versioned document
• Identified by family:version
• Contains a list of up to 10 container
definitions
• All containers will be colocated on the same
host
• Each container definition has
• A name
• An image URL (ECR or
public images)
• And more
Task definition snippet
Task definition
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
CPU & memory specification
Units
• CPU: vCPU (string) or CPU units (integer)
(“1 vCPU” = 256 CPU units)
• Memory: MB (integer) or string (“1 GB”)
Task-level resources
Total CPU/memory across all containers
Container-level resources
Defines sharing of task resources
among containers
{
"family": "mytask",
"cpu": "1 vCPU",
"memory": "2 GB",
"containerDefinitions": [
{
"name":“container1",
"image":"...“,
"cpu": 256,
"memoryReservation": 512
},
{
"name":“container2",
"image":"...",
"cpu": 768,
"memoryReservation": 512
}
]
}
Task-level
resources
Container-level
resources
Task definition snippet
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Public repositories
Amazon Elastic Container Registry (Amazon ECR)
Registry support
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
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
• The network interface is allocated a private IP from your
subnet
• The network interface 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 and outbound
traffic
Network interface Fargate
taskPublic /
208.57.73.13 /
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Configure task networking: awsvpc
{
"family": "mytask",
"cpu": "1 vCPU",
"memory": "2 GB",
"networkMode": "awsvpc",
"containerDefinitions": [
{
"name":“container1",
"image":"...",
"cpu": 256,
"memoryReservation": 512
},
{
"name":“container2",
"image":"...",
"cpu": 768,
"memoryReservation": 512
}
]
}
$ aws ecs run-task ...
--task-definition mytask:1
--launch-type "FARGATE"
--network-configuration
“awsvpcConfiguration = {
subnets=[subnet1-id, ...],
securityGroups=[sg-id] }”
Run task
Task definition
Enables network
interface creation
and attachment to
task
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Internet access
The task network interface is used for all inbound and outbound network traffic to and from your task
It is also used for
• Image pull (from ECR or a public repository)
• Pushing logs to CloudWatch
These endpoints need to be reachable via your task 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
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
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
Network interface
$ aws ecs run-task ...
-- network-configuration
“awsvpcConfiguration = {
subnets=[public-subnet],
securityGroups=[sg-id],
assignPublicIp=ENABLED}”
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
Run task
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Public subnet Private subnet
Fargate
taskNetwork interface
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
Set up 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
Private task setup
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Public subnet Private subnet
Fargate
taskNetwork
interface
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 availability zones of the two
subnets match
ALB security group to allow inbound traffic
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
Internet-facing load balancer VPC setup
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Load balancer configuration
{
"family": "mytask",
"cpu": "1 vCPU",
"memory": "2 gb",
"networkMode": “awsvpc“,
"containerDefinitions": [
{
"name":“container1",
"image":"...",
"cpu": 256,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 8080 }
]
},
{
"name":“container2",
"image":"...",
"cpu": 768,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 5000 }
]
}
]
}
$ aws ecs create-service ...
-- task-definition mytask:1
--launch-type "FARGATE"
-- network-configuration
“awsvpcConfiguration = {
subnets=[subnet-id],
securityGroups=[sg-id]
}”
-- load-balancers
“[
{
"targetGroupArn": “<insert arn>",
"containerName": “container1",
"containerPort": 8080
}
]”
Create service
Task definition
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Disk storage
EBS-backed ephemeral storage provided in the form of
Volume storage
Writable Layer Storage
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
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 is available per task, across
all containers, including image layers
• Writes are not visible across containers
• Ephemeral; storage is not available after the task
stops
Writable layer
Image layers
Writable layer
Container 1 Container 2
10 GB per task
Layer storage
Image layers
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
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 that 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
Volume storage
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
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
• ECR image pull
• Amazon CloudWatch Logs pushing
• Network interface creation
• Register/deregister targets into ELB
Permission types
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
{
"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!
Cluster permissions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
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.
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": "mytask",
"cpu": "1 vCPU",
"memory": "2 GB",
"networkMode": “awsvpc“,
“taskRoleArn": “arn:aws...role/myrole“,
"containerDefinitions": [
{
"name":“container1",
"image":"...",
"cpu": 256,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 8080 }
]
},
{
"name":“container2",
"image":"...",
"cpu": 768,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 5000 }
]
}
]
}
Task definition
Application permissions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
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
• Network interface management
• ELB target registration/deregistration
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
• Using an ECR image or Amazon CloudWatch Logs?
• Create an IAM role and add read permissions to 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": "mytask",
"cpu": "1 vCPU",
"memory": "2 GB",
"networkMode": “awsvpc“,
“taskRoleArn": “arn:aws...role/myrole“,
“executionRoleArn":
“arn:aws...role/myexecutionrole“,
"containerDefinitions": [
{
"name":“container1",
"image":"...",
"cpu": 256,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 8080 }
]
},
{
"name":“container2",
"image":"...",
"cpu": 768,
"memoryReservation": 512,
"portMappings": [
{ "containerPort": 5000 }
]
}
]
}
Task definition
Execution role
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
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, ECS)
• It is automatically created in your account at first cluster creation
• It has a predefined policy that is immutable (in this case, network interface and 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
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
• 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": "mytask",
...
"containerDefinitions": [{
"name":“container1",
...
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "mytask",
"awslogs-region": “us-east-1",
"awslogs-stream-prefix": "mytask/container1“}}
},{
"name":“container2",
...
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "mytask",
"awslogs-region": “us-east-1",
"awslogs-stream-prefix": "mytask/container2"}}
}
]}
Task definition
CloudWatch Logs configuration
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Logs tab in the task
detail page
View logs in the ECS or CloudWatch console
CloudWatch Logs
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Other visibility tools
Service CPU/memory utilization metrics are
available in CloudWatch
Amazon CloudWatch Events on task state changes
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Command line tools for Fargate
aws-cli: The official CLI; is open-source, and includes most AWS services
More info here: https://aws.amazon.com/cli/
GitHub repo: https://github.com/aws/aws-cli
ecs-cli: Also official, but just for ECS; supports Docker compose files
More info here: https://github.com/aws/amazon-ecs-cli
Some good unofficial options
Fargate CLI: https://github.com/jpignata/fargate
Coldbrew CLI: https://github.com/coldbrewcloud/coldbrew-cli
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Getting started
• To get started with Fargate: https://aws.amazon.com/fargate/
• Blogs: https://aws.amazon.com/blogs/aws/aws-fargate/ and
• https://aws.amazon.com/blogs/aws/amazon-elastic-container-service-for-kubernetes/
• Liz Rice (Aquasec) on Fargate: https://blog.aquasec.com/securing-struts-in-aws-fargate
• Nathan Peck (AWS): https://medium.com/containers-on-aws/choosing-your-container-
environment-on-aws-with-ecs-eks-and-fargate-cfbe416ab1a
• Tony Pujals (AWS): https://read.acloud.guru/deploy-the-voting-app-to-aws-ecs-with-
fargate-cb75f226408f
• Deepak Singh (containers GM at AWS):
https://www.slideshare.net/AmazonWebServices/containers-on-aws-state-of-the-union-
con201-reinvent-2017
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
The awesome-ecs project
https://github.com/nathanpeck/awesome-ecs
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
ECS workshop
@brentContained: https://ecsworkshop.com
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Have questions?
Community Slack channels
awsdevelopers.slack.com
amazon-ecs.slack.com
Or reach out to one of us directly
@tonypujals (pujals@amazon.com)
@brentContained (blangs@amazon.com)
@nathankpeck
@abbyfuller
@ric_harvey
Thank you!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Brent Langston
@brentContained

More Related Content

What's hot

Video anomaly detection using Amazon SageMaker, AWS DeepLens, & AWS IoT Green...
Video anomaly detection using Amazon SageMaker, AWS DeepLens, & AWS IoT Green...Video anomaly detection using Amazon SageMaker, AWS DeepLens, & AWS IoT Green...
Video anomaly detection using Amazon SageMaker, AWS DeepLens, & AWS IoT Green...
Amazon Web Services
 
Running Containers Without Servers: Introduction to AWS Fargate - SRV214 - At...
Running Containers Without Servers: Introduction to AWS Fargate - SRV214 - At...Running Containers Without Servers: Introduction to AWS Fargate - SRV214 - At...
Running Containers Without Servers: Introduction to AWS Fargate - SRV214 - At...
Amazon Web Services
 
Deep dive on security in Amazon S3 - STG306 - New York AWS Summit
Deep dive on security in Amazon S3 - STG306 - New York AWS SummitDeep dive on security in Amazon S3 - STG306 - New York AWS Summit
Deep dive on security in Amazon S3 - STG306 - New York AWS Summit
Amazon Web Services
 
PatternsResiliency_DevDays2019.pdf
PatternsResiliency_DevDays2019.pdfPatternsResiliency_DevDays2019.pdf
PatternsResiliency_DevDays2019.pdf
Amazon Web Services
 
Build, train, and deploy ML models with Amazon SageMaker - AIM302 - New York ...
Build, train, and deploy ML models with Amazon SageMaker - AIM302 - New York ...Build, train, and deploy ML models with Amazon SageMaker - AIM302 - New York ...
Build, train, and deploy ML models with Amazon SageMaker - AIM302 - New York ...
Amazon Web Services
 
Optimize your Machine Learning workloads | AWS Summit Tel Aviv 2019
Optimize your Machine Learning workloads  | AWS Summit Tel Aviv 2019Optimize your Machine Learning workloads  | AWS Summit Tel Aviv 2019
Optimize your Machine Learning workloads | AWS Summit Tel Aviv 2019
AWS Summits
 
[NEW LAUNCH] Introducing AWS Deep Learning Containers
[NEW LAUNCH] Introducing AWS Deep Learning Containers[NEW LAUNCH] Introducing AWS Deep Learning Containers
[NEW LAUNCH] Introducing AWS Deep Learning Containers
Amazon Web Services
 
“Lift and shift” storage for business-critical applications - STG203 - New Yo...
“Lift and shift” storage for business-critical applications - STG203 - New Yo...“Lift and shift” storage for business-critical applications - STG203 - New Yo...
“Lift and shift” storage for business-critical applications - STG203 - New Yo...
Amazon Web Services
 
CI/CD best practices for building modern applications - MAD310 - New York AWS...
CI/CD best practices for building modern applications - MAD310 - New York AWS...CI/CD best practices for building modern applications - MAD310 - New York AWS...
CI/CD best practices for building modern applications - MAD310 - New York AWS...
Amazon Web Services
 
Deep Dive on Amazon Elastic Container Service (ECS) | AWS Summit Tel Aviv 2019
Deep Dive on Amazon Elastic Container Service (ECS)  | AWS Summit Tel Aviv 2019Deep Dive on Amazon Elastic Container Service (ECS)  | AWS Summit Tel Aviv 2019
Deep Dive on Amazon Elastic Container Service (ECS) | AWS Summit Tel Aviv 2019
AWS Summits
 
Best-Practices-for-Running-Windows-Workloads-on-AWS
Best-Practices-for-Running-Windows-Workloads-on-AWSBest-Practices-for-Running-Windows-Workloads-on-AWS
Best-Practices-for-Running-Windows-Workloads-on-AWS
Amazon Web Services
 
Using automation to drive continuous-compliance best practices - SEC208 - New...
Using automation to drive continuous-compliance best practices - SEC208 - New...Using automation to drive continuous-compliance best practices - SEC208 - New...
Using automation to drive continuous-compliance best practices - SEC208 - New...
Amazon Web Services
 
A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...
A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...
A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...
Amazon Web Services
 
Introduction to AWS OutIntroduction to AWS Outposts - CMP203 - Chicago AWS Su...
Introduction to AWS OutIntroduction to AWS Outposts - CMP203 - Chicago AWS Su...Introduction to AWS OutIntroduction to AWS Outposts - CMP203 - Chicago AWS Su...
Introduction to AWS OutIntroduction to AWS Outposts - CMP203 - Chicago AWS Su...
Amazon Web Services
 
AWS SSA Webinar 7 - Getting Started on AWS
AWS SSA Webinar 7 - Getting Started on AWSAWS SSA Webinar 7 - Getting Started on AWS
AWS SSA Webinar 7 - Getting Started on AWS
Cobus Bernard
 
Optimize deep learning training and inferencing using GPU and Amazon SageMake...
Optimize deep learning training and inferencing using GPU and Amazon SageMake...Optimize deep learning training and inferencing using GPU and Amazon SageMake...
Optimize deep learning training and inferencing using GPU and Amazon SageMake...
Amazon Web Services
 
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Amazon Web Services
 
Serverless Functions Deep Dive
Serverless Functions Deep DiveServerless Functions Deep Dive
Serverless Functions Deep Dive
Amazon Web Services
 
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
Amazon Web Services
 
Running Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Running Amazon EC2 workloads at scale - CMP301 - New York AWS SummitRunning Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Running Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Amazon Web Services
 

What's hot (20)

Video anomaly detection using Amazon SageMaker, AWS DeepLens, & AWS IoT Green...
Video anomaly detection using Amazon SageMaker, AWS DeepLens, & AWS IoT Green...Video anomaly detection using Amazon SageMaker, AWS DeepLens, & AWS IoT Green...
Video anomaly detection using Amazon SageMaker, AWS DeepLens, & AWS IoT Green...
 
Running Containers Without Servers: Introduction to AWS Fargate - SRV214 - At...
Running Containers Without Servers: Introduction to AWS Fargate - SRV214 - At...Running Containers Without Servers: Introduction to AWS Fargate - SRV214 - At...
Running Containers Without Servers: Introduction to AWS Fargate - SRV214 - At...
 
Deep dive on security in Amazon S3 - STG306 - New York AWS Summit
Deep dive on security in Amazon S3 - STG306 - New York AWS SummitDeep dive on security in Amazon S3 - STG306 - New York AWS Summit
Deep dive on security in Amazon S3 - STG306 - New York AWS Summit
 
PatternsResiliency_DevDays2019.pdf
PatternsResiliency_DevDays2019.pdfPatternsResiliency_DevDays2019.pdf
PatternsResiliency_DevDays2019.pdf
 
Build, train, and deploy ML models with Amazon SageMaker - AIM302 - New York ...
Build, train, and deploy ML models with Amazon SageMaker - AIM302 - New York ...Build, train, and deploy ML models with Amazon SageMaker - AIM302 - New York ...
Build, train, and deploy ML models with Amazon SageMaker - AIM302 - New York ...
 
Optimize your Machine Learning workloads | AWS Summit Tel Aviv 2019
Optimize your Machine Learning workloads  | AWS Summit Tel Aviv 2019Optimize your Machine Learning workloads  | AWS Summit Tel Aviv 2019
Optimize your Machine Learning workloads | AWS Summit Tel Aviv 2019
 
[NEW LAUNCH] Introducing AWS Deep Learning Containers
[NEW LAUNCH] Introducing AWS Deep Learning Containers[NEW LAUNCH] Introducing AWS Deep Learning Containers
[NEW LAUNCH] Introducing AWS Deep Learning Containers
 
“Lift and shift” storage for business-critical applications - STG203 - New Yo...
“Lift and shift” storage for business-critical applications - STG203 - New Yo...“Lift and shift” storage for business-critical applications - STG203 - New Yo...
“Lift and shift” storage for business-critical applications - STG203 - New Yo...
 
CI/CD best practices for building modern applications - MAD310 - New York AWS...
CI/CD best practices for building modern applications - MAD310 - New York AWS...CI/CD best practices for building modern applications - MAD310 - New York AWS...
CI/CD best practices for building modern applications - MAD310 - New York AWS...
 
Deep Dive on Amazon Elastic Container Service (ECS) | AWS Summit Tel Aviv 2019
Deep Dive on Amazon Elastic Container Service (ECS)  | AWS Summit Tel Aviv 2019Deep Dive on Amazon Elastic Container Service (ECS)  | AWS Summit Tel Aviv 2019
Deep Dive on Amazon Elastic Container Service (ECS) | AWS Summit Tel Aviv 2019
 
Best-Practices-for-Running-Windows-Workloads-on-AWS
Best-Practices-for-Running-Windows-Workloads-on-AWSBest-Practices-for-Running-Windows-Workloads-on-AWS
Best-Practices-for-Running-Windows-Workloads-on-AWS
 
Using automation to drive continuous-compliance best practices - SEC208 - New...
Using automation to drive continuous-compliance best practices - SEC208 - New...Using automation to drive continuous-compliance best practices - SEC208 - New...
Using automation to drive continuous-compliance best practices - SEC208 - New...
 
A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...
A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...
A tale of two customers - Simplified data protection with Veeam, N2WS & AWS -...
 
Introduction to AWS OutIntroduction to AWS Outposts - CMP203 - Chicago AWS Su...
Introduction to AWS OutIntroduction to AWS Outposts - CMP203 - Chicago AWS Su...Introduction to AWS OutIntroduction to AWS Outposts - CMP203 - Chicago AWS Su...
Introduction to AWS OutIntroduction to AWS Outposts - CMP203 - Chicago AWS Su...
 
AWS SSA Webinar 7 - Getting Started on AWS
AWS SSA Webinar 7 - Getting Started on AWSAWS SSA Webinar 7 - Getting Started on AWS
AWS SSA Webinar 7 - Getting Started on AWS
 
Optimize deep learning training and inferencing using GPU and Amazon SageMake...
Optimize deep learning training and inferencing using GPU and Amazon SageMake...Optimize deep learning training and inferencing using GPU and Amazon SageMake...
Optimize deep learning training and inferencing using GPU and Amazon SageMake...
 
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
Next generation intelligent data lakes, powered by GraphQL & AWS AppSync - MA...
 
Serverless Functions Deep Dive
Serverless Functions Deep DiveServerless Functions Deep Dive
Serverless Functions Deep Dive
 
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
 
Running Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Running Amazon EC2 workloads at scale - CMP301 - New York AWS SummitRunning Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
Running Amazon EC2 workloads at scale - CMP301 - New York AWS Summit
 

Similar to AWS Fargate deep dive - MAD303 - New York AWS Summit

Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Amazon Web Services
 
Deep dive - AWS Fargate
Deep dive - AWS FargateDeep dive - AWS Fargate
Deep dive - AWS Fargate
Amazon Web Services
 
Serverless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up LoftServerless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up Loft
Amazon Web Services
 
Containers on AWS: An Introduction
Containers on AWS: An IntroductionContainers on AWS: An Introduction
Containers on AWS: An Introduction
Amazon Web Services
 
Running Containers in a Hybrid Environment
Running Containers in a Hybrid EnvironmentRunning Containers in a Hybrid Environment
Running Containers in a Hybrid Environment
Amazon Web Services
 
[Games on AWS 2019] AWS 입문자를 위한 초단기 레벨업 트랙 | AWS 레벨업 하기! : 컨테이너 - 김세호 AWS 솔루션...
[Games on AWS 2019] AWS 입문자를 위한 초단기 레벨업 트랙 | AWS 레벨업 하기! : 컨테이너 - 김세호 AWS 솔루션...[Games on AWS 2019] AWS 입문자를 위한 초단기 레벨업 트랙 | AWS 레벨업 하기! : 컨테이너 - 김세호 AWS 솔루션...
[Games on AWS 2019] AWS 입문자를 위한 초단기 레벨업 트랙 | AWS 레벨업 하기! : 컨테이너 - 김세호 AWS 솔루션...
Amazon Web Services Korea
 
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
 
利用 Fargate - 無伺服器的容器環境建置高可用的系統
利用 Fargate - 無伺服器的容器環境建置高可用的系統利用 Fargate - 無伺服器的容器環境建置高可用的系統
利用 Fargate - 無伺服器的容器環境建置高可用的系統
Amazon Web Services
 
Getting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS Summit
Getting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS SummitGetting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS Summit
Getting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS Summit
Amazon Web Services
 
Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
Amazon Web Services
 
Getting Started with Containers on AWS
Getting Started with Containers on AWSGetting Started with Containers on AWS
Getting Started with Containers on AWS
Amazon Web Services
 
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 BarcelonaAWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
Amazon Web Services
 
Develop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS Summit
Develop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS SummitDevelop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS Summit
Develop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS Summit
Amazon Web Services
 
Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...
Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...
Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...
Amazon Web Services
 
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Amazon Web Services
 
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Amazon Web Services
 
Deep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveDeep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep Dive
Amazon Web Services
 
Architecting security and governance through policy guardrails in Amazon EKS ...
Architecting security and governance through policy guardrails in Amazon EKS ...Architecting security and governance through policy guardrails in Amazon EKS ...
Architecting security and governance through policy guardrails in Amazon EKS ...
Amazon Web Services
 
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
Amazon Web Services
 
Using Containers on AWS
Using Containers on AWSUsing Containers on AWS
Using Containers on AWS
Amazon Web Services
 

Similar to AWS Fargate deep dive - MAD303 - New York AWS Summit (20)

Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
Fast-Track Your Application Modernisation Journey with Containers - AWS Summi...
 
Deep dive - AWS Fargate
Deep dive - AWS FargateDeep dive - AWS Fargate
Deep dive - AWS Fargate
 
Serverless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up LoftServerless and Containers, AWS Federal Pop-Up Loft
Serverless and Containers, AWS Federal Pop-Up Loft
 
Containers on AWS: An Introduction
Containers on AWS: An IntroductionContainers on AWS: An Introduction
Containers on AWS: An Introduction
 
Running Containers in a Hybrid Environment
Running Containers in a Hybrid EnvironmentRunning Containers in a Hybrid Environment
Running Containers in a Hybrid Environment
 
[Games on AWS 2019] AWS 입문자를 위한 초단기 레벨업 트랙 | AWS 레벨업 하기! : 컨테이너 - 김세호 AWS 솔루션...
[Games on AWS 2019] AWS 입문자를 위한 초단기 레벨업 트랙 | AWS 레벨업 하기! : 컨테이너 - 김세호 AWS 솔루션...[Games on AWS 2019] AWS 입문자를 위한 초단기 레벨업 트랙 | AWS 레벨업 하기! : 컨테이너 - 김세호 AWS 솔루션...
[Games on AWS 2019] AWS 입문자를 위한 초단기 레벨업 트랙 | AWS 레벨업 하기! : 컨테이너 - 김세호 AWS 솔루션...
 
Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate Develop Containerized Apps with AWS Fargate
Develop Containerized Apps with AWS Fargate
 
利用 Fargate - 無伺服器的容器環境建置高可用的系統
利用 Fargate - 無伺服器的容器環境建置高可用的系統利用 Fargate - 無伺服器的容器環境建置高可用的系統
利用 Fargate - 無伺服器的容器環境建置高可用的系統
 
Getting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS Summit
Getting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS SummitGetting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS Summit
Getting Started with ARM-Based EC2 A1 Instances - CMP302 - Anaheim AWS Summit
 
Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
Running Containers without Servers: Introduction to AWS Fargate - SRV214 - To...
 
Getting Started with Containers on AWS
Getting Started with Containers on AWSGetting Started with Containers on AWS
Getting Started with Containers on AWS
 
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 BarcelonaAWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
 
Develop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS Summit
Develop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS SummitDevelop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS Summit
Develop Containerized Apps with AWS Fargate - SRV314 - Chicago AWS Summit
 
Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...
Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...
Optimize costs - Migrate existing workloads to the new A1 EC2 Instances - CMP...
 
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
Build a Java Spring Application on Amazon ECS - CON332 - re:Invent 2017
 
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
Getting Started with Containers in the Cloud: AWS Developer Workshop at Web S...
 
Deep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveDeep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep Dive
 
Architecting security and governance through policy guardrails in Amazon EKS ...
Architecting security and governance through policy guardrails in Amazon EKS ...Architecting security and governance through policy guardrails in Amazon EKS ...
Architecting security and governance through policy guardrails in Amazon EKS ...
 
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
 
Using Containers on AWS
Using Containers on AWSUsing Containers on AWS
Using Containers on AWS
 

More from 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 Fargate
Amazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
Amazon 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
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
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 Workloads
Amazon Web Services
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
Amazon 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 sfatare
Amazon 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 NodeJS
Amazon 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 web
Amazon 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 sfatare
Amazon 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
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
Amazon Web Services
 

More from 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...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

AWS Fargate deep dive - MAD303 - New York AWS Summit

  • 1. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T AWS Fargate deep dive Brent Langston Sr. Developer Advocate AWS M A D 3 0 3
  • 2. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T A container is an atomic, self-contained package of software that includes everything it needs to run (code, runtime, libraries, packages, etc.) A popular, widely used container platform with a suite of open- source tools and public registry is Docker More on that here: https://docker.com
  • 4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Why are containers so popular? • Portable • Lightweight • Standardized • Easy to deploy • Facilitate implementing microservice architecture
  • 5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T What are microservices? ”Service-oriented architecture composed of loosely coupled elements that have bounded contexts.” —Adrian Cockroft
  • 6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T How are microservices and containers related? • One job/one service → container • Can independently • Develop • Deploy • Scale • Can use different languages and runtimes
  • 7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Managing one container is easy
  • 8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Managing many containers is much harder Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Managing multiple containers is hard
  • 9. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Orchestration tools help us deploy, manage, and scale our containers so that we don’t need to do all the heavy lifting ourselves
  • 11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Examples of container orchestration systems
  • 12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T You have options on AWS for orchestration as a managed container service
  • 13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Amazon ECS Amazon EKS AWS Fargate for ECS AWS Fargate for EKS (on the roadmap) Managed containers on AWS
  • 14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Managed container services Choose your orchestration tool1 Choose your launch type2 ECS EKS EC2 Fargate EC2 Fargate Deploying to AWS managed container services
  • 15. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Running one container is easy… Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Server Guest OS Managing many containers is hard! Remember this?
  • 17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T *For distributed state management Availability zone 1 Availability zone 2 Availability zone 3 Amazon ECS: Cluster management as a hosted service Scheduling and orchestration Cluster manager* Placement engine
  • 18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Amazon ECS: Cluster management as a hosted service ECS agent Docker agent OS EC2 instance ECS agent Docker agent OS EC2 instance ECS agent Docker agent OS EC2 instance Availability zone Availability zone
  • 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Amazon ECS: Cluster management as a hosted service • Scheduling • Placement • Task management (health checks) • Management control plane updates
  • 20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Amazon ECS Highly scalable, high-performance container management system ECS A managed platform Cluster management Container orchestration Deep AWS integration
  • 21. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T But you are responsible for the provisioning and maintenance of the container instances in the cluster
  • 22. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Serverless No EC2 container instances to provision, scale, or manage Elastic Scale up and down seamlessly; pay for only for what you use Integrated with the AWS ecosystem: VPC networking, Elastic Load Balancing, IAM permissions, Amazon CloudWatch, and more AWS FARGATE Your containers AWS Fargate simplifies the burden
  • 23. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T And lets you focus on the application
  • 24. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Container instances Standard EC2 virtual machines; once registered to a cluster, your tasks run on these compute resources Services Abstraction over one (or more replicated) tasks; basis for load balancing, scaling, and discovery Tasks The isolation boundary for containerized workloads deployed as a unit within the cluster Amazon ECS: EC2 launch type
  • 26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Container instances Services Tasks EC2 launch type: You're responsible for…
  • 27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T EC2 launch type: Configuration • EC2 container instances for ECS are generally configured using the ECS- optimized AMI, along with any additional optionally supplied user data • Services/tasks/containers are configured through the ECS API, which you can either access directly, by going through the CLI, or by using AWS CloudFormation
  • 28. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T EC2 launch type: Compute • You can choose your own instance type with any combination of resources • Controlled through the service ASG launch configuration, like with any other EC2 cluster • Supports GPUs, spot instances, RIs, etc.
  • 29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Services Tasks Fargate launch type: You're responsible for… Container instances
  • 30. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Same task definition schema Use ECS APIs to launch Fargate containers Easy migration – Run Fargate and EC2 launch type tasks in the same cluster Share primitives like VPC, CloudWatch, IAM with ECS In common with EC2 launch type
  • 31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Fargate launch type: Compute 50 different CPU/memory configurations per task 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 1,024 (1 vCPU) 2 GB, 3 GB, 4 GB, 5 GB, 6 GB, 7 GB, 8 GB 2,048 (2 vCPU) 4–16 GB (in 1 GB increments) 4,096 (4 vCPU) 8–30 GB (in 1 GB increments)
  • 32. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Fargate launch type: Pricing Per-second billing, 1 minute minimum Pay for what you provision Billed for task-level CPU and memory units
  • 33. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 34. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 35. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Fargate compute constructs Define application containers: Image, CPU, and memory requirements, etc. register Task definition Cluster • Infrastructure isolation boundary • IAM permissions boundary run Task • A running instantiation of a task definition • Use FARGATE launch type create Service Elastic load balancer • Maintain n running copies • Integrated with ELB • Unhealthy tasks automatically replaced
  • 36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T { "family": “mytask", "containerDefinitions": [ { "name":“container1", "image":"..." }, { "name":“container2", "image":"..." } ] } • Immutable, versioned document • Identified by family:version • Contains a list of up to 10 container definitions • All containers will be colocated on the same host • Each container definition has • A name • An image URL (ECR or public images) • And more Task definition snippet Task definition
  • 37. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T CPU & memory specification Units • CPU: vCPU (string) or CPU units (integer) (“1 vCPU” = 256 CPU units) • Memory: MB (integer) or string (“1 GB”) Task-level resources Total CPU/memory across all containers Container-level resources Defines sharing of task resources among containers { "family": "mytask", "cpu": "1 vCPU", "memory": "2 GB", "containerDefinitions": [ { "name":“container1", "image":"...“, "cpu": 256, "memoryReservation": 512 }, { "name":“container2", "image":"...", "cpu": 768, "memoryReservation": 512 } ] } Task-level resources Container-level resources Task definition snippet
  • 38. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Public repositories Amazon Elastic Container Registry (Amazon ECR) Registry support
  • 39. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 40. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 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 • The network interface is allocated a private IP from your subnet • The network interface 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 and outbound traffic Network interface Fargate taskPublic / 208.57.73.13 /
  • 41. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Configure task networking: awsvpc { "family": "mytask", "cpu": "1 vCPU", "memory": "2 GB", "networkMode": "awsvpc", "containerDefinitions": [ { "name":“container1", "image":"...", "cpu": 256, "memoryReservation": 512 }, { "name":“container2", "image":"...", "cpu": 768, "memoryReservation": 512 } ] } $ aws ecs run-task ... --task-definition mytask:1 --launch-type "FARGATE" --network-configuration “awsvpcConfiguration = { subnets=[subnet1-id, ...], securityGroups=[sg-id] }” Run task Task definition Enables network interface creation and attachment to task
  • 42. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Internet access The task network interface is used for all inbound and outbound network traffic to and from your task It is also used for • Image pull (from ECR or a public repository) • Pushing logs to CloudWatch These endpoints need to be reachable via your task 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
  • 43. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 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 Network interface $ aws ecs run-task ... -- network-configuration “awsvpcConfiguration = { subnets=[public-subnet], securityGroups=[sg-id], assignPublicIp=ENABLED}” 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 Run task
  • 44. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Public subnet Private subnet Fargate taskNetwork interface 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 Set up 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 Private task setup
  • 45. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Public subnet Private subnet Fargate taskNetwork interface 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 availability zones of the two subnets match ALB security group to allow inbound traffic 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 Internet-facing load balancer VPC setup
  • 46. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Load balancer configuration { "family": "mytask", "cpu": "1 vCPU", "memory": "2 gb", "networkMode": “awsvpc“, "containerDefinitions": [ { "name":“container1", "image":"...", "cpu": 256, "memoryReservation": 512, "portMappings": [ { "containerPort": 8080 } ] }, { "name":“container2", "image":"...", "cpu": 768, "memoryReservation": 512, "portMappings": [ { "containerPort": 5000 } ] } ] } $ aws ecs create-service ... -- task-definition mytask:1 --launch-type "FARGATE" -- network-configuration “awsvpcConfiguration = { subnets=[subnet-id], securityGroups=[sg-id] }” -- load-balancers “[ { "targetGroupArn": “<insert arn>", "containerName": “container1", "containerPort": 8080 } ]” Create service Task definition
  • 47. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 48. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Disk storage EBS-backed ephemeral storage provided in the form of Volume storage Writable Layer Storage
  • 49. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 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 is available per task, across all containers, including image layers • Writes are not visible across containers • Ephemeral; storage is not available after the task stops Writable layer Image layers Writable layer Container 1 Container 2 10 GB per task Layer storage Image layers
  • 50. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 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 that 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 Volume storage
  • 51. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 52. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 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 • ECR image pull • Amazon CloudWatch Logs pushing • Network interface creation • Register/deregister targets into ELB Permission types
  • 53. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T { "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! Cluster permissions
  • 54. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 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. 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": "mytask", "cpu": "1 vCPU", "memory": "2 GB", "networkMode": “awsvpc“, “taskRoleArn": “arn:aws...role/myrole“, "containerDefinitions": [ { "name":“container1", "image":"...", "cpu": 256, "memoryReservation": 512, "portMappings": [ { "containerPort": 8080 } ] }, { "name":“container2", "image":"...", "cpu": 768, "memoryReservation": 512, "portMappings": [ { "containerPort": 5000 } ] } ] } Task definition Application permissions
  • 55. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 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 • Network interface management • ELB target registration/deregistration
  • 56. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T • Using an ECR image or Amazon CloudWatch Logs? • Create an IAM role and add read permissions to 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": "mytask", "cpu": "1 vCPU", "memory": "2 GB", "networkMode": “awsvpc“, “taskRoleArn": “arn:aws...role/myrole“, “executionRoleArn": “arn:aws...role/myexecutionrole“, "containerDefinitions": [ { "name":“container1", "image":"...", "cpu": 256, "memoryReservation": 512, "portMappings": [ { "containerPort": 8080 } ] }, { "name":“container2", "image":"...", "cpu": 768, "memoryReservation": 512, "portMappings": [ { "containerPort": 5000 } ] } ] } Task definition Execution role
  • 57. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 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, ECS) • It is automatically created in your account at first cluster creation • It has a predefined policy that is immutable (in this case, network interface and 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
  • 58. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 59. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T • 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": "mytask", ... "containerDefinitions": [{ "name":“container1", ... "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "mytask", "awslogs-region": “us-east-1", "awslogs-stream-prefix": "mytask/container1“}} },{ "name":“container2", ... "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "mytask", "awslogs-region": “us-east-1", "awslogs-stream-prefix": "mytask/container2"}} } ]} Task definition CloudWatch Logs configuration
  • 60. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Logs tab in the task detail page View logs in the ECS or CloudWatch console CloudWatch Logs
  • 61. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Other visibility tools Service CPU/memory utilization metrics are available in CloudWatch Amazon CloudWatch Events on task state changes
  • 62. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 63. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Command line tools for Fargate aws-cli: The official CLI; is open-source, and includes most AWS services More info here: https://aws.amazon.com/cli/ GitHub repo: https://github.com/aws/aws-cli ecs-cli: Also official, but just for ECS; supports Docker compose files More info here: https://github.com/aws/amazon-ecs-cli Some good unofficial options Fargate CLI: https://github.com/jpignata/fargate Coldbrew CLI: https://github.com/coldbrewcloud/coldbrew-cli
  • 64. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Getting started • To get started with Fargate: https://aws.amazon.com/fargate/ • Blogs: https://aws.amazon.com/blogs/aws/aws-fargate/ and • https://aws.amazon.com/blogs/aws/amazon-elastic-container-service-for-kubernetes/ • Liz Rice (Aquasec) on Fargate: https://blog.aquasec.com/securing-struts-in-aws-fargate • Nathan Peck (AWS): https://medium.com/containers-on-aws/choosing-your-container- environment-on-aws-with-ecs-eks-and-fargate-cfbe416ab1a • Tony Pujals (AWS): https://read.acloud.guru/deploy-the-voting-app-to-aws-ecs-with- fargate-cb75f226408f • Deepak Singh (containers GM at AWS): https://www.slideshare.net/AmazonWebServices/containers-on-aws-state-of-the-union- con201-reinvent-2017
  • 65. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T The awesome-ecs project https://github.com/nathanpeck/awesome-ecs
  • 66. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T ECS workshop @brentContained: https://ecsworkshop.com
  • 67. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Have questions? Community Slack channels awsdevelopers.slack.com amazon-ecs.slack.com Or reach out to one of us directly @tonypujals (pujals@amazon.com) @brentContained (blangs@amazon.com) @nathankpeck @abbyfuller @ric_harvey
  • 68. Thank you! © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Brent Langston @brentContained