Skip to content

Commit

Permalink
feature: Support GitHub app for VCS connections, solve deprecation wa…
Browse files Browse the repository at this point in the history
…rnings
  • Loading branch information
marwinbaumannsbp committed Jan 10, 2025
1 parent 7256ef0 commit 37fe290
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ terraform {
}
tfe = {
source = "hashicorp/tfe"
version = ">= 0.51.0"
version = ">= 0.61.0"
}
tls = {
source = "hashicorp/tls"
Expand Down

0 comments on commit 37fe290

Please sign in to comment.