Giter Club home page Giter Club logo

atlantis-gen-yaml's Introduction

atlantis-gen-yaml

this tool generates projects section for your atlantis.yaml file by parsing your terragrunt file(s) and dependencies.

example case

let's assume we have a example-acm dir with this files next to our atlantis.yaml

$ find . -type f
./example-acm/record/terragrunt.hcl
./example-acm/certificate/terragrunt.hcl
./example-acm/validation/terragrunt.hcl
./atlantis.yaml

and content

example-acm/certificate/terragrunt.hcl

terraform {
  source = "../src"
}

inputs = {
  fqdn = "my-new-domain.example.com"
}

example-acm/record/terragrunt.hcl

terraform {
  source = "../src"
}

dependency "cert" {
  config_path = "../certificate"

  mock_outputs = {
    valid_name  = "fooBar"
    valid_type  = "CNAME"
    valid_value = "fooBar"
  }
}

inputs = {
  name  = dependency.cert.outputs.valid_name
  type  = dependency.cert.outputs.valid_type
  value = dependency.cert.outputs.valid_value
}

example-acm/validation/terragrunt.hcl

terraform {
  source = "../src"
}

dependencies {
  paths = ["../record"]
}

dependency "cert" {
  config_path = "../certificate"

  mock_outputs = {
    arn = "fooBar"
  }
}

inputs = {
  arn = dependency.cert.outputs.arn
}

running the binary

$ gen-atlantis-yaml -path example-acm

will produce YAML file with all dependencies from your terragrunt.hcl file(s).

projects:
- autoplan:
    enabled: true
    when_modified:
      - '*.hcl'
      - '*.tf*'
  dir: example-acm/certificate
  workflow: terragrunt
- autoplan:
    enabled: true
    when_modified:
      - '*.hcl'
      - '*.tf*'
      - ../certificate
  dir: example-acm/record
  workflow: terragrunt
- autoplan:
    enabled: true
    when_modified:
      - '*.hcl'
      - '*.tf*'
      - ../certificate
      - ../record
  dir: example-acm/validation
  workflow: terragrunt

custom atlantis config?

you can include custom atlantis variables by adding them to .atlantis-conf.yaml file e.q.

automerge: true
parallel_apply: false
parallel_plan: false
version: 3

would produce an atlantis.yaml file with the extra config files.

automerge: true
parallel_apply: false
parallel_plan: false
version: 3
projects:
- autoplan:
    enabled: true
    when_modified:
      - '*.hcl'
      - '*.tf*'
  dir: example-acm/certificate
  workflow: terragrunt
- autoplan:
    enabled: true
    when_modified:
      - '*.hcl'
      - '*.tf*'
      - ../certificate
  dir: example-acm/record
  workflow: terragrunt
- autoplan:
    enabled: true
    when_modified:
      - '*.hcl'
      - '*.tf*'
      - ../certificate
      - ../record
  dir: example-acm/validation
  workflow: terragrunt

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.