• Stars
    star
    599
  • Rank 73,960 (Top 2 %)
  • Language
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sample CloudFormation templates for how to run Docker containers in AWS Fargate with various networking configurations

CloudFormation Templates for AWS Fargate deployments

This is a collection of CloudFormation templates for launching containers in Fargate with a variety of different networking approaches. Fargate is designed to give you significant control over how the networking of your containers works, and these templates show how to host public facing containers, containers which are indirectly accessible to the public via a load balancer but hosted within a private network, and private containers that can not be accessed by the public.

Instructions

1. Choose a Fargate cluster networking stack:

Launch the stack of your choice, and give it a friendly name in CloudFormation. For example "production" or "qa". You'll be using the name of this stack later for launching a service.

Choose one of the following:

Public VPC:

public task

Fully public networking stack. All containers launched in this stack will have public IP addresses and can be directly accessible on the internet via an internet gateway, or indirectly accessible via a public facing load balancer. (Note that by default the security groups are configured so that the containers only accept traffic from the load balancer, even though they have public IP addresses. The capability for direct access is there if the security group is changed though.)

Public + Private VPC:

private task

Networking stack with both public and private subnets. This stack offers the most flexibility, with the ability to host both public facing services, as well as private, internal services for which there is no public access. Containers that are run in the private subnet can access the internet via NAT gateway.

2. Choose a service template:

There are three service templates to choose between.

Public Subnet, Public Load Balancer:

public subnet public load balancer

This template requires the public subnet or public + private subnet networking stack. It launches containers that have public IP addresses in a public subnet, so they are directly accessible to the public. It also associates the containers with a public facing load balancer.

Private Subnet, Public Load Balancer:

private subnet public load balancer

This template requires the public + private subnet networking stack. It launches containers that have no public IP address, and which are hosted in private subnet. If they need to make external requests, they can initiate outbound network traffic through a NAT gateway in the public subnets. The only way to get network traffic to these private containers is via a public facing load balancer which is hosted in the public subnets.

Private Subnet, Private Load Balancer:

private subnet private load balancer

This template requires the public + private subnet networking stack. It launches containers that are hosted in a private subnet, and have no public IP address. The containers are behind an internal load balancer which is hosted in the private subnet, with no public IP address either. This allows other containers in the subnet to make requests against the load balancer, but the load balancer is not accessible to the public internet. These private services can still initiate outbound access the internet via the NAT gateway hosted in the public subnets.

Each of the above CF stacks has default values prefilled for launching a simple Nginx container, but can be customized. It's important to make sure the "StackName" value is filled in with the same name that you selected for the name of your networking stack chosen in step #1.

More Repositories

1

awesome-ecs

A curated list of awesome ECS guides, development tools, and resources
2,797
star
2

clui

Command Line UI toolkit for Node.js
JavaScript
1,663
star
3

socket.io-chat-fargate

A demo application showing how to deploy a scalable realtime chat application powered by Socket.io, Node.js, Docker, and AWS Fargate. Includes full text search powered by OpenSearch Serverless
JavaScript
419
star
4

s3-upload-stream

A Node.js module for streaming data to Amazon S3 via the multipart upload API
JavaScript
344
star
5

nodejs-aws-workshop

Learn to deploy a Node.js API using Elastic Beanstalk, AWS Lambda, Elastic Container Service, Amazon Fargate, and Kubernetes
JavaScript
184
star
6

ecs-cloudformation

Simple, production ready CloudFormation templates for launching containers on Amazon ECS and AWS Fargate
183
star
7

exiftool

A Node.js wrapper around exiftool, providing metadata extraction from numerous audio, video, document, and binary filetypes
JavaScript
79
star
8

autohotkey-windows-10-apple-magic-keyboard

AutoHotKey script that allows you to use an Apple Magic Keyboard in Windows 10 with Apple familiar keyboard shortcuts.
AutoHotkey
45
star
9

aws-ecs-deployment-patterns

A visual guide to deployment patterns on Amazon EC2 Container Service
39
star
10

screenshot-service

JavaScript
24
star
11

greeter-app-mesh-cdk

An example of how to use AWS Cloud Development Kit to setup an AWS App Mesh service mesh in AWS Elastic Container Service
JavaScript
22
star
12

greeter-cdk

Example AWS Cloud Development Kit app that deploys the greeter microservice stack
JavaScript
19
star
13

emma-sdk

Node.js client for the Emma API
JavaScript
16
star
14

webkit-html-to-image-phantomjs

A simple Phantom.js webkit HTML to Image conversion service
JavaScript
8
star
15

json-template

A satirical programming language inspired by MongoDB queries.
JavaScript
7
star
16

standard-deviation-stream

A Node.js class for pulling stats from a stream.
JavaScript
6
star
17

ecs-fargate-benchmark-templates

A collection of CloudFormation templates that can be used to test various task launch scenarios of ECS on EC2 and ECS on Fargate
6
star
18

classic-interview-algorithms

Collection of algorithms that are asked as classic interview questions
JavaScript
5
star
19

inlets-on-ecs-anywhere

An AWS Cloud Development Kit architecture for deploying Inlets as an ingress for an ECS Anywhere cluster
TypeScript
5
star
20

aws-cdk-nyan-cat

CSS
4
star
21

deploying-container-to-fargate-using-aws-copilot

Deploying a container to AWS Fargate using AWS Copilot
JavaScript
4
star
22

archer-nyan-cat

CSS
4
star
23

fargate-security-con414

4
star
24

nathanpeck

3
star
25

aws-cdk-advanced-ecs-scheduling

JavaScript
3
star
26

string-reverse

A sample application that just reverses a string, for an AWS Copilot demo
JavaScript
2
star
27

ecs-patterns-vitepress

CSS
1
star
28

Dumatenseb

Version controlled dwarf fortress world
1
star
29

wordladder

A JavaScript code interview snippet
JavaScript
1
star
30

euphoria

A bunch of code I wrote in 2004 in the EUPHORIA language
Eiffel
1
star
31

sumtime

Simple Nodes.js service for high volume data point sums and ranges
JavaScript
1
star
32

cdk-and-copilot

TypeScript
1
star
33

aws-cdk-github-actions

Test repo for experimenting with AWS CDK + Github Actions
TypeScript
1
star
34

liquid-clock

Liquid clock widget for Mac OS X Dashboard
JavaScript
1
star
35

ecs-ami-metadata-endpoint

A CloudFormation template that helps you setup your own endpoint for fetching the ECS AMI metadata
1
star
36

greeter

Sample code for three microservices that construct a greeting
JavaScript
1
star