From 4d84154babe8aff4842d703c2cc1785b7c399aea Mon Sep 17 00:00:00 2001 From: Lei Jin Date: Tue, 4 Jun 2024 22:55:33 +0000 Subject: [PATCH] feat(GROW-2928): Upgrade the gcp terraform version Signed-off-by: Lei Jin --- integration/framework_test.go | 2 +- lwgenerate/constants.go | 8 +-- lwgenerate/gcp/gcp_test.go | 108 +++++++++++++++++----------------- 3 files changed, 59 insertions(+), 59 deletions(-) diff --git a/integration/framework_test.go b/integration/framework_test.go index 4227f59b9..cf7b3680c 100644 --- a/integration/framework_test.go +++ b/integration/framework_test.go @@ -491,7 +491,7 @@ func TestMain(m *testing.M) { func terraformInstall() { installer := &releases.ExactVersion{ Product: product.Terraform, - Version: version.Must(version.NewVersion("1.4.7")), + Version: version.Must(version.NewVersion("1.5.0")), } _execPath, err := installer.Install(context.Background()) diff --git a/lwgenerate/constants.go b/lwgenerate/constants.go index 3f9a9f9d6..a456f14a4 100644 --- a/lwgenerate/constants.go +++ b/lwgenerate/constants.go @@ -26,15 +26,15 @@ const ( LWAzureADVersion = "~> 1.0" GcpAgentlessSource = "lacework/agentless-scanning/gcp" - GcpAgentlessVersion = "~> 0.1" + GcpAgentlessVersion = "~> 2.0" GcpConfigSource = "lacework/config/gcp" - GcpConfigVersion = "~> 2.3" + GcpConfigVersion = "~> 3.0" GcpAuditLogSource = "lacework/audit-log/gcp" - GcpAuditLogVersion = "~> 3.4" + GcpAuditLogVersion = "~> 4.0" GcpGKEAuditLogSource = "lacework/gke-audit-log/gcp" GcpGKEAuditLogVersion = "~> 0.3" GcpPubSubAuditLog = "lacework/pub-sub-audit-log/gcp" - GcpPubSubAuditLogVersion = "~> 0.2" + GcpPubSubAuditLogVersion = "~> 0.6" OciConfigSource = "lacework/config/oci" OciConfigVersion = "~> 0.2" diff --git a/lwgenerate/gcp/gcp_test.go b/lwgenerate/gcp/gcp_test.go index 82f0ad434..04dfc4414 100644 --- a/lwgenerate/gcp/gcp_test.go +++ b/lwgenerate/gcp/gcp_test.go @@ -260,7 +260,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" custom_bucket_name = "bucket" } `), @@ -274,7 +274,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" custom_filter = "custom-filter" } `), @@ -288,7 +288,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" } `), }, @@ -301,7 +301,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" google_workspace_filter = false } `), @@ -315,7 +315,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" } `), }, @@ -328,7 +328,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" k8s_filter = false } `), @@ -344,7 +344,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_organization_level_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" folders_to_include = ["abc", "def"] org_integration = true organization_id = "123456789" @@ -362,7 +362,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_organization_level_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" folders_to_exclude = ["abc", "def"] org_integration = true organization_id = "123456789" @@ -380,7 +380,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_organization_level_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" org_integration = true organization_id = "123456789" } @@ -398,7 +398,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_organization_level_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" folders_to_exclude = ["abc"] include_root_projects = false org_integration = true @@ -418,7 +418,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_organization_level_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" folders_to_exclude = ["abc"] org_integration = true organization_id = "123456789" @@ -434,7 +434,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" prefix = "rar" } `), @@ -448,7 +448,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" wait_time = "30s" } `), @@ -462,7 +462,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_AuditLog(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" for_each = { project1 = "project1" @@ -565,7 +565,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_Configuration(t *testing.T) { ), ReqProvider(projectName, `module "gcp_organization_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" folders_to_include = ["abc", "def"] org_integration = true organization_id = "123456789" @@ -583,7 +583,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_Configuration(t *testing.T) { ), ReqProvider(projectName, `module "gcp_organization_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" folders_to_exclude = ["abc", "def"] org_integration = true organization_id = "123456789" @@ -601,7 +601,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_Configuration(t *testing.T) { ), ReqProvider(projectName, `module "gcp_organization_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" org_integration = true organization_id = "123456789" } @@ -619,7 +619,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_Configuration(t *testing.T) { ), ReqProvider(projectName, `module "gcp_organization_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" folders_to_exclude = ["abc"] include_root_projects = false org_integration = true @@ -639,7 +639,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_Configuration(t *testing.T) { ), ReqProvider(projectName, `module "gcp_organization_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" folders_to_exclude = ["abc"] org_integration = true organization_id = "123456789" @@ -655,7 +655,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_Configuration(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" prefix = "rar" } `), @@ -669,7 +669,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_Configuration(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" wait_time = "30s" } `), @@ -683,7 +683,7 @@ func TestGenerateGcpTfConfigurationArgs_Generate_Configuration(t *testing.T) { ), ReqProvider(projectName, `module "gcp_project_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" for_each = { project1 = "project1" @@ -948,7 +948,7 @@ var laceworkProvider = `provider "lacework" { var moduleImportProjectLevelAuditLogWithConfiguration = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" service_account_name = module.gcp_project_level_config.service_account_name service_account_private_key = module.gcp_project_level_config.service_account_private_key use_existing_service_account = true @@ -956,7 +956,7 @@ var moduleImportProjectLevelAuditLogWithConfiguration = `module "gcp_project_aud ` var moduleImportProjectLevelPubSubAuditLogWithConfiguration = `module "gcp_project_audit_log" { source = "lacework/pub-sub-audit-log/gcp" - version = "~> 0.2" + version = "~> 0.6" service_account_name = module.gcp_project_level_config.service_account_name service_account_private_key = module.gcp_project_level_config.service_account_private_key use_existing_service_account = true @@ -965,32 +965,32 @@ var moduleImportProjectLevelPubSubAuditLogWithConfiguration = `module "gcp_proje var moduleImportProjectLevelAuditLogWithoutConfiguration = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" } ` var moduleImportProjectLevelAuditLogCustomIntegrationName = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" lacework_integration_name = "custom_integration_name" } ` var moduleImportProjectLevelPubSubAuditLogWithoutConfiguration = `module "gcp_project_audit_log" { source = "lacework/pub-sub-audit-log/gcp" - version = "~> 0.2" + version = "~> 0.6" } ` var moduleImportProjectLevelPubSubAuditLogCustomIntegrationName = `module "gcp_project_audit_log" { source = "lacework/pub-sub-audit-log/gcp" - version = "~> 0.2" + version = "~> 0.6" lacework_integration_name = "custom_integration_name" } ` var moduleImportProjectLevelAuditLogLabels = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" labels = { key = "value" } @@ -999,7 +999,7 @@ var moduleImportProjectLevelAuditLogLabels = `module "gcp_project_audit_log" { var moduleImportProjectLevelAuditLogBucketLabels = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" bucket_labels = { key = "value" } @@ -1008,7 +1008,7 @@ var moduleImportProjectLevelAuditLogBucketLabels = `module "gcp_project_audit_lo var moduleImportProjectLevelAuditLogPubSubSubscriptionLabels = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" pubsub_subscription_labels = { key = "value" } @@ -1017,7 +1017,7 @@ var moduleImportProjectLevelAuditLogPubSubSubscriptionLabels = `module "gcp_proj var moduleImportProjectLevelAuditLogPubSubTopicLabels = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" pubsub_topic_labels = { key = "value" } @@ -1026,54 +1026,54 @@ var moduleImportProjectLevelAuditLogPubSubTopicLabels = `module "gcp_project_aud var moduleImportProjectLevelAuditLogBucketRegion = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" bucket_region = "us-west" } ` var moduleImportProjectLevelAuditLogExistingBucketName = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" existing_bucket_name = "foo" } ` var moduleImportProjectLevelAuditLogExistingLogSinkName = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" existing_sink_name = "foo" } ` var moduleImportProjectLevelPubSubAuditLogExistingLogSinkName = `module "gcp_project_audit_log" { source = "lacework/pub-sub-audit-log/gcp" - version = "~> 0.2" + version = "~> 0.6" existing_sink_name = "foo" } ` var moduleImportProjectLevelAuditLogEnableUBLA = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" } ` var moduleImportProjectLevelAuditLogDisableUBLA = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" enable_ubla = false } ` var moduleImportProjectLevelAuditLogBucketLifecycleRuleAge = `module "gcp_project_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" lifecycle_rule_age = 420 } ` var moduleImportOrganizationLevelAuditLogWithConfiguration = `module "gcp_organization_level_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" org_integration = true organization_id = "123456789" service_account_name = module.gcp_organization_level_config.service_account_name @@ -1084,7 +1084,7 @@ var moduleImportOrganizationLevelAuditLogWithConfiguration = `module "gcp_organi var moduleImportOrganizationLevelPubSubAuditLogWithConfiguration = `module "gcp_organization_level_audit_log" { source = "lacework/pub-sub-audit-log/gcp" - version = "~> 0.2" + version = "~> 0.6" integration_type = "ORGANIZATION" organization_id = "123456789" service_account_name = module.gcp_organization_level_config.service_account_name @@ -1095,7 +1095,7 @@ var moduleImportOrganizationLevelPubSubAuditLogWithConfiguration = `module "gcp_ var moduleImportOrganizationLevelAuditLogWithoutConfiguration = `module "gcp_organization_level_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" org_integration = true organization_id = "123456789" } @@ -1103,14 +1103,14 @@ var moduleImportOrganizationLevelAuditLogWithoutConfiguration = `module "gcp_org var moduleImportOrganizationLevelPubSubAuditLogWithoutConfiguration = `module "gcp_organization_level_audit_log" { source = "lacework/pub-sub-audit-log/gcp" - version = "~> 0.2" + version = "~> 0.6" integration_type = "ORGANIZATION" organization_id = "123456789" } ` var moduleImportOrganizationLevelAuditLogCustomIntegrationName = `module "gcp_organization_level_audit_log" { source = "lacework/audit-log/gcp" - version = "~> 3.4" + version = "~> 4.0" lacework_integration_name = "custom_integration_name" org_integration = true organization_id = "123456789" @@ -1118,7 +1118,7 @@ var moduleImportOrganizationLevelAuditLogCustomIntegrationName = `module "gcp_or ` var moduleImportOrganizationLevelPubSubAuditLogCustomIntegrationName = `module "gcp_organization_level_audit_log" { source = "lacework/pub-sub-audit-log/gcp" - version = "~> 0.2" + version = "~> 0.6" integration_type = "ORGANIZATION" lacework_integration_name = "custom_integration_name" organization_id = "123456789" @@ -1127,13 +1127,13 @@ var moduleImportOrganizationLevelPubSubAuditLogCustomIntegrationName = `module " var moduleImportProjectLevelConfiguration = `module "gcp_project_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" } ` var moduleImportProjectLevelConfigurationExistingSA = `module "gcp_project_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" service_account_name = "foo" service_account_private_key = "123456789" use_existing_service_account = true @@ -1142,14 +1142,14 @@ var moduleImportProjectLevelConfigurationExistingSA = `module "gcp_project_level var moduleImportProjectLevelConfigurationCustomIntegrationName = `module "gcp_project_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" lacework_integration_name = "custom_integration_name" } ` var moduleImportOrganizationLevelConfiguration = `module "gcp_organization_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" org_integration = true organization_id = "123456789" } @@ -1157,7 +1157,7 @@ var moduleImportOrganizationLevelConfiguration = `module "gcp_organization_level var moduleImportOrganizationLevelConfigurationExistingSA = `module "gcp_organization_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" org_integration = true organization_id = "123456789" service_account_name = "foo" @@ -1168,7 +1168,7 @@ var moduleImportOrganizationLevelConfigurationExistingSA = `module "gcp_organiza var moduleImportOrganizationLevelConfigurationCustomIntegrationName = `module "gcp_organization_level_config" { source = "lacework/config/gcp" - version = "~> 2.3" + version = "~> 3.0" lacework_integration_name = "custom_integration_name" org_integration = true organization_id = "123456789" @@ -1183,7 +1183,7 @@ var moduleImportProjectLevelAgentless = `provider "google" { module "lacework_gcp_agentless_scanning_global" { source = "lacework/agentless-scanning/gcp" - version = "~> 0.1" + version = "~> 2.0" global = true regional = true @@ -1201,7 +1201,7 @@ var moduleImportProjectLevelAgentlessWithProjectFilterList = `provider "google" module "lacework_gcp_agentless_scanning_global" { source = "lacework/agentless-scanning/gcp" - version = "~> 0.1" + version = "~> 2.0" global = true project_filter_list = ["p1", "p2"] regional = true @@ -1220,7 +1220,7 @@ var moduleImportOrgLevelAgentless = `provider "google" { module "lacework_gcp_agentless_scanning_global" { source = "lacework/agentless-scanning/gcp" - version = "~> 0.1" + version = "~> 2.0" global = true integration_type = "ORGANIZATION" organization_id = "123456789"