https://github.com/scalefreecom/tfautomation_templates
https://github.com/scalefreecom/tfautomation_templates
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/scalefreecom/tfautomation_templates
- Owner: ScalefreeCOM
- Created: 2023-08-24T10:29:12.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T10:46:20.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T12:44:07.805Z (almost 2 years ago)
- Size: 202 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TFAutomation_templates
Find the detailed documentation for reusable workflows [here](https://wiki.scalefree.net/it/devops/reusable-workflows).
### Usage
Create a file in the path .github/workflows, example down below.
```yaml
name: 'Build'
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
branches:
- main
jobs:
call-workflow:
strategy:
matrix:
target: [./, ./common, ./network]
uses: ScalefreeCOM/TFAutomation_templates/.github/workflows/terraform-build.yml@main
with:
region: eu-west-3
tf_version: "1.5.4"
working_directory: ${{ matrix.target }}
secrets: inherit
permissions:
contents: read
```
> [!NOTE]
> **on**: when workflow is triggered
> **uses**: path to reusable workflow
> **with**: inputs for reusable workflow
If you have multiple directories use the matrix strategy:
```yaml
strategy:
matrix:
target: [./, ./common, ./network]
```
replace your directories with those in the example.
### Inputs for different templates:
terraform-build.yml
[Example](https://github.com/ScalefreeCOM/TFAutomation_templates/blob/main/examples/terraform-build.yml)
| input name | default | required |
|------------|---------------|----------|
| runs-on | ubuntu-latest | no |
| region | eu-west-1 | no |
| cloud_provider | aws | specific for provider |
| tf_version | - | yes |
| working_directory | - | yes |
| secrets | requires |
|---------|----------|
| TFAUTOMATION_AWS_ACCESS_KEY | yes |
| TFAUTOMATION_AWS_SECRET_ACCESS_KEY | yes |
terraform-deploy.yml
[Example](https://github.com/ScalefreeCOM/TFAutomation_templates/blob/main/examples/terraform-deploy.yml)
| input name | default | required |
|------------|---------------|----------|
| runs-on | ubuntu-latest | no |
| region | eu-west-1 | no |
| cloud_provider | aws | specific for provider |
| tf_version | - | yes |
| working_directory | - | yes |
| approvers | - | yes |
| minimum-approvals | 2 | no |
| issue-title | Deploying | no |
| issue-body | Please approve or deny the deployment | no |
| secrets | requires |
|---------|----------|
| TFAUTOMATION_AWS_ACCESS_KEY | yes |
| TFAUTOMATION_AWS_SECRET_ACCESS_KEY | yes |
docker-image-build-push.yml
[Example](https://github.com/ScalefreeCOM/TFAutomation_templates/blob/main/examples/build-push-image.yml)
| input name | default | required |
|------------|---------------|----------|
| runs-on | ubuntu-latest | no |
| region | eu-west-1 | no |
| ecr-repo | - | yes |
| image_tag | latest | no |
| secrets | requires |
|---------|----------|
| TFAUTOMATION_AWS_ACCESS_KEY | yes |
| TFAUTOMATION_AWS_SECRET_ACCESS_KEY | yes |