From bc8ab80410a962a494576fd5f5fafecc433b50d7 Mon Sep 17 00:00:00 2001 From: Dan Palmer <93133148+danielpalmeribm@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:24:44 +0100 Subject: [PATCH] Update variables.tf (#146) * Update variables.tf * Update main.tf --- modules/aws/ai_opt_out/main.tf | 20 +++++++++++++++++++- modules/aws/ai_opt_out/variables.tf | 15 +-------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/modules/aws/ai_opt_out/main.tf b/modules/aws/ai_opt_out/main.tf index 4caede2..49d38c2 100644 --- a/modules/aws/ai_opt_out/main.tf +++ b/modules/aws/ai_opt_out/main.tf @@ -2,7 +2,25 @@ resource "aws_organizations_policy" "ai_services_opt_out" { name = var.policy_name description = var.policy_description type = "AISERVICES_OPT_OUT_POLICY" - content = var.services_overrides + content = jsonencode({ + services = { + "@@operators_allowed_for_child_policies" = [ + "@@none" + ] + default = { + "@@operators_allowed_for_child_policies" = [ + "@@none" + ] + opt_out_policy = { + "@@assign" = "optOut" + "@@operators_allowed_for_child_policies" = [ + "@@none" + ] + } + } + } + } + ) } diff --git a/modules/aws/ai_opt_out/variables.tf b/modules/aws/ai_opt_out/variables.tf index f9ba88f..8f7c34d 100644 --- a/modules/aws/ai_opt_out/variables.tf +++ b/modules/aws/ai_opt_out/variables.tf @@ -16,18 +16,5 @@ variable "apply_to_ous_or_accounts" { default = [] } -variable "services_overrides" { -{ - "services": { - "@@operators_allowed_for_child_policies": ["@@none"], - "default": { - "@@operators_allowed_for_child_policies": ["@@none"], - "opt_out_policy": { - "@@operators_allowed_for_child_policies": ["@@none"], - "@@assign": "optOut" - } - } - } -} -} +