From 25d43ec1e495ad19cc3f2fbaa8a365404d2eb0a4 Mon Sep 17 00:00:00 2001 From: Lei Jin <166442440+leijin-lw@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:06:25 -0800 Subject: [PATCH] fix: Disable aws_vpc_log creation in go-sdk (#1684) * fix: Disable aws_vpc_log creation in go-sdk Signed-off-by: Lei Jin * fix: Fix the lint error Signed-off-by: Lei Jin --------- Signed-off-by: Lei Jin --- lwgenerate/aws/aws.go | 5 ++++- lwgenerate/aws/aws_test.go | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lwgenerate/aws/aws.go b/lwgenerate/aws/aws.go index fbb8c9ecb..83dcb53c2 100644 --- a/lwgenerate/aws/aws.go +++ b/lwgenerate/aws/aws.go @@ -1368,7 +1368,8 @@ func createAgentless(args *GenerateAwsTfConfigurationArgs) ([]*hclwrite.Block, e "lacework_aws_agentless_scanning_global", lwgenerate.AwsAgentlessSource, lwgenerate.HclModuleWithVersion(lwgenerate.AwsAgentlessVersion), - lwgenerate.HclModuleWithAttributes(map[string]interface{}{"global": true, "regional": true}), + lwgenerate.HclModuleWithAttributes(map[string]interface{}{"global": true, + "regional": true, "use_aws_flow_log": false}), lwgenerate.HclModuleWithProviderDetails( map[string]string{"aws": "aws.main"}, ), @@ -1389,6 +1390,8 @@ func createAgentless(args *GenerateAwsTfConfigurationArgs) ([]*hclwrite.Block, e lwgenerate.HclModuleWithAttributes( map[string]interface{}{ "regional": true, + // Disable aws_flow_log creation due to https://lacework.atlassian.net/browse/GROW-3001 + "use_aws_flow_log": false, "global_module_reference": lwgenerate.CreateSimpleTraversal( []string{"module", "lacework_aws_agentless_scanning_global"}, ), diff --git a/lwgenerate/aws/aws_test.go b/lwgenerate/aws/aws_test.go index d64c5a855..e7d75432f 100644 --- a/lwgenerate/aws/aws_test.go +++ b/lwgenerate/aws/aws_test.go @@ -587,10 +587,11 @@ provider "aws" { } module "lacework_aws_agentless_scanning_global" { - source = "lacework/agentless-scanning/aws" - version = "~> 0.6" - global = true - regional = true + source = "lacework/agentless-scanning/aws" + version = "~> 0.6" + global = true + regional = true + use_aws_flow_log = false providers = { aws = aws.main @@ -602,6 +603,7 @@ module "lacework_aws_agentless_scanning_region_scanning-1-us-east-1" { version = "~> 0.6" global_module_reference = module.lacework_aws_agentless_scanning_global regional = true + use_aws_flow_log = false providers = { aws = aws.scanning-1-us-east-1