diff --git a/main.tf b/main.tf index f6c1a7d..672a260 100644 --- a/main.tf +++ b/main.tf @@ -94,12 +94,14 @@ module "iam_role" { use_fullname = true - policy_documents = [ + policy_documents = var.create_sns_topic ? [ data.aws_iam_policy_document.config_s3_policy[0].json, data.aws_iam_policy_document.config_sns_policy[0].json + ] : [ + data.aws_iam_policy_document.config_s3_policy[0].json ] - policy_document_count = 2 + policy_document_count = var.create_sns_topic ? 2 : 1 policy_description = "AWS Config IAM policy" role_description = "AWS Config IAM role"