Skip to content

Commit

Permalink
use opentofu instead
Browse files Browse the repository at this point in the history
  • Loading branch information
liyangau committed May 6, 2024
1 parent b698656 commit 80052df
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,29 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Setup OpenTofu
uses: opentofu/setup-opentofu@v1
with:
terraform_version: 1.8.0
terraform_wrapper: false
- name: Terraform fmt
tofu_version: 1.7.0
tofu_wrapper: false
- name: Terraform Format
id: fmt
run: terraform fmt -check
run: tofu fmt -check
continue-on-error: true
- name: Terraform Init
id: init
run: terraform init
run: tofu init
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ENDPOINT_URL_S3: ${{ secrets.AWS_ENDPOINT_URL_S3 }}
AWS_EC2_METADATA_DISABLED: true
- name: Terraform Validate
id: validate
run: terraform validate -no-color
run: tofu validate -no-color
- name: Terraform Plan
id: plan
run: terraform plan -no-color
run: tofu plan -no-color
continue-on-error: false
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -49,7 +48,7 @@ jobs:
- name: Terraform Apply
id: apply
if: github.event_name == 'push'
run: terraform apply -no-color -auto-approve -input=false
run: tofu apply -no-color -auto-approve -input=false
continue-on-error: false
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -61,7 +60,7 @@ jobs:
TF_VAR_exclude_mesh_control_plane: "true"
- name: Generate terraform output
id: output
run: terraform output -no-color -json > ./konnectTFOutput.json
run: tofu output -no-color -json > ./konnectTFOutput.json
continue-on-error: false
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,28 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Setup OpenTofu
uses: opentofu/setup-opentofu@v1
with:
terraform_version: 1.8.0
- name: Terraform fmt
tofu_version: 1.7.0
- name: Terraform Format
id: fmt
run: terraform fmt -check
run: tofu fmt -check
continue-on-error: true
- name: Terraform Init
id: init
run: terraform init
run: tofu init
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ENDPOINT_URL_S3: ${{ secrets.AWS_ENDPOINT_URL_S3 }}
AWS_EC2_METADATA_DISABLED: true
- name: Terraform Validate
id: validate
run: terraform validate -no-color
run: tofu validate -no-color
- name: Terraform Plan
id: plan
run: terraform plan -no-color
run: tofu plan -no-color
continue-on-error: false
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -49,7 +48,7 @@ jobs:
TF_VAR_exclude_mesh_control_plane: true
- uses: actions/github-script@v6
env:
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}"
PLAN: "OpenTofu\n${{ steps.plan.outputs.stdout }}"
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GH_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ provider "konnect" {
}

module "control-planes" {
source = "./modules/control-planes"
source = "./modules/control-planes"
}

module "gateway-configs" {
Expand Down

0 comments on commit 80052df

Please sign in to comment.