@@ -82,12 +82,18 @@ type Ec2ScanOptionsInput struct {
8282 // (Optional.)
8383 Ssm types.Bool `tfsdk:"ssm"`
8484 // (Optional.)
85- InstanceIDsFilter types.List `tfsdk:"instance_ids_filter"`
85+ InstanceIdsFilter types.List `tfsdk:"instance_ids_filter"`
8686 // (Optional.)
8787 RegionsFilter types.List `tfsdk:"regions_filter"`
8888 // (Optional.)
8989 TagsFilter types.Map `tfsdk:"tags_filter"`
9090 // (Optional.)
91+ ExcludeInstanceIdsFilter types.List `tfsdk:"exclude_instance_ids_filter"`
92+ // (Optional.)
93+ ExcludeRegionsFilter types.List `tfsdk:"exclude_regions_filter"`
94+ // (Optional.)
95+ ExcludeTagsFilter types.Map `tfsdk:"exclude_tags_filter"`
96+ // (Optional.)
9197 EbsVolumeScan types.Bool `tfsdk:"ebs_volume_scan"`
9298 // (Optional.)
9399 EbsScanOptions * EbsScanOptionsInput `tfsdk:"ebs_scan_options"`
@@ -132,17 +138,29 @@ func (m integrationAwsServerlessResourceModel) GetConfigurationOptions() *mondoo
132138 }
133139
134140 var instanceIdsFilter []mondoov1.String
135- instanceIds , _ := m .ScanConfiguration .Ec2ScanOptions .InstanceIDsFilter .ToListValue (context .Background ())
141+ instanceIds , _ := m .ScanConfiguration .Ec2ScanOptions .InstanceIdsFilter .ToListValue (context .Background ())
136142 instanceIds .ElementsAs (context .Background (), & instanceIdsFilter , true )
137143
138- var RegionsFilter []mondoov1.String
144+ var regionsFilter []mondoov1.String
139145 regions , _ := m .ScanConfiguration .Ec2ScanOptions .RegionsFilter .ToListValue (context .Background ())
140- regions .ElementsAs (context .Background (), & RegionsFilter , true )
146+ regions .ElementsAs (context .Background (), & regionsFilter , true )
141147
142148 var tagsFilter mondoov1.Map
143149 tags , _ := m .ScanConfiguration .Ec2ScanOptions .TagsFilter .ToMapValue (context .Background ())
144150 tags .ElementsAs (context .Background (), & tagsFilter , true )
145151
152+ var excludeInstanceIdsFilter []mondoov1.String
153+ excludeInstanceIds , _ := m .ScanConfiguration .Ec2ScanOptions .ExcludeInstanceIdsFilter .ToListValue (context .Background ())
154+ excludeInstanceIds .ElementsAs (context .Background (), & excludeInstanceIdsFilter , true )
155+
156+ var excludeRegionsFilter []mondoov1.String
157+ excludeRegions , _ := m .ScanConfiguration .Ec2ScanOptions .ExcludeRegionsFilter .ToListValue (context .Background ())
158+ excludeRegions .ElementsAs (context .Background (), & excludeRegionsFilter , true )
159+
160+ var excludeTagsFilter mondoov1.Map
161+ excludeTags , _ := m .ScanConfiguration .Ec2ScanOptions .ExcludeTagsFilter .ToMapValue (context .Background ())
162+ excludeTags .ElementsAs (context .Background (), & excludeTagsFilter , true )
163+
146164 var accountIDs []mondoov1.String
147165 accountIds , _ := m .AccountIDs .ToListValue (context .Background ())
148166 accountIds .ElementsAs (context .Background (), & accountIDs , true )
@@ -157,11 +175,14 @@ func (m integrationAwsServerlessResourceModel) GetConfigurationOptions() *mondoo
157175 CronScaninHours : mondoov1 .NewIntPtr (mondoov1 .Int (m .ScanConfiguration .CronScaninHours .ValueInt64 ())),
158176 EventScanTriggers : & eventScanTriggers ,
159177 Ec2ScanOptions : & mondoov1.Ec2ScanOptionsInput {
160- Ssm : mondoov1 .NewBooleanPtr (mondoov1 .Boolean (m .ScanConfiguration .Ec2ScanOptions .Ssm .ValueBool ())),
161- InstanceIDsFilter : & instanceIdsFilter ,
162- RegionsFilter : & RegionsFilter ,
163- TagsFilter : & tagsFilter ,
164- EbsVolumeScan : mondoov1 .NewBooleanPtr (mondoov1 .Boolean (m .ScanConfiguration .Ec2ScanOptions .EbsVolumeScan .ValueBool ())),
178+ Ssm : mondoov1 .NewBooleanPtr (mondoov1 .Boolean (m .ScanConfiguration .Ec2ScanOptions .Ssm .ValueBool ())),
179+ InstanceIDsFilter : & instanceIdsFilter ,
180+ RegionsFilter : & regionsFilter ,
181+ TagsFilter : & tagsFilter ,
182+ ExcludedInstanceIDsFilter : & excludeInstanceIdsFilter ,
183+ ExcludedRegionsFilter : & excludeRegionsFilter ,
184+ ExcludedTagsFilter : & excludeTagsFilter ,
185+ EbsVolumeScan : mondoov1 .NewBooleanPtr (mondoov1 .Boolean (m .ScanConfiguration .Ec2ScanOptions .EbsVolumeScan .ValueBool ())),
165186 EbsScanOptions : & mondoov1.EbsScanOptionsInput {
166187 TargetInstancesPerScanner : mondoov1 .NewIntPtr (mondoov1 .Int (m .ScanConfiguration .Ec2ScanOptions .EbsScanOptions .TargetInstancesPerScanner .ValueInt64 ())),
167188 MaxAsgInstances : mondoov1 .NewIntPtr (mondoov1 .Int (m .ScanConfiguration .Ec2ScanOptions .EbsScanOptions .MaxAsgInstances .ValueInt64 ())),
@@ -279,20 +300,38 @@ func (r *integrationAwsServerlessResource) Schema(ctx context.Context, req resou
279300 Optional : true ,
280301 ElementType : types .StringType ,
281302 },
303+ "exclude_instance_ids_filter" : schema.ListAttribute {
304+ MarkdownDescription : "List of instance IDs to exclude." ,
305+ Optional : true ,
306+ ElementType : types .StringType ,
307+ },
308+ "exclude_regions_filter" : schema.ListAttribute {
309+ MarkdownDescription : "List of regions to exclude." ,
310+ Optional : true ,
311+ ElementType : types .StringType ,
312+ },
313+ "exclude_tags_filter" : schema.MapAttribute {
314+ MarkdownDescription : "Excluded Tags filter." ,
315+ Optional : true ,
316+ ElementType : types .StringType ,
317+ },
282318 "ebs_volume_scan" : schema.BoolAttribute {
283319 MarkdownDescription : "Enable EBS volume scan." ,
284320 Optional : true ,
285321 },
286322 "ebs_scan_options" : schema.SingleNestedAttribute {
287- Required : true ,
323+ Optional : true ,
324+ DeprecationMessage : "This field is deprecated and will be removed in the future." ,
288325 Attributes : map [string ]schema.Attribute {
289326 "target_instances_per_scanner" : schema.Int64Attribute {
290327 MarkdownDescription : "Target instances per scanner." ,
291328 Optional : true ,
329+ DeprecationMessage : "This field is deprecated and will be removed in the future." ,
292330 },
293331 "max_asg_instances" : schema.Int64Attribute {
294332 MarkdownDescription : "Max ASG instances." ,
295333 Optional : true ,
334+ DeprecationMessage : "This field is deprecated and will be removed in the future." ,
296335 },
297336 },
298337 },
0 commit comments