diff --git a/mmv1/products/securitycenterv2/ProjectMuteConfig.yaml b/mmv1/products/securitycenterv2/ProjectMuteConfig.yaml index 6e7beff16a71..8ed9b8ccf008 100644 --- a/mmv1/products/securitycenterv2/ProjectMuteConfig.yaml +++ b/mmv1/products/securitycenterv2/ProjectMuteConfig.yaml @@ -35,7 +35,7 @@ examples: vars: mute_config_id: 'my-config' test_env_vars: - project_id: PROJECT_NAME + project_id: :PROJECT_NAME parameters: - !ruby/object:Api::Type::String name: location diff --git a/mmv1/templates/terraform/env_var_context.go.tmpl b/mmv1/templates/terraform/env_var_context.go.tmpl index 41f63c5245e6..64efd3432ad2 100644 --- a/mmv1/templates/terraform/env_var_context.go.tmpl +++ b/mmv1/templates/terraform/env_var_context.go.tmpl @@ -30,4 +30,7 @@ "{{$varKey}}": envvar.GetTestZoneFromEnv(), {{- end }} {{- end }} + {{- if and $.HasNewLine (gt (len $.TestEnvVars) 0)}} + {{""}} + {{- end}} {{- end }} \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/base_configs/test_file.go.tmpl b/mmv1/templates/terraform/examples/base_configs/test_file.go.tmpl index 0ebe1bc6ac11..aa0779f39d16 100644 --- a/mmv1/templates/terraform/examples/base_configs/test_file.go.tmpl +++ b/mmv1/templates/terraform/examples/base_configs/test_file.go.tmpl @@ -44,7 +44,7 @@ func TestAcc{{ $e.TestSlug $.Res.ProductMetadata.Name $.Res.Name }}(t *testing.T t.Parallel() context := map[string]interface{}{ - {{- template "EnvVarContext" $e }} + {{- template "EnvVarContext" dict "TestEnvVars" $e.TestEnvVars "HasNewLine" false}} {{- range $varKey, $varVal := $e.TestVarsOverrides }} "{{$varKey}}": {{$varVal}}, {{- end }} diff --git a/mmv1/templates/terraform/iam/go/iam_context.go.tmpl b/mmv1/templates/terraform/iam/go/iam_context.go.tmpl index 54d105314463..61df201660dd 100644 --- a/mmv1/templates/terraform/iam/go/iam_context.go.tmpl +++ b/mmv1/templates/terraform/iam/go/iam_context.go.tmpl @@ -8,7 +8,7 @@ {{- if $.IamPolicy.TestProjectName }} "project_id" : fmt.Sprintf("{{ $.IamPolicy.TestProjectName }}%s", acctest.RandString(t, 10)), {{- end }} -{{- template "EnvVarContext" $.FirstTestExample }} +{{- template "EnvVarContext" dict "TestEnvVars" $.FirstTestExample.TestEnvVars "HasNewLine" true}} {{- if $.FirstTestExample.TestVarsOverrides }} {{- range $varName, $override := $.FirstTestExample.TestVarsOverrides }} "{{ $varName }}": {{ $override }},