Code Monkey home page Code Monkey logo

cco-tf-demo's Introduction

Terraform/Atlantis Demo for Clear Channel Outdoor

Prerequisites

1. Deploy Infrastructure

  1. You must have an IAM user set up with the following IAM policies attached:
    • PowerUser
    • IAMFullAccess
  2. Generate access credentials (in the form of a user access key and a secret key) for the above user.
  3. Use the following commands to tell Terraform to deploy infrastructure with your user:
    • export AWS_ACCESS_KEY_ID=<access key from above step>
    • export AWS_SECRET_ACCESS_KEY=<secret access key>
  4. Change into the infrastructure directory using cd infrastructure.
  5. terraform init
  6. terraform plan -var-file=staging.tfvars
  7. After verifying everything looks good from the above plan, run a terraform apply -var-file=staging.tfvars and confirm.
  8. Make sure infrastructure deploys correctly.

2. Deploy Atlantis

  1. Configure the following environment variables so you are not passing these variables as plaintext in to this Github repository. Instructions for creating a Github user token can be found here, while instructions for generating the webhook secret can be found here:
    • export TF_VAR_github_user_token=<token>
    • export TF_VAR_github_webhook_secret=<secret>
  2. Change into the Atlantis directory using cd atlantis.
  3. terraform plan (no environment file this time as it's using the infrastructure you set up above)
  4. terraform apply
  5. Make sure infrastructure deploys correctly.

3. Configure Webhook

  1. You must own a domain that Atlantis can use to interface with. This repository is using "aws.laiello.com" for demonstration purposes, but you will need your own if you fork this repository or wish to use it for a different project. Once you have it created, make sure you change the variable in atlantis/variables.tf to match the new domain.
  2. You must create an ACM certificate to allow HTTPS using the domain you created above.
  3. Configure the webhook as shown in this document. The URL in this case is aws.laiello.com (and is actually configured for this repo in that way) but if you use your own domain, this must be changed to reflect the new domain.

Usage

  1. Create a branch with your infrastructure changes. For example: git checkout -b branch-name-here.
  2. Make and push changes.
  3. Once finished, create a PR.
  4. Atlantis is used within the PR. Please follow these docs which explain how to use Atlantis.
  5. Close the PR and delete the branch. This step can be automated by modifying the atlantis.yaml file. Set automerge: true.

cco-tf-demo's People

Watchers

Diviyansh Bhatnagar avatar Nasir Nooruddin avatar Joe Conlin avatar James Cloos avatar James Connell avatar Joey Yore avatar  avatar Ravi Rajamani avatar Aleksander Hansson avatar Krunal Rasik Patel avatar Percy Shadrach avatar derek baltazar avatar Dustin Snyder avatar  avatar  avatar Dan R avatar Sudhanshu patel avatar  avatar Kenneth Farr III avatar Asif Mohammad avatar Pranay Singh avatar Aimee Foster  avatar Shubham Seervi avatar  avatar Erik J Brown avatar  avatar Alex Kim Meng Ng (Alex KM) avatar  avatar  avatar Jonathan Eropkin avatar Russell Teater avatar Aman Kumar Singh avatar Jonathan Langlois avatar Akash Thawait avatar  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.