Custom action to handle multi-level terraform repositories.
- This repository does NOT handle configuring your AWS credentials for terraform.
- This project assumes that AWS credentials are present when executing Terraform commands.
- aws-actions/configure-aws-credentials can be used to configured credentials within a job.
Click input variable to nav to description
Input | Required |
---|---|
TFPATH |
yes |
REGION |
yes |
ACTION |
yes |
ACCESS_TOKEN |
yes |
REPO_OWNER |
yes |
REPO_NAME |
yes |
IS_MANUAL |
optional |
SLACK_WEBHOOK_URL |
required if IS_MANUAL is true |
The path/to/terraform configuration files. Does not default.
The AWS region to perform Terraform commands against. Does not default.
The action for Terraform to perform. Does not default.
Used for authenticating to the GitHub API for commenting on PRs. Currently, if destructive actions are present in the Terraform plan, the action will comment such on the PR with reference to the $TFPATH
and a link to the execution of the workflow to ensure these changes are intended.
Used for dynamically building the PR URL.
Used for dynamically building the PR URL.
Used for internal handling of the destructive plan function.
Used in tandem with IS_MANUAL
. Will send the destructive plan message to Slack if present.
- Non-manual execution.
uses: isabey-cogni/terraform-action@latest
with:
TFPATH: 'staging/iam/'
REGION: 'us-east-1'
ACTION: 'plan'
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
REPO_OWNER: 'isabey'
REPO_NAME: 'terraform-action'
- Manual execution.
uses: isabey-cogni/terraform-action@latest
with:
TFPATH: 'staging/iam/'
REGION: 'us-east-1'
ACTION: 'plan'
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
REPO_OWNER: 'isabey'
REPO_NAME: 'terraform-action'
IS_MANUAL: true
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}