All Projects → codesuki → ecs-gen

codesuki / ecs-gen

Licence: MIT License
docker-gen for AWS ECS

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ecs-gen

ddd-practitioners-ref
EventStorming workshop, this is a hands-on workshop. Contains such topics: DDD, Event storming, Specification by example. Including the AWS product : Serverless Lambda , DynamoDB, Fargate, CloudWatch.
Stars: ✭ 276 (+500%)
Mutual labels:  container, ecs
Aws Scalable Big Blue Button Example
Demonstration of how to deploy a scalable video conference solution based on Big Blue Button
Stars: ✭ 29 (-36.96%)
Mutual labels:  container, ecs
Cdk Constructs
A collection of higher-level aws cdk constructs: slack-approval-workflow, #slack & msteams notifications, chatops, blue-green-container-deployment, codecommit-backup, OWASP dependency-check, contentful-webhook, github-webhook, stripe-webhook, static-website, pull-request-check, pull-request-approval-rule, codepipeline-merge-action, codepipeline-check-parameter-action...
Stars: ✭ 282 (+513.04%)
Mutual labels:  container, ecs
Eventstormingworkshop
EventStorming workshop, this is a hands-on workshop. Contains such topics: DDD, Event storming, Specification by example. Including the AWS product : Serverless Lambda , DynamoDB, Fargate, CloudWatch.
Stars: ✭ 184 (+300%)
Mutual labels:  container, ecs
provose
Provose is a new way to manage your Amazon Web Services infrastructure.
Stars: ✭ 27 (-41.3%)
Mutual labels:  ecs, elastic-container-service
Firecamp
Serverless Platform for the stateful services
Stars: ✭ 194 (+321.74%)
Mutual labels:  container, ecs
Ecs Nginx Proxy
Reverse proxy for AWS ECS. Lets you address your docker containers by sub domain.
Stars: ✭ 93 (+102.17%)
Mutual labels:  container, ecs
Aws Containers Task Definitions
Task Definitions for running common applications Amazon ECS
Stars: ✭ 210 (+356.52%)
Mutual labels:  container, ecs
terraform-aws-ecs-alb-service-task
Terraform module which implements an ECS service which exposes a web service via ALB.
Stars: ✭ 108 (+134.78%)
Mutual labels:  container, ecs
coreos-gpu-installer
Scripts to build and use a container to install GPU drivers on CoreOS Container Linux
Stars: ✭ 21 (-54.35%)
Mutual labels:  container
easy-container
A small PHP dependency injection container from Laravel Container, support PHP 5.3
Stars: ✭ 32 (-30.43%)
Mutual labels:  container
Config
PHP library for simple configuration management
Stars: ✭ 39 (-15.22%)
Mutual labels:  config
imagepullsecret-patcher
A simple Kubernetes client-go application that creates and patches imagePullSecrets to service accounts in all Kubernetes namespaces to allow cluster-wide authenticated access to private container registry.
Stars: ✭ 159 (+245.65%)
Mutual labels:  container
smallrye-config
SmallRye Config - A Java Configuration library
Stars: ✭ 74 (+60.87%)
Mutual labels:  config
docker-postgres-windows
No description or website provided.
Stars: ✭ 19 (-58.7%)
Mutual labels:  container
nvimrc
My Neovim configuration. Supports macOS and Linux.
Stars: ✭ 31 (-32.61%)
Mutual labels:  config
yaask
Make your yaml configurable with interactive configurations!
Stars: ✭ 15 (-67.39%)
Mutual labels:  config
terraform-aws-alb-ingress
Terraform module to provision an HTTP style ingress rule based on hostname and path for an ALB using target groups
Stars: ✭ 20 (-56.52%)
Mutual labels:  ecs
mozitools
Mozi Botnet related tools helping to unpack a sample, decode a configuration and track active Mozi nodes using DHT.
Stars: ✭ 23 (-50%)
Mutual labels:  config
renovate-config
My shareable config for @renovateapp
Stars: ✭ 28 (-39.13%)
Mutual labels:  config

ecs-gen

License Build Status

Inspired by docker-gen ecs-gen lets you generate config files from templates using AWS ECS cluster information. ecs-nginx-proxy uses ecs-gen to generate nginx config files.

Installation

Go

go get -u github.com/codesuki/ecs-gen

Docker

Use the codesuki/ecs-gen docker image.

Usage

usage: ecs-gen --cluster=CLUSTER --template=TEMPLATE --output=OUTPUT [<flags>]

docker-gen for AWS ECS.

Flags:
      --help                     Show context-sensitive help (also try --help-long and --help-man).
  -r, --region="ap-northeast-1"  AWS region.
  -c, --cluster=CLUSTER          ECS cluster name.
  -t, --template=TEMPLATE        Path to template file.
  -o, --output=OUTPUT            Path to output file.
      --task="ecs-nginx-proxy"   Name of ECS task containing nginx.
  -s, --signal="nginx -s reload"
                                 Command to run to signal change.
  -f, --frequency=30             Time in seconds between polling. Must be >0.
      --once                     Only execute the template once and exit.
      --version                  Show application version.

Using with Docker

When using the docker image directly you can set all parameters using environment variables:

  • ECS_GEN_REGION
  • ECS_GEN_CLUSTER
  • ECS_GEN_TEMPLATE
  • ECS_GEN_OUTPUT
  • ECS_GEN_TASK
  • ECS_GEN_SIGNAL
  • ECS_GEN_FREQUENCY
  • ECS_GEN_ONCE

Example

Fill a template once

Running the following on the commandline ecs-gen will query the specified cluster, execute the template and exit.

ecs-gen --once --region=ap-northeast-1 --cluster="Cluster name" --template=template.tmpl --output=output.conf

Continuously update a config

To keep a config up to date try a variation of the following.

ecs-gen --signal="nginx -s reload" --cluster=my-cluster --template=nginx.tmpl --output=/etc/nginx/conf.d/default.conf

Template parameters

For now the available parameters are limited to things needed to make a nginx reverse proxy. If there is demand any information available from the AWS ECS API can be exposed.

type Container struct {
    Name    string // first host (space delimited) in VIRTUAL_HOST
    Host    string // VIRTUAL_HOST environment variable
    Port    string
    Address string
    Env     map[string]string
}

Note: The Host field can contain more than one (space delimited) hostname - this is to allow for tasks to respond to more than one hostname (for instance, example.com and www.example.com). If using the nginx template, using the VIRTUAL_HOST string example.com www.example.com would result in a single upstream definition for example.com, and a server_name of example.com www.example.com, so that nginx responds to both (an advanced use case would be to use a regex definition for the second hostname).

TODO

  • Expose more information
  • Expose VIRTUAL_HOST under environment variables instead of Host
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].