Add Terraform configuration for ClouDNS IAC with OpenTofu integration

This commit is contained in:
2025-04-25 19:51:17 +02:00
parent 2d50aa1820
commit cc15ff3247
9 changed files with 511 additions and 0 deletions
@@ -0,0 +1,35 @@
name: Terraform CLouDNS IAC Apply
on:
schedule:
- cron: "0 1 * * 0"
push:
branches:
- main
paths:
- "terraform/cloudns-iac/**"
jobs:
opentofu-apply:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Setup OpenTofu environment
uses: ./.github/actions/setup-opentofu-env
- name: OpenTofu Init and Apply
env:
BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }}
BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }}
BW_ACCESS_TOKEN: ${{ secrets.BW_ACCESS_TOKEN }}
run: |
cd terraform/cloudns-iac
sectool -f ../../sectool.json exec tofu init
sectool -f ../../sectool.json exec tofu apply --auto-approve
@@ -0,0 +1,39 @@
name: Terraform ClouDNS IAC Validate on Pull Request
on:
pull_request:
branches:
- main
paths:
- "terraform/cloudns-iac/**"
types:
- opened
- synchronize
- reopened
jobs:
terraform-validate:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment
uses: ./.github/actions/setup-env
- name: Setup OpenTofu environment
uses: ./.github/actions/setup-opentofu-env
- name: OpenTofu Init and Validate
env:
BW_PROJECT_ID: ${{ secrets.BW_PROJECT_ID }}
BW_ORGANIZATION_ID: ${{ secrets.BW_ORGANIZATION_ID }}
BW_ACCESS_TOKEN: ${{ secrets.BW_ACCESS_TOKEN }}
run: |
cd terraform/cloudns-iac
sectool -f ../../sectool.json exec tofu init
sectool -f ../../sectool.json exec tofu validate
sectool -f ../../sectool.json exec tofu fmt -check
sectool -f ../../sectool.json exec tofu plan