All Projects → pahud → Ecs Cfn Refarch

pahud / Ecs Cfn Refarch

Amazon ECS reference architecture

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Ecs Cfn Refarch

Aws Data Replication Hub
Seamless User Interface for replicating data into AWS.
Stars: ✭ 40 (-60.4%)
Mutual labels:  cloudformation
Awsconsolerecorder
Records actions made in the AWS Management Console and outputs the equivalent CLI/SDK commands and CloudFormation/Terraform templates.
Stars: ✭ 1,152 (+1040.59%)
Mutual labels:  cloudformation
Aws Service Catalog Products
This repository contains a number of CloudFormation templates which can be used independently or as Products with AWS Service Catalog including the Open Source Tools AWS Service Catalog Factory and AWS Service Catalog Puppet. The templates include a number of the foundational AWS Services you may choose to manage Account Compliance including AWS Config, AWS CloudTrail and GuardDuty
Stars: ✭ 84 (-16.83%)
Mutual labels:  cloudformation
Serverless Application
🍤 ALIS Media - Serverless Application
Stars: ✭ 52 (-48.51%)
Mutual labels:  cloudformation
Crucible
AWS CloudFormation templates built with Clojure
Stars: ✭ 66 (-34.65%)
Mutual labels:  cloudformation
Cform Vscode
CloudFormation extension for Visual Studio Code
Stars: ✭ 73 (-27.72%)
Mutual labels:  cloudformation
Aws Unifi Controller
Example of a Ubiquiti Unifi Controller in AWS using Network Load Balancer for TLS termination
Stars: ✭ 37 (-63.37%)
Mutual labels:  cloudformation
Awesome Aws
A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources. Featuring the Fiery Meter of AWSome.
Stars: ✭ 9,895 (+9697.03%)
Mutual labels:  cloudformation
Kube Aws
[EOL] A command-line tool to declaratively manage Kubernetes clusters on AWS
Stars: ✭ 1,146 (+1034.65%)
Mutual labels:  cloudformation
Perun
A command-line validation tool for AWS Cloud Formation that allows to conquer the cloud faster!
Stars: ✭ 82 (-18.81%)
Mutual labels:  cloudformation
Quickstart Taskcat Ci
AWS Quick Start Team
Stars: ✭ 57 (-43.56%)
Mutual labels:  cloudformation
Aws Iot Certificate Vending Machine
The CVM allows a device to apply for its own certificate and installation.
Stars: ✭ 64 (-36.63%)
Mutual labels:  cloudformation
Cfn Sphere
AWS CloudFormation stack management tool
Stars: ✭ 76 (-24.75%)
Mutual labels:  cloudformation
Serverless
This is intended to be a repo containing all of the official AWS Serverless architecture patterns built with CDK for developers to use. All patterns come in Typescript and Python with the exported CloudFormation also included.
Stars: ✭ 1,048 (+937.62%)
Mutual labels:  cloudformation
Aws Multi Account Viewer
Serverless app designed for any customer with two or more accounts to view resources across accounts/regions in simple single pane of glass website
Stars: ✭ 87 (-13.86%)
Mutual labels:  cloudformation
Webapp Revieee
Stars: ✭ 39 (-61.39%)
Mutual labels:  cloudformation
Sceptre
Build better AWS infrastructure
Stars: ✭ 1,160 (+1048.51%)
Mutual labels:  cloudformation
Lambstatus
[Maintenance mode] Serverless Status Page System
Stars: ✭ 1,323 (+1209.9%)
Mutual labels:  cloudformation
Cfer
Toolkit and Ruby DSL for automating infrastructure using AWS CloudFormation
Stars: ✭ 89 (-11.88%)
Mutual labels:  cloudformation
Cloudformation Templates
Common tasks automated by CloudFormation
Stars: ✭ 79 (-21.78%)
Mutual labels:  cloudformation

ecs-cfn-refarch

This is an Amazon EC2 Container Service reference architecture with cloudformation templates that helps you provision a complete Amazon ECS environment with many advanced optional features.

Features

  • [x] Cluster provisioned with mixed autoscaling group(ondemand + spot instances diversified across many types and AZs)
  • [x] Secrets saved in SSM Parameter Store
  • [x] Using latest Amazon ECS AMI
  • [x] Built-in service autoscaling policies and cluster autoscaling policies
  • [x] Support ECS Service Custom Metrics Logger as a plug-in to automatically generate some missing metrics

Prerequisite

ecs-cfn-refarch will not generate the following resources for you. Make sure you have created them.

  • [x] A VPC with 3 public subnets
  • [x] A SSH key pair in EC2 console

Usage

create a custom.mk file and customize your parameters in this file

# git clone the project
$ git clone https://github.com/pahud/ecs-cfn-refarch.git
$ cd ecs-cfn-refarch
$ cp custom.mk.sample custom.mk
$ vim custom.mk

Create the cluster

# create the cluster
$ make create-ecs-cluster

click the link to the cloudformation console. The whole stack should be created in 5–7minutes.

Validate

When the cloudformation is completed. Check the stach output:

# check the stack output
$ make describe-ecs-cluster

Response

[
    {
        "OutputKey": "GreetingURL", 
        "OutputValue": "http://ecsdemo-MAIN-1M6ASY034M08X-alb-2131750000.ap-northeast-1.elb.amazonaws.com/greeting.html"
    },  
    {
        "OutputKey": "URL", 
        "OutputValue": "http://ecsdemo-MAIN-1M6ASY034M08X-alb-2131750000.ap-northeast-1.elb.amazonaws.com"
    }
]

click the URL and you'll see the phpinfo page, wihch is served by ECS Tasks behind ALB.

If you cURL the GreetingURL , you'll get a static page containing credentials stored in SSM Parameter Store(i.e.ECSYourName and ECSYourPassword). The credentials were retrieved by ECS Execution Role from SSM Parameter on task bootstrapping and is injected into the environment variables.(details)

$ curl http://ecsdemo-MAIN-1M6ASY034M08X-alb-2131750000.ap-northeast-1.elb.amazonaws.com/greeting.html
<!DOCTYPE html>
<html>
<head>
<title>EC2 Parameter Store demo</title>
</head>
<body>
<p>
<h1>Hi DefaultName!</h1>
<p>
<h2>Your password is DefaultPassword!</h2>

attributes

By default, instances will have instance-purchase-option attributes either ondemand or spot(implementation detail).

For example, list all the instances with instance-purchase-option=spot:

$ aws ecs list-attributes --target-type container-instance  --region ap-northeast-1  --cluster ecsdemo-MAIN-IKGTIS1HXS9J-ecs-cluster --attribute-name instance-purchase-option --attribute-value spot
{
    "attributes": [
        {
            "targetId": "arn:aws:ecs:ap-northeast-1:903779448426:container-instance/22119ce6-bcfc-488d-ba8a-d005f2f6237f", 
            "name": "instance-purchase-option", 
            "value": "spot"
        }, 
        {
            "targetId": "arn:aws:ecs:ap-northeast-1:903779448426:container-instance/0dbf6399-e51d-4fe7-a6b8-c86019d101bc", 
            "name": "instance-purchase-option", 
            "value": "spot"
        }, 
        {
            "targetId": "arn:aws:ecs:ap-northeast-1:903779448426:container-instance/097bec0a-11c2-4c5a-8231-b82f387574ce", 
            "name": "instance-purchase-option", 
            "value": "spot"
        }
    ]
}

Optionally, you may define your task placement constraints to explicitly deploy ECS tasks on ondemand or spot.

"placementConstraints": [
    {
        "expression": "attribute:instance-purchase-option == spot",
        "type": "memberOf"
    }
]

This will give you better control over the taks placement based on the constraints expression.

clean up

# delete the stacks
$ make delete-ecs-cluster
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].