Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,43 @@ jobs:
}
]
```

## Terraform

This action runs Terraform commands against AWS environments. It handles AWS authentication by assuming roles based on the specified environment and executes Terraform init, validate, plan (for PRs), or apply (for deployments).

### Inputs

- `working-directory` - **Required** Working directory for Terraform commands.
- `environment` - **Required** AWS Environment to authenticate into. Supported values: `shared`, `dev`, `prod`, `audit`, `log_archive`, `sbx`, `uat`.
- `aws-region` - **Optional** AWS Region to authenticate into. Defaults to `us-east-2`.
- `is-pr-workflow` - **Required** Is PR workflow. Set to `true` to run validate and plan, or `false` to run apply.

### Example usage

```yaml
name: Terraform Deploy

on:
pull_request:
branches: [ master ]
push:
branches: [ master ]

jobs:
terraform:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3

- name: Run Terraform
uses: Basis-Theory/github-actions/terraform@master
with:
working-directory: ./infrastructure
environment: dev
aws-region: us-east-1
is-pr-workflow: ${{ github.event_name == 'pull_request' }}
```