44 "context"
55 "fmt"
66 "slices"
7+ "strings"
78
89 "github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator"
910 "github.com/hashicorp/terraform-plugin-framework/diag"
@@ -166,9 +167,10 @@ func (m integrationAwsServerlessResourceModel) GetConfigurationOptions() *mondoo
166167 regions , _ := m .ScanConfiguration .Ec2ScanOptions .RegionsFilter .ToListValue (context .Background ())
167168 regions .ElementsAs (context .Background (), & regionsFilter , true )
168169
169- var tagsFilter mondoov1.Map
170- tags , _ := m .ScanConfiguration .Ec2ScanOptions .TagsFilter .ToMapValue (context .Background ())
171- tags .ElementsAs (context .Background (), & tagsFilter , true )
170+ tagsFilter := make (mondoov1.Map )
171+ for k , v := range m .ScanConfiguration .Ec2ScanOptions .TagsFilter .Elements () {
172+ tagsFilter [k ] = strings .Trim (v .String (), "\" " )
173+ }
172174
173175 var excludeInstanceIdsFilter []mondoov1.String
174176 excludeInstanceIds , _ := m .ScanConfiguration .Ec2ScanOptions .ExcludeInstanceIdsFilter .ToListValue (context .Background ())
@@ -178,9 +180,10 @@ func (m integrationAwsServerlessResourceModel) GetConfigurationOptions() *mondoo
178180 excludeRegions , _ := m .ScanConfiguration .Ec2ScanOptions .ExcludeRegionsFilter .ToListValue (context .Background ())
179181 excludeRegions .ElementsAs (context .Background (), & excludeRegionsFilter , true )
180182
181- var excludeTagsFilter mondoov1.Map
182- excludeTags , _ := m .ScanConfiguration .Ec2ScanOptions .ExcludeTagsFilter .ToMapValue (context .Background ())
183- excludeTags .ElementsAs (context .Background (), & excludeTagsFilter , true )
183+ excludeTagsFilter := make (mondoov1.Map )
184+ for k , v := range m .ScanConfiguration .Ec2ScanOptions .ExcludeTagsFilter .Elements () {
185+ excludeTagsFilter [k ] = strings .Trim (v .String (), "\" " )
186+ }
184187
185188 var accountIDs []mondoov1.String
186189 accountIds , _ := m .AccountIDs .ToListValue (context .Background ())
0 commit comments