From 20ccb16a723cdd6a95ef69d4499e8188300f7553 Mon Sep 17 00:00:00 2001 From: Marcelo Luiz Onhate Date: Tue, 12 Nov 2024 11:34:13 -0300 Subject: [PATCH] Chore: Integration test for the bug not possible to use OpenTofu as backend for Terragrunt via env0 Terraform provider (#974) * chore: Integration test for the bug not possible to use OpenTofu as backend for Terragrunt via env0 Terraform provider * chore: Integration test for the bug not possible to use OpenTofu as backend for Terragrunt via env0 Terraform provider --- .../conf.tf | 15 +++++++++ .../expected_outputs.json | 1 + .../main.tf | 31 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 tests/integration/036_environment_without_template_settings_terragrunt_opentofu/conf.tf create mode 100644 tests/integration/036_environment_without_template_settings_terragrunt_opentofu/expected_outputs.json create mode 100644 tests/integration/036_environment_without_template_settings_terragrunt_opentofu/main.tf diff --git a/tests/integration/036_environment_without_template_settings_terragrunt_opentofu/conf.tf b/tests/integration/036_environment_without_template_settings_terragrunt_opentofu/conf.tf new file mode 100644 index 00000000..8d6d2954 --- /dev/null +++ b/tests/integration/036_environment_without_template_settings_terragrunt_opentofu/conf.tf @@ -0,0 +1,15 @@ +terraform { + backend "local" { + } + required_providers { + env0 = { + source = "terraform-registry.env0.com/env0/env0" + } + } +} + +provider "env0" {} + +variable "second_run" { + default = false +} diff --git a/tests/integration/036_environment_without_template_settings_terragrunt_opentofu/expected_outputs.json b/tests/integration/036_environment_without_template_settings_terragrunt_opentofu/expected_outputs.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/tests/integration/036_environment_without_template_settings_terragrunt_opentofu/expected_outputs.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/tests/integration/036_environment_without_template_settings_terragrunt_opentofu/main.tf b/tests/integration/036_environment_without_template_settings_terragrunt_opentofu/main.tf new file mode 100644 index 00000000..54e966f1 --- /dev/null +++ b/tests/integration/036_environment_without_template_settings_terragrunt_opentofu/main.tf @@ -0,0 +1,31 @@ +provider "random" {} + +resource "random_string" "random" { + length = 8 + special = false + min_lower = 8 +} + +resource "env0_project" "project" { + name = "project-environment-without_template-${random_string.random.result}" + force_destroy = true +} + +resource "env0_environment" "environment" { + name = "environment-without_template-${random_string.random.result}" + project_id = env0_project.project.id + is_remote_backend = false + force_destroy = true + + without_template_settings { + description = "Core Azure" + repository = "https://github.com/env0/templates" + path = "terragrunt/misc/null-resource" + opentofu_version = "1.8.1" + terragrunt_version = "0.64.5" + type = "terragrunt" + revision = "master" + is_terragrunt_run_all = true + terragrunt_tf_binary = "opentofu" + } +} \ No newline at end of file