Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/userbradley/action-terragrunt

Runs `terragrunt run-all` on a Directory
https://github.com/userbradley/action-terragrunt

Last synced: 28 days ago
JSON representation

Runs `terragrunt run-all` on a Directory

Awesome Lists containing this project

README

        

# GitHub Action: Terragrunt

This action runs terragrunt `run-all` against the directory you point it to.

## Quick Start (No modules)

```yaml
name: "Terragrunt: name"
on: [push]

jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Terragrunt
uses: userbradley/[email protected]
with:
directory: "terragrunt"
serviceAccount: "[email protected]"
```

## Quick Start (With Modules)

By adding in the `sshPrivateKey: ${{ secrets.SSH_KEY }}` it will run Terragrunt with the

```yaml
name: "Terragrunt: name"
on: [push]

jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Terragrunt
uses: userbradley/[email protected]
with:
directory: "terragrunt"
serviceAccount: "[email protected]"
sshPrivateKey: ${{ secrets.SSH_KEY }}
```

## Dry Run

Dry run is a feature that allows you to test the terragrunt and terraform without applying any changes

```yaml
name: "Terragrunt: name"
on: [push]

jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Terragrunt
uses: userbradley/[email protected]
with:
directory: "terragrunt"
serviceAccount: "[email protected]"
sshPrivateKey: ${{ secrets.SSH_KEY }}
dryRun: true
```

## Different location for the Provider file

```yaml
name: "Terragrunt: name"
on: [push]

jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Terragrunt
uses: userbradley/[email protected]
with:
directory: "terragrunt"
serviceAccount: "[email protected]"
sshPrivateKey: ${{ secrets.SSH_KEY }}
dryRun: true
providerFileLocation: "terraform/location/to/directory" #Do NOT prepend `provider.tf` - it works this out automagically
```

## Inputs

| Input Name | Required | Default Value | Example |
|------------------------|----------|-----------------------|----------------------------------------------------|
| `directory` | `yes` | `null` | `terraform/deployments/puppy-ui` |
| `providerFileLocation` | `no` | `terraform/templates` | `terraform/deployments/puppy-ui` |
| `sshPrivateKey` | `no` | `null` | `${{ secrets.SSH_KEY }}` |
| `dryRun` | `no` | `false` | `true` |

---

Built by Bradley