-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42fd769
commit 7c28959
Showing
5 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
examples/resources/env0_environment_discovery_configuration/import.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
terraform import env0_environment_discovery_configuration.by_project_id 29b8037a-f877-48f5-a60b-3152ae1a1405 |
26 changes: 26 additions & 0 deletions
26
examples/resources/env0_environment_discovery_configuration/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
data "env0_project" "project" { | ||
name = "existing-project" | ||
} | ||
|
||
resource "env0_project" "new_project" { | ||
name = "new-project" | ||
} | ||
|
||
resource "env0_environment_discovery_configuration" "example" { | ||
project_id = data.env0_project.project.id | ||
glob_pattern = "**" | ||
repository = "https://github.com/env0/templates" | ||
opentofu_version = "1.6.7" | ||
github_installation_id = 12345 | ||
} | ||
|
||
resource "env0_environment_discovery_configuration" "terragrunt_example" { | ||
project_id = env0_project.new_project.id | ||
glob_pattern = "**" | ||
repository = "https://github.com/env0/blueprints" | ||
type = "terragrunt" | ||
terraform_version = "1.7.1" | ||
terragrunt_version = "0.67.4" | ||
terragrunt_tf_binary = "terraform" | ||
github_installation_id = 12345 | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/integration/032_environment_discovery_configuration/conf.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
terraform { | ||
backend "local" { | ||
} | ||
required_providers { | ||
env0 = { | ||
source = "terraform-registry.env0.com/env0/env0" | ||
} | ||
} | ||
} | ||
|
||
provider "env0" {} | ||
|
||
variable "second_run" {} |
1 change: 1 addition & 0 deletions
1
tests/integration/032_environment_discovery_configuration/expected_outputs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
30 changes: 30 additions & 0 deletions
30
tests/integration/032_environment_discovery_configuration/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
provider "random" {} | ||
|
||
resource "random_string" "random" { | ||
length = 8 | ||
special = false | ||
min_lower = 8 | ||
} | ||
|
||
resource "env0_project" "project" { | ||
name = "project-${random_string.random.result}" | ||
} | ||
|
||
data "env0_template" "github_template" { | ||
name = "Github Integrated Template" | ||
} | ||
|
||
resource "env0_template_project_assignment" "assignment" { | ||
template_id = data.env0_template.github_template.id | ||
project_id = env0_project.project.id | ||
} | ||
|
||
resource "env0_environment_discovery_configuration" "example" { | ||
project_id = data.env0_project.project.id | ||
glob_pattern = var.second_run ? "**" : "**/**" | ||
opentofu_version = "1.6.2" | ||
repository = data.env0_template.github_template.repository | ||
github_installation_id = data.env0_template.github_template.github_installation_id | ||
|
||
depends_on = [env0_template_project_assignment.assignment] | ||
} |