From 37fe29069349ef6fabd9679b6f83381d54b43fc8 Mon Sep 17 00:00:00 2001 From: Marwin Baumann Date: Fri, 10 Jan 2025 14:50:22 +0100 Subject: [PATCH] feature: Support GitHub app for VCS connections, solve deprecation warnings --- main.tf | 6 ++++-- variables.tf | 4 +++- versions.tf | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index a36dba5..542b132 100644 --- a/main.tf +++ b/main.tf @@ -176,7 +176,7 @@ module "tfe_workspace" { providers = { aws = aws.account } source = "schubergphilis/mcaf-workspace/aws" - version = "~> 2.1.1" + version = "~> 2.2.0" agent_pool_id = var.tfe_workspace.agent_pool_id agent_role_arns = var.tfe_workspace.agent_role_arns @@ -192,6 +192,7 @@ module "tfe_workspace" { description = var.tfe_workspace.description execution_mode = var.tfe_workspace.execution_mode file_triggers_enabled = var.tfe_workspace.connect_vcs_repo != false ? var.tfe_workspace.file_triggers_enabled : null + github_app_installation_id = var.tfe_workspace.connect_vcs_repo != false ? var.tfe_workspace.vcs_github_app_installation_id : null global_remote_state = var.tfe_workspace.global_remote_state name = coalesce(var.tfe_workspace.name, var.name) notification_configuration = var.tfe_workspace.notification_configuration @@ -227,7 +228,7 @@ module "additional_tfe_workspaces" { providers = { aws = aws.account } source = "schubergphilis/mcaf-workspace/aws" - version = "~> 2.1.1" + version = "~> 2.2.0" agent_pool_id = each.value.agent_pool_id != null ? each.value.agent_pool_id : var.tfe_workspace.agent_pool_id agent_role_arns = each.value.agent_role_arns != null ? each.value.agent_role_arns : var.tfe_workspace.agent_role_arns @@ -243,6 +244,7 @@ module "additional_tfe_workspaces" { description = each.value.description execution_mode = coalesce(each.value.execution_mode, var.tfe_workspace.execution_mode) file_triggers_enabled = each.value.connect_vcs_repo != false ? each.value.file_triggers_enabled : null + github_app_installation_id = each.value.connect_vcs_repo != false ? coalesce(each.value.vcs_github_app_installation_id, var.tfe_workspace.vcs_github_app_installation_id) : null global_remote_state = each.value.global_remote_state name = coalesce(each.value.name, each.key) notification_configuration = each.value.notification_configuration != null ? each.value.notification_configuration : var.tfe_workspace.notification_configuration diff --git a/variables.tf b/variables.tf index 83a20b8..46523eb 100644 --- a/variables.tf +++ b/variables.tf @@ -78,6 +78,7 @@ variable "additional_tfe_workspaces" { trigger_prefixes = optional(list(string)) username = optional(string) vcs_oauth_token_id = optional(string) + vcs_github_app_installation_id = optional(string) variable_set_ids = optional(map(string), {}) working_directory = optional(string) workspace_tags = optional(list(string)) @@ -182,7 +183,8 @@ variable "tfe_workspace" { trigger_patterns = optional(list(string)) trigger_prefixes = optional(list(string), ["modules"]) username = optional(string, "TFEPipeline") - vcs_oauth_token_id = string + vcs_oauth_token_id = optional(string) + vcs_github_app_installation_id = optional(string) variable_set_ids = optional(map(string), {}) working_directory = optional(string) workspace_tags = optional(list(string)) diff --git a/versions.tf b/versions.tf index c6388fa..5342d55 100644 --- a/versions.tf +++ b/versions.tf @@ -10,7 +10,7 @@ terraform { } tfe = { source = "hashicorp/tfe" - version = ">= 0.51.0" + version = ">= 0.61.0" } tls = { source = "hashicorp/tls"