Skip to content

Commit

Permalink
feat(terraform-cloud): cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
  • Loading branch information
nlamirault committed Sep 6, 2024
1 parent 0fb28ea commit 5b3df81
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 10 deletions.
8 changes: 7 additions & 1 deletion terraform/alicloud/terraform-cloud/workspaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ resource "tfe_workspace" "alicloud" {
global_remote_state = true
trigger_prefixes = each.value.trigger
allow_destroy_plan = true
execution_mode = each.value.execution_mode
auto_apply = each.value.auto_apply
terraform_version = "latest"
tag_names = each.value.tags
}

resource "tfe_workspace_settings" "alicloud" {
for_each = var.workspaces

workspace_id = tfe_workspace.alicloud[each.key].id
execution_mode = each.value.execution_mode
}

resource "tfe_variable" "alicloud_acces_key" {
for_each = tfe_workspace.alicloud

Expand Down
8 changes: 7 additions & 1 deletion terraform/aws/terraform-cloud/workspaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ resource "tfe_workspace" "aws" {
global_remote_state = true
trigger_prefixes = each.value.trigger
allow_destroy_plan = true
execution_mode = each.value.execution_mode
auto_apply = each.value.auto_apply
terraform_version = "latest"
tag_names = each.value.tags
}

resource "tfe_workspace_settings" "aws" {
for_each = var.workspaces

workspace_id = tfe_workspace.aws[each.key].id
execution_mode = each.value.execution_mode
}

# resource "tfe_variable" "aws_acces_key" {
# for_each = tfe_workspace.aws

Expand Down
8 changes: 7 additions & 1 deletion terraform/azure/terraform-cloud/workspaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ resource "tfe_workspace" "azure" {
global_remote_state = true
trigger_prefixes = each.value.trigger
allow_destroy_plan = true
execution_mode = each.value.execution_mode
auto_apply = each.value.auto_apply

tag_names = each.value.tags
}

resource "tfe_workspace_settings" "azure" {
for_each = var.workspaces

workspace_id = tfe_workspace.azure[each.key].id
execution_mode = each.value.execution_mode
}

resource "tfe_variable" "arm_subscription_id" {
for_each = tfe_workspace.azure

Expand Down
8 changes: 7 additions & 1 deletion terraform/civo/terraform-cloud/workspaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ resource "tfe_workspace" "this" {
global_remote_state = true
trigger_prefixes = each.value.trigger
allow_destroy_plan = true
execution_mode = each.value.execution_mode
auto_apply = each.value.auto_apply

tag_names = each.value.tags
}

resource "tfe_workspace_settings" "this" {
for_each = var.workspaces

workspace_id = tfe_workspace.this[each.key].id
execution_mode = each.value.execution_mode
}

resource "tfe_variable" "env_civo_token" {
for_each = tfe_workspace.this

Expand Down
8 changes: 7 additions & 1 deletion terraform/digitalocean/terraform-cloud/workspaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ resource "tfe_workspace" "this" {
global_remote_state = true
trigger_prefixes = each.value.trigger
allow_destroy_plan = true
execution_mode = each.value.execution_mode
auto_apply = each.value.auto_apply

tag_names = each.value.tags
}

resource "tfe_workspace_settings" "this" {
for_each = var.workspaces

workspace_id = tfe_workspace.this[each.key].id
execution_mode = each.value.execution_mode
}

resource "tfe_variable" "env_do_token" {
for_each = tfe_workspace.this

Expand Down
8 changes: 7 additions & 1 deletion terraform/exoscale/terraform-cloud/workspaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ resource "tfe_workspace" "this" {
global_remote_state = true
trigger_prefixes = each.value.trigger
allow_destroy_plan = true
execution_mode = each.value.execution_mode
auto_apply = each.value.auto_apply

tag_names = each.value.tags
}

resource "tfe_workspace_settings" "this" {
for_each = var.workspaces

workspace_id = tfe_workspace.this[each.key].id
execution_mode = each.value.execution_mode
}

resource "tfe_variable" "env_exo_api_key" {
for_each = tfe_workspace.this

Expand Down
7 changes: 6 additions & 1 deletion terraform/gcp/terraform-cloud/workspaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,17 @@ resource "tfe_workspace" "gcp" {
global_remote_state = true
trigger_prefixes = each.value.trigger
allow_destroy_plan = true
execution_mode = each.value.execution_mode
auto_apply = each.value.auto_apply

tag_names = each.value.tags
}

resource "tfe_workspace_settings" "gcp" {
for_each = var.workspaces

workspace_id = tfe_workspace.gcp[each.key].id
execution_mode = each.value.execution_mode
}

resource "tfe_variable" "gcp_credentials" {
for_each = tfe_workspace.gcp
Expand Down
8 changes: 7 additions & 1 deletion terraform/k3s/terraform-cloud/workspaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ resource "tfe_workspace" "this" {
global_remote_state = true
trigger_prefixes = each.value.trigger
allow_destroy_plan = true
execution_mode = each.value.execution_mode
auto_apply = each.value.auto_apply

tag_names = each.value.tags
}

resource "tfe_workspace_settings" "this" {
for_each = var.workspaces

workspace_id = tfe_workspace.this[each.key].id
execution_mode = each.value.execution_mode
}
8 changes: 7 additions & 1 deletion terraform/scaleway/terraform-cloud/workspaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ resource "tfe_workspace" "this" {
global_remote_state = true
trigger_prefixes = each.value.trigger
allow_destroy_plan = true
execution_mode = each.value.execution_mode
auto_apply = each.value.auto_apply

tag_names = each.value.tags
}

resource "tfe_workspace_settings" "this" {
for_each = var.workspaces

workspace_id = tfe_workspace.this[each.key].id
execution_mode = each.value.execution_mode
}

resource "tfe_variable" "scw_access_key" {
for_each = tfe_workspace.this

Expand Down
8 changes: 7 additions & 1 deletion terraform/vultr/terraform-cloud/workspaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ resource "tfe_workspace" "this" {
global_remote_state = true
trigger_prefixes = each.value.trigger
allow_destroy_plan = true
execution_mode = each.value.execution_mode
auto_apply = each.value.auto_apply

tag_names = each.value.tags
}

resource "tfe_workspace_settings" "this" {
for_each = var.workspaces

workspace_id = tfe_workspace.this[each.key].id
execution_mode = each.value.execution_mode
}

resource "tfe_variable" "env_vultr_api_key" {
for_each = tfe_workspace.this

Expand Down

0 comments on commit 5b3df81

Please sign in to comment.