Skip to content

Commit 4ef6a55

Browse files
SSPROD-55654 - include/exclude: add deprecation date for management_group_ids var
1 parent 34a615b commit 4ef6a55

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

modules/onboarding/locals.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ locals {
77
length(var.exclude_projects) > 0
88
)
99

10+
# add 'folders/' prefix to the include/exclude folders
11+
prefixed_include_folders = [for folder_id in var.include_folders : "folders/${folder_id}"]
12+
prefixed_exclude_folders = [for folder_id in var.exclude_folders : "folders/${folder_id}"]
13+
1014
# check if old management_group_ids parameter is provided, for backwards compatibility we will always give preference to it
1115
check_old_management_group_ids_param = var.is_organizational && length(var.management_group_ids) > 0
1216

modules/onboarding/organizational.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ resource "sysdig_secure_organization" "google_organization" {
3232
management_account_id = sysdig_secure_cloud_auth_account.google_account.id
3333
organizational_unit_ids = local.check_old_management_group_ids_param ? var.management_group_ids : []
3434
organization_root_id = local.root_org[0]
35-
included_organizational_groups = local.check_old_management_group_ids_param ? [] : var.include_folders
36-
excluded_organizational_groups = local.check_old_management_group_ids_param ? [] : var.exclude_folders
35+
included_organizational_groups = local.check_old_management_group_ids_param ? [] : local.prefixed_include_folders
36+
excluded_organizational_groups = local.check_old_management_group_ids_param ? [] : local.prefixed_exclude_folders
3737
included_cloud_accounts = local.check_old_management_group_ids_param ? [] : var.include_projects
3838
excluded_cloud_accounts = local.check_old_management_group_ids_param ? [] : var.exclude_projects
3939
depends_on = [

modules/onboarding/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ variable "organization_domain" {
1818
variable "management_group_ids" {
1919
description = <<-EOF
2020
TO BE DEPRECATED on 30th November, 2025: Please work with Sysdig to migrate to using `include_folders` instead.
21-
When set, restrict onboarding to a set of folder identifiers whose child projects and projects are to be onboarded.
21+
When set, restrict onboarding to a set of folder identifiers whose child projects and projects are to be onboarded. e.g. ["organizations/123456789012"], ["folders/123456789012"]
2222
Default: onboard all folders.
2323
EOF
2424
type = set(string)
@@ -32,13 +32,13 @@ variable "suffix" {
3232
}
3333

3434
variable "include_folders" {
35-
description = "(Optional) folders to include for organization in the format 'folders/{folder_id}' i.e: folders/123456789012"
35+
description = "(Optional) folders to include for organization in the format '[{folder_id_one}, {folder_id_two}]' i.e: '[\"123456789012\", \"123456789012\"]'"
3636
type = set(string)
3737
default = []
3838
}
3939

4040
variable "exclude_folders" {
41-
description = "(Optional) folders to exclude for organization in the format 'folders/{folder_id}' i.e: folders/123456789012"
41+
description = "(Optional) folders to exclude for organization in the format '[{folder_id_one}, {folder_id_two}]' i.e: '[\"123456789012\", \"123456789012\"]'"
4242
type = set(string)
4343
default = []
4444
}

0 commit comments

Comments
 (0)