Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to OpenTofu #281

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/ali-deploy-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Terraform
uses: hashicorp/setup-terraform@v2
uses: opentofu/setup-opentofu@v1
with:
terraform_version: 1.5.7
terraform_wrapper: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ali-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Terraform
uses: hashicorp/setup-terraform@v2
uses: opentofu/setup-opentofu@v1
with:
terraform_version: 1.5.7
terraform_wrapper: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ali-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Terraform
uses: hashicorp/setup-terraform@v2
uses: opentofu/setup-opentofu@v1
with:
terraform_version: 1.5.7
terraform_wrapper: false
Expand Down
2 changes: 1 addition & 1 deletion ali/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tflint:
cd modules ; for module in ./*/ ; do \
pushd $$module ; \
echo "==== START TFLINT: modules/$$module ============================================" ; \
terraform init && tflint --init && tflint --module --color --minimum-failure-severity=warning --recursive ; \
tofu init && tflint --init && tflint --module --color --minimum-failure-severity=warning --recursive ; \
echo "==== END TFLINT: modules/$$module ============================================" ; \
popd ; \
done
Expand Down
16 changes: 8 additions & 8 deletions ali/scripts/module_makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $(PROHOME)/tf-modules/VERSIONS: $(PROHOME)/venv/bin/pip $(PROHOME)/Terrafile
terrafile: $(PROHOME)/tf-modules/VERSIONS

.terraform/modules/modules.json: $(PROHOME)/tf-modules/VERSIONS backend.tf
terraform init
tofu init

.PHONY: init
init: .terraform/modules/modules.json
Expand Down Expand Up @@ -59,9 +59,9 @@ backend.tf: backend-state.tf

backend-state.tf: dyn_locals.tf external_k8s_cidr_ipv4.tf
sed "s/#AWS_REGION/$(REGION)/g" <$(PROHOME)/modules/backend-file/backend-state.tf >backend-state.tf
terraform get -update
terraform init -backend=false
terraform plan -input=false -out=backend.plan -detailed-exitcode -target=module.backend-state -lock-timeout=15m ; \
tofu get -update
tofu init -backend=false
tofu plan -input=false -out=backend.plan -detailed-exitcode -target=module.backend-state -lock-timeout=15m ; \
ext_code=$$? ; \
if [ $$ext_code -eq 2 ] ; then \
if [ "$$GITHUB_ACTIONS" != "true" ] ; then \
Expand All @@ -80,19 +80,19 @@ backend-state.tf: dyn_locals.tf external_k8s_cidr_ipv4.tf

.PHONY: plan
plan: .terraform/modules/modules.json
terraform plan $(TERRAFORM_EXTRAS)
tofu plan $(TERRAFORM_EXTRAS)

.PHONY: plan-canary
plan-canary: .terraform/modules/modules.json
terraform plan -target module.autoscaler-lambda-canary $(TERRAFORM_EXTRAS)
tofu plan -target module.autoscaler-lambda-canary $(TERRAFORM_EXTRAS)

.PHONY: apply
apply: .terraform/modules/modules.json
terraform apply ${TERRAFORM_EXTRAS}
tofu apply ${TERRAFORM_EXTRAS}

.PHONY: apply-canary
apply-canary: .terraform/modules/modules.json
terraform apply -target module.autoscaler-lambda-canary ${TERRAFORM_EXTRAS}
tofu apply -target module.autoscaler-lambda-canary ${TERRAFORM_EXTRAS}

.PHONY: destroy
destroy: .terraform/modules/modules.json
Expand Down
Loading