Skip to content

Commit

Permalink
fix: default values
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Theuermann <[email protected]>
  • Loading branch information
mati007thm committed Dec 17, 2024
1 parent 26db658 commit 0afd077
Showing 1 changed file with 1 addition and 93 deletions.
94 changes: 1 addition & 93 deletions internal/provider/integration_aws_serverless_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,99 +258,7 @@ func (r *integrationAwsServerlessResource) Schema(ctx context.Context, req resou
Default: booldefault.StaticBool(false),
},
"scan_configuration": schema.SingleNestedAttribute{
Optional: true, // Should be optional
Computed: true,
Default: objectdefault.StaticValue(types.ObjectValueMust(map[string]attr.Type{
"ec2_scan": types.BoolType,
"ecr_scan": types.BoolType,
"ecs_scan": types.BoolType,
"cron_scan_in_hours": types.Int64Type,
"event_scan_triggers": types.ListType{ElemType: types.ObjectType{
AttrTypes: map[string]attr.Type{
"scan_type": types.StringType,
"event_source": types.StringType,
"event_detail_type": types.StringType,
},
}},
"ec2_scan_options": types.ObjectType{
AttrTypes: map[string]attr.Type{
"ssm": types.BoolType,
"instance_ids_filter": types.ListType{ElemType: types.StringType},
"regions_filter": types.ListType{ElemType: types.StringType},
"tags_filter": types.MapType{ElemType: types.StringType},
"exclude_instance_ids_filter": types.ListType{ElemType: types.StringType},
"exclude_regions_filter": types.ListType{ElemType: types.StringType},
"exclude_tags_filter": types.MapType{ElemType: types.StringType},
"ebs_volume_scan": types.BoolType,
"ebs_scan_options": types.ObjectType{
AttrTypes: map[string]attr.Type{
"target_instances_per_scanner": types.Int64Type,
"max_asg_instances": types.Int64Type,
},
},
"instance_connect": types.BoolType,
},
},
"vpc_configuration": types.ObjectType{
AttrTypes: map[string]attr.Type{
"use_mondoo_vpc": types.BoolType,
"cidr_block": types.StringType,
},
},
}, map[string]attr.Value{
"ec2_scan": types.BoolValue(false),
"ecr_scan": types.BoolValue(false),
"ecs_scan": types.BoolValue(false),
"cron_scan_in_hours": types.Int64Value(0),
"event_scan_triggers": types.ListValueMust(types.ObjectType{
AttrTypes: map[string]attr.Type{
"scan_type": types.StringType,
"event_source": types.StringType,
"event_detail_type": types.StringType,
},
}, []attr.Value{}),
"ec2_scan_options": types.ObjectValueMust(map[string]attr.Type{
"ssm": types.BoolType,
"instance_ids_filter": types.ListType{ElemType: types.StringType},
"regions_filter": types.ListType{ElemType: types.StringType},
"tags_filter": types.MapType{ElemType: types.StringType},
"exclude_instance_ids_filter": types.ListType{ElemType: types.StringType},
"exclude_regions_filter": types.ListType{ElemType: types.StringType},
"exclude_tags_filter": types.MapType{ElemType: types.StringType},
"ebs_volume_scan": types.BoolType,
"ebs_scan_options": types.ObjectType{
AttrTypes: map[string]attr.Type{
"target_instances_per_scanner": types.Int64Type,
"max_asg_instances": types.Int64Type,
},
},
"instance_connect": types.BoolType,
}, map[string]attr.Value{
"ssm": types.BoolValue(false),
"instance_ids_filter": types.ListValueMust(types.StringType, []attr.Value{}),
"regions_filter": types.ListValueMust(types.StringType, []attr.Value{}),
"tags_filter": types.MapValueMust(types.StringType, make(map[string]attr.Value)),
"exclude_instance_ids_filter": types.ListValueMust(types.StringType, []attr.Value{}),
"exclude_regions_filter": types.ListValueMust(types.StringType, []attr.Value{}),
"exclude_tags_filter": types.MapValueMust(types.StringType, make(map[string]attr.Value)),
"ebs_volume_scan": types.BoolValue(false),
"ebs_scan_options": types.ObjectValueMust(map[string]attr.Type{
"target_instances_per_scanner": types.Int64Type,
"max_asg_instances": types.Int64Type,
}, map[string]attr.Value{
"target_instances_per_scanner": types.Int64Value(0),
"max_asg_instances": types.Int64Value(0),
}),
"instance_connect": types.BoolValue(false),
}),
"vpc_configuration": types.ObjectValueMust(map[string]attr.Type{
"use_mondoo_vpc": types.BoolType,
"cidr_block": types.StringType,
}, map[string]attr.Value{
"use_mondoo_vpc": types.BoolValue(false),
"cidr_block": types.StringValue(""),
}),
})),
Required: true,
Attributes: map[string]schema.Attribute{
"ec2_scan": schema.BoolAttribute{
MarkdownDescription: "Enable EC2 scan.",
Expand Down

0 comments on commit 0afd077

Please sign in to comment.