Coder Social home page Coder Social logo

ansible-curology's Introduction

Deploy containers using Elastic Container Service using CloudFormation and ansible

Getting started with ansible cloudformation module

Requirements

The below requirements are needed on the host that executes this module.

1.boto 2.boto3 3.botocore>=1.5.45 4.python >= 2.6

Setup ansible vault for your aws secrets and access keys

ansible-vault create <name-of-file.yml> add your access and secret keys to the yml file.

Commands to run the ECS-CLUSTER using your secrets

ansible-playbook ansible-cloudformation-cluster.yml --vault-id @prompt

Commannd to run the ECS-SERVICE using your secrets

ansible-playbook ansible-cloudformation-service.yml --vault-id @prompt

Several combinations of template are available in this folder. You can deploy containers with two different networking approaches:

  • Public VPC subnet with direct internet access
  • A public facing load balancer that accepts traffic from anyone on the internet (ideal for a public facing web service)

To use this template to launch a EC2 instance cluster Then launch a service template for the EC2 Instance service you want to run in the cluster. When launching a service template its important to make sure the "StackName" value is filled in with the same name that you selected for the name of your cluster stack.

Each of the service stacks has default values prefilled for launching a simple Nginx container, but can be adjusted to launch your own container.

Fully Public Container

public subnet public load balancer

This architecture deploys your container into its own VPC, inside a public facing network subnet. The containers are hosted with direct access to the internet, and they are also accessible to other clients on the internet via a public facing appliation load balancer.

Run on EC2

  1. Launch the [fully public](ansible-playbook ansible-cloudformation-cluster.yml --vault-id @prompt)
  2. Launch the [public facing service template](ansible-playbook ansible-cloudformation-service.yml --vault-id @prompt).

Service can be accessed

Look up the Elastic Loadbalancer DNS under the EC2 service a DNS A record has been created, kindly refer to the images.

Clean up

Access cloudformation service and delete the service stack first and then the cluster created

TODO

Explore using ec2_elb_info ansible module โ€“ Gather information about EC2 Elastic Load Balancers in AWS so we could display ELB info in the console

ansible-curology's People

Contributors

jedi132000 avatar

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.