Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/c0x12c/gh-actions-terraform-workflows
https://github.com/c0x12c/gh-actions-terraform-workflows
actions
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/c0x12c/gh-actions-terraform-workflows
- Owner: c0x12c
- Created: 2024-09-13T17:41:34.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-09-16T04:55:44.000Z (2 months ago)
- Last Synced: 2024-10-02T06:43:16.429Z (about 2 months ago)
- Topics: actions
- Language: Shell
- Homepage:
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gh-actions-terraform-workflows
This repository provides a collection of reusable composite GitHub Actions for managing Terraform operations (`plan`, `apply`, etc.) across different environments (`dev`, `prod`, `stage`, etc.). These actions are designed to integrate with AWS and securely manage secrets.
## Available Composite Actions
### 1. `pull-request` (Terraform Plan)
The `pull-request` composite action runs `terraform plan` for the specified environment. It sets up AWS credentials, manages environment-specific secrets, and performs Terraform actions such as formatting, validation, and planning.#### Inputs
| Input Name | Description | Required | Default |
|---------------------|----------------------------------------------|----------|----------|
| `app-id` | GitHub App ID | `true` | |
| `aws-region` | AWS region to use (e.g., `us-west-2`) | `true` | |
| `aws-role` | The AWS role to assume for the environment | `true` | |
| `environment` | The environment to use (e.g., `dev`, `prod`) | `true` | |
| `private-key` | GitHub App Private Key | `true` | |
| `python-version` | Python version to use | `false` | `3.12` |
| `terraform-version` | Terraform version to use | `false` | `1.8.4` |
| `working-dir` | The working directory for Terraform files | `true` | |#### Example Usage
```yaml
jobs:
terraform-plan:
runs-on: ubuntu-latest
steps:
- name: Run Terraform Plan
uses: your-username/gh-actions-terraform-workflows/.github/actions/[email protected]
with:
app-id: ${{ secrets.GITHUB_APP_ID }}
aws-region: ${{ secrets.AWS_REGION }}
aws-role: ${{ secrets.AWS_ROLE_TO_ASSUME_DEV }}
environment: dev
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
python-version: "3.12"
terraform-version: "1.8.4"
working-dir: terraform/environments/dev