Skip to content

Commit

Permalink
improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
marwinbaumannsbp committed Mar 1, 2024
1 parent c7767ef commit 34b915f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 17 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,26 @@ 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)
username = optional(string, null)
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({
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 34b915f

Please sign in to comment.