Giter VIP home page Giter VIP logo

terraform-amazon-ecs's Introduction

Terraform AWS ECS (+ Docker Registry)

Note - This is still a work in progress, so expect issues and bugs .. Feel free to jump in and start fixing things.

This repo contains a Terraform plan to run up an Amazon ECS cluster with a private Docker registry.

Inspired from http://blog.codeship.com/running-a-private-docker-registry-on-ec2/

Includes -

  • Private S3 bucket for container registry data
  • Docker container running allingeek/registry:2-s3 (by default)
  • ECS cluster, launch configuration and autoscaling group

### Prerequisites

### Usage

  1. Clone the repo
  2. Set some required variables -
export TF_VAR_key_name=name of ssh key
export TF_VAR_key_file=the ssh key file to use
export TF_VAR_aws_access_key=The AWS access key ID
export TF_VAR_aws_secret_key=The AWS secret key

Run the plan -

terraform apply

Alternatively the variables can be passed on the command line e.g. -

terraform apply -var 'key_name=name' -var 'key_file=path_to_file' -var 'aws_access_key=access_key' -var 'aws_secret_key=secret_key'

For a full list of overridable variables see variables.tf

### Known issues

If you are using terraform v0.6.3 and encounter this error -

* aws_ecs_service.s3-registry-elb: InvalidParameterException: Unable to assume role and validate the listeners configured on your load balancer.  Please verify the role being passed has the proper permissions.
  status code: 400, request id: []

This is probably down to this bug / issue with waits/timeouts - hashicorp/terraform#2869.

You can either compile terraform from the latest master branch, or re-run the terraform apply again which should succeed the second time.

terraform-amazon-ecs's People

Contributors

assimovt avatar dennari avatar pete0emerson avatar tayzlor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-amazon-ecs's Issues

Use IAM roles not ENV vars for s3 perms

Wouldn't it be better to have an IAM roll with a policy for s3 access assigned to the container/instance rather than secrets in the Environment variables?

question regarding error

i am trying the project and getting this error after adapting it a little bit:

* aws_elb.s3-registry-elb: [WARN] Error looking up ELB Security Group ID: No security groups found for name amazon-elb-sg and vpc id

do you know why this is happening?

I assign on the elb the security groups with:

security_groups = ["${aws_security_group.ecs.id}"]

but still getting the same error and on the state security_groups.# = 0 and it has the source_security_group = amazon-elb-sg

Incorporate VPC

At the moment we've not provisioned a VPC (which is by default what happens if you use the ECS wizard)

We should incorporate the VPC setup into here similar to the UI launch wizard

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.