From 34b915f63d42fdfb8700d2fdfcdaa90ca3fc9057 Mon Sep 17 00:00:00 2001 From: Marwin Baumann Date: Fri, 1 Mar 2024 10:52:55 +0100 Subject: [PATCH] improve code --- main.tf | 2 +- variables.tf | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/main.tf b/main.tf index 0f8ac93..05214af 100644 --- a/main.tf +++ b/main.tf @@ -181,8 +181,8 @@ module "additional_tfe_workspaces" { global_remote_state = each.value.global_remote_state name = coalesce(each.value.name, each.key) notification_configuration = each.value.notification_configuration - oidc_settings = coalesce(each.value.auth_method, var.tfe_workspace.auth_method) == "iam_role_oidc" ? { provider_arn = aws_iam_openid_connect_provider.tfc_provider[0].arn } : null oauth_token_id = each.value.connect_vcs_repo != false ? coalesce(each.value.vcs_oauth_token_id, var.tfe_workspace.vcs_oauth_token_id) : null + oidc_settings = coalesce(each.value.auth_method, var.tfe_workspace.auth_method) == "iam_role_oidc" ? { provider_arn = aws_iam_openid_connect_provider.tfc_provider[0].arn } : null path = var.path permissions_boundary_arn = each.value.add_permissions_boundary == true ? aws_iam_policy.workspace_boundary[0].arn : null policy = each.value.policy diff --git a/variables.tf b/variables.tf index 8dad8bf..f6f07af 100644 --- a/variables.tf +++ b/variables.tf @@ -57,8 +57,6 @@ variable "additional_tfe_workspaces" { sensitive_env_variables = optional(map(string), {}) sensitive_hcl_variables = optional(map(object({ sensitive = string })), {}) sensitive_terraform_variables = optional(map(string), {}) - slack_notification_triggers = optional(list(string), null) - slack_notification_url = optional(string, null) ssh_key_id = optional(string, null) terraform_version = optional(string, null) trigger_prefixes = optional(list(string), null) @@ -66,12 +64,19 @@ variable "additional_tfe_workspaces" { vcs_oauth_token_id = optional(string, null) working_directory = optional(string, null) workspace_tags = optional(list(string), null) - + notification_configuration = optional(list(object({ destination_type = string enabled = optional(bool, true) url = string - triggers = optional(list(string), null) + triggers = optional(list(string), [ + "run:created", + "run:planning", + "run:needs_attention", + "run:applying", + "run:completed", + "run:errored", + ]) })), []) team_access = optional(map(object({ @@ -163,7 +168,14 @@ variable "tfe_workspace" { destination_type = string enabled = optional(bool, true) url = string - triggers = optional(list(string), null) + triggers = optional(list(string), [ + "run:created", + "run:planning", + "run:needs_attention", + "run:applying", + "run:completed", + "run:errored", + ]) })), []) team_access = optional(map(object({