Skip to content

Commit

Permalink
Chore: partial docs for some of the resources (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerHeber authored Dec 13, 2023
1 parent 6c52a82 commit 7311faa
Show file tree
Hide file tree
Showing 25 changed files with 174 additions and 1 deletion.
10 changes: 10 additions & 0 deletions examples/data-sources/env0_agent_values/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "env0_project" "project" {
name = "project"
}

data "env0_agents" "agents" {}

resource "env0_agent_project_assignment" "gent_project_assignment" {
agent_id = data.env0_agents.agents.0.agent_key
project_id = env0_project.project.id
}
7 changes: 7 additions & 0 deletions examples/data-sources/env0_agents/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_agent_values" "agent_values" {
agent_key = "pr12"
}

output "values" {
value = data.env0_agent_values.agent_values.values
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_aws_cost_credentials" "aws_cost_credentials_by_name" {
name = "aws cost credentials"
}

data "env0_aws_cost_credentials" "aws_cost_credentials_by_id" {
id = "12345676safsd"
}
7 changes: 7 additions & 0 deletions examples/data-sources/env0_aws_credentials/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_aws_credentials" "aws_credentials_by_name" {
name = "aws credentials"
}

data "env0_aws_credentials" "aws_credentials_by_id" {
id = "12345676safsd"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_azure_cost_credentials" "azure_cost_credentials_by_name" {
name = "azure cost credentials"
}

data "env0_azure_cost_credentials" "azure_cost_credentials_by_id" {
id = "12345676safsd"
}
7 changes: 7 additions & 0 deletions examples/data-sources/env0_azure_credentials/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_azure_credentials" "azure_credentials_by_name" {
name = "azure credentials"
}

data "env0_azure_credentials" "azure_credentials_by_id" {
id = "12345676safsd"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ data "env0_aws_credentials" "aws_credentials" {
}

output "credentials_name" {
value = var.second_run ? data.env0_aws_credentials.aws_credentials["Test Role arn1"].name : ""
value = data.env0_aws_credentials.aws_credentials["Test Role arn1"].name
}
7 changes: 7 additions & 0 deletions examples/data-sources/env0_custom_flow/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_custom_flow" "custom_flow_by_name" {
name = "custom flow 12345"
}

data "env0_custom_flow" "custom_flow_by_id" {
id = "12345676safsd"
}
7 changes: 7 additions & 0 deletions examples/data-sources/env0_gcp_credentials/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_gcp_credentials" "gcp_credentials_by_name" {
name = "gcp credentials"
}

data "env0_gcp_credentials" "gcp_credentials_by_id" {
id = "12345676safsd"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_google_cost_credentials" "google_cost_credentials_by_name" {
name = "google cost credentials"
}

data "env0_google_cost_credentials" "google_cost_credentials_by_id" {
id = "12345676safsd"
}
7 changes: 7 additions & 0 deletions examples/data-sources/env0_gpg_key/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_gpg_key" "gpg_key_by_name" {
name = "gpg key fegsdfg"
}

data "env0_gpg_key" "gpg_key_by_id" {
id = "sdfsdxcvxc-sdfsd-fsdfsd-dsda"
}
7 changes: 7 additions & 0 deletions examples/data-sources/env0_project_policy/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_project" "project" {
name = "project"
}

data "env0_project_policy" "project_policy" {
project_id = data.env0_project.project.id
}
3 changes: 3 additions & 0 deletions examples/data-sources/env0_provider/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "env0_provider" "provider" {
id = "adsdasdasd-asdasdas"
}
7 changes: 7 additions & 0 deletions examples/data-sources/env0_team/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "env0_team" "by_id" {
id = "asdasdas-asdas-dasdsa"
}

data "env0_team" "by_name" {
name = "team-12345"
}
17 changes: 17 additions & 0 deletions examples/resources/env0_approval_policy_assignment/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
data "env0_project" "project" {
name = "project"
}

resource "env0_approval_policy" "approval_policy" {
name = "approval policy"
repository = "reopository"
github_installation_id = 4234234234
path = "misc/null-resource"

}

resource "env0_approval_policy_assignment" "approval_policy_assignment" {
scope = "PROJECT"
scope_id = data.env0_project.project.id
blueprint_id = env0_approval_policy.approval_policy.id
}
2 changes: 2 additions & 0 deletions examples/resources/env0_aws_cost_credentials/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
terraform import env0_aws_cost_credentials.by_id d31a6b30-5f69-4d24-937c-22322754934e
terraform import env0_aws_cost_credentials.by_name "cost credentials name"
5 changes: 5 additions & 0 deletions examples/resources/env0_aws_cost_credentials/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "env0_aws_cost_credentials" "aws_cost_credentials" {
name = "cost credentials"
arn = "arn"
duration = 3600
}
2 changes: 2 additions & 0 deletions examples/resources/env0_azure_cost_credentials/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
terraform import env0_azure_cost_credentials.by_id d31a6b30-5f69-4d24-937c-22322754934e
terraform import env0_azure_cost_credentials.by_name "cost credentials name"
7 changes: 7 additions & 0 deletions examples/resources/env0_azure_cost_credentials/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "env0_azure_cost_credentials" "azure_cost_credentials" {
name = "cost credentials"
client_id = "client id"
client_secret = "client secret"
subscription_id = "43242342dsdfsdfsdf"
tenant_id = "fsdf-fsdfdsfs-fsdfsdfsd-fsdfsd"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource "env0_azure_cost_credentials" "azure_cost_credentials" {
name = "cost credentials"
client_id = "client id"
client_secret = "client secret"
subscription_id = "43242342dsdfsdfsdf"
tenant_id = "fsdf-fsdfdsfs-fsdfsdfsd-fsdfsd"
}

resource "env0_project" "project" {
name = "project"
}

resource "env0_cost_credentials_project_assignment" "cost_project_assignment" {
credential_id = env0_azure_cost_credentials.azure_cost_credentials.id
project_id = env0_project.project.id
}
2 changes: 2 additions & 0 deletions examples/resources/env0_custom_flow/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
terraform import env0_custom_flow.by_id 29b8037a-f877-48f5-a60b-3152ae1a1405
terraform import env0_custom_flow.by_name custom-flow-name
10 changes: 10 additions & 0 deletions examples/resources/env0_custom_flow/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
data "env0_template" "github_template" {
name = "github_template"
}

resource "env0_custom_flow" "custom_flow" {
name = "Custom Flow"
repository = data.env0_template.github_template.repository
github_installation_id = data.env0_template.github_template.github_installation_id
path = "custom-flows/opa.yaml"
}
2 changes: 2 additions & 0 deletions examples/resources/env0_gcp_cost_credentials/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
terraform import env0_gcp_cost_credentials.by_id d31a6b30-5f69-4d24-937c-22322754934e
terraform import env0_gcp_cost_credentials.by_name "cost credentials name"
5 changes: 5 additions & 0 deletions examples/resources/env0_gcp_cost_credentials/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "env0_gcp_cost_credentials" "gcp_cost_credentials" {
name = "cost credentials"
table_id = "table id"
secret = "sdfsdfsdfsd"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "env0_notification" "notification" {
name = "notification"
type = "Slack"
value = "https://someurl.com"
}

resource "env0_project" "project" {
name = "project"
}

resource "env0_notification_project_assignment" "notification_project_assignment" {
project_id = env0_project.project.id
notification_endpoint_id = env0_notification.notification.id
event_names = ["environmentMarkedForAutoDestroy"]
}

0 comments on commit 7311faa

Please sign in to comment.