models

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromSDKFilterCriteria

func FromSDKFilterCriteria(ctx context.Context, sdk *cloudsecTypes.FilterCriteria, diags *diag.Diagnostics) types.Object

FromSDKFilterCriteria converts SDK FilterCriteria to a Terraform types.Object. Handles recursive conversion for nested AND/OR operators.

func GetAssetMatchingAttrTypes

func GetAssetMatchingAttrTypes() map[string]attr.Type

GetAssetMatchingAttrTypes returns the attribute types for asset matching.

func GetComplianceMetadataAttrTypes

func GetComplianceMetadataAttrTypes() map[string]attr.Type

GetComplianceMetadataAttrTypes returns the attribute types for compliance metadata.

func GetFilterCriteriaAttrTypes

func GetFilterCriteriaAttrTypes() map[string]attr.Type

GetFilterCriteriaAttrTypes returns the attribute types for FilterCriteriaModel. This is used for creating types.Object values with the correct schema.

func GetIssueAttrTypes

func GetIssueAttrTypes() map[string]attr.Type

GetIssueAttrTypes returns the attribute types for the issue object.

func GetMetadataAttrTypes

func GetMetadataAttrTypes() map[string]attr.Type

GetMetadataAttrTypes returns the attribute types for the metadata object.

func GetQueryAttrTypes

func GetQueryAttrTypes() map[string]attr.Type

GetQueryAttrTypes returns the attribute types for the query object.

func GetRuleDataSourceAttrTypes

func GetRuleDataSourceAttrTypes() map[string]attr.Type

GetRuleDataSourceAttrTypes returns the attribute types for CloudSecRuleDataSourceModel. This is used when creating types.List values containing rule objects.

func GetRuleMatchingAttrTypes

func GetRuleMatchingAttrTypes() map[string]attr.Type

GetRuleMatchingAttrTypes returns the attribute types for rule matching.

func ToSDKFilterCriteria

func ToSDKFilterCriteria(ctx context.Context, model types.Object, diags *diag.Diagnostics) *cloudsecTypes.FilterCriteria

ToSDKFilterCriteria converts a Terraform FilterCriteriaModel to SDK FilterCriteria. Handles recursive conversion for nested AND/OR operators.

Types

type AssetMatchingModel

type AssetMatchingModel struct {
	Type            types.String `tfsdk:"type"`
	AssetGroupIDs   types.List   `tfsdk:"asset_group_ids"`
	CloudAccountIDs types.List   `tfsdk:"cloud_account_ids"`
}

AssetMatchingModel represents the asset matching configuration.

type CloudSecPolicyDataSourceModel

type CloudSecPolicyDataSourceModel struct {
	ID                        types.String `tfsdk:"id"`
	Name                      types.String `tfsdk:"name"`
	Description               types.String `tfsdk:"description"`
	Labels                    types.List   `tfsdk:"labels"`
	RuleMatchingType          types.String `tfsdk:"rule_matching_type"`
	AssociatedRuleIDs         types.List   `tfsdk:"associated_rule_ids"`
	AssetMatchingType         types.String `tfsdk:"asset_matching_type"`
	AssociatedAssetGroupIDs   types.List   `tfsdk:"associated_asset_group_ids"`
	AssociatedCloudAccountIDs types.List   `tfsdk:"associated_cloud_account_ids"`
	Enabled                   types.Bool   `tfsdk:"enabled"`
	Mode                      types.String `tfsdk:"mode"`
	CreatedAt                 types.Int64  `tfsdk:"created_at"`
	CreatedBy                 types.String `tfsdk:"created_by"`
	UpdatedAt                 types.Int64  `tfsdk:"updated_at"`
	UpdatedBy                 types.String `tfsdk:"updated_by"`
}

CloudSecPolicyDataSourceModel represents the Terraform model for a CloudSec policy data source. This is a read-only model used for data source queries.

func (*CloudSecPolicyDataSourceModel) FromSDKResponse

FromSDKResponse populates the data source model from SDK PolicyResponse.

type CloudSecPolicyResourceModel

type CloudSecPolicyResourceModel struct {
	ID            types.String `tfsdk:"id"`
	Name          types.String `tfsdk:"name"`
	Description   types.String `tfsdk:"description"`
	Labels        types.Set    `tfsdk:"labels"`
	RuleMatching  types.Object `tfsdk:"rule_matching"`
	AssetMatching types.Object `tfsdk:"asset_matching"`
	Enabled       types.Bool   `tfsdk:"enabled"`
	Mode          types.String `tfsdk:"mode"`
	CreatedAt     types.Int64  `tfsdk:"created_at"`
	CreatedBy     types.String `tfsdk:"created_by"`
	UpdatedAt     types.Int64  `tfsdk:"updated_at"`
	UpdatedBy     types.String `tfsdk:"updated_by"`
}

CloudSecPolicyResourceModel represents the Terraform model for a CloudSec policy resource.

func (*CloudSecPolicyResourceModel) FromSDKResponse

func (m *CloudSecPolicyResourceModel) FromSDKResponse(ctx context.Context, diags *diag.Diagnostics, remote *cloudsecTypes.PolicyResponse)

FromSDKResponse populates the Terraform model from an SDK PolicyResponse.

func (*CloudSecPolicyResourceModel) ToSDKCreateRequest

ToSDKCreateRequest converts the Terraform model to an SDK PolicyCreateRequest.

func (*CloudSecPolicyResourceModel) ToSDKUpdateRequest

ToSDKUpdateRequest converts the Terraform model to an SDK PolicyUpdateRequest.

type CloudSecRuleDataSourceModel

type CloudSecRuleDataSourceModel struct {
	ID                  types.String `tfsdk:"id"`
	Name                types.String `tfsdk:"name"`
	Description         types.String `tfsdk:"description"`
	Class               types.String `tfsdk:"class"`
	Type                types.String `tfsdk:"type"`
	AssetTypes          types.List   `tfsdk:"asset_types"`
	Severity            types.String `tfsdk:"severity"`
	Enabled             types.Bool   `tfsdk:"enabled"`
	SystemDefault       types.Bool   `tfsdk:"system_default"`
	Providers           types.List   `tfsdk:"providers"`
	ComplianceMetadata  types.List   `tfsdk:"compliance_metadata"`
	ComplianceStandards types.List   `tfsdk:"compliance_standards"`
	Labels              types.List   `tfsdk:"labels"`
	CreatedBy           types.String `tfsdk:"created_by"`
	CreatedOn           types.Int64  `tfsdk:"created_on"`
	LastModifiedBy      types.String `tfsdk:"last_modified_by"`
	LastModifiedOn      types.Int64  `tfsdk:"last_modified_on"`
	Module              types.String `tfsdk:"module"`
}

CloudSecRuleDataSourceModel represents the Terraform model for a CloudSec rule data source. This is a read-only model used for data source queries.

func (*CloudSecRuleDataSourceModel) FromSDKRuleData

func (m *CloudSecRuleDataSourceModel) FromSDKRuleData(ctx context.Context, diags *diag.Diagnostics, remote *cloudsecTypes.RuleData)

FromSDKRuleData populates the data source model from SDK RuleData. This is used when reading rule data from search/list operations.

func (*CloudSecRuleDataSourceModel) FromSDKRuleResponse

func (m *CloudSecRuleDataSourceModel) FromSDKRuleResponse(ctx context.Context, diags *diag.Diagnostics, remote *cloudsecTypes.RuleResponse)

FromSDKRuleResponse populates the data source model from SDK RuleResponse. This is used when reading a specific rule by ID.

type CloudSecRuleResourceModel

type CloudSecRuleResourceModel struct {
	ID                 types.String `tfsdk:"id"`
	Name               types.String `tfsdk:"name"`
	Description        types.String `tfsdk:"description"`
	Class              types.String `tfsdk:"class"`
	Type               types.String `tfsdk:"type"`
	AssetTypes         types.List   `tfsdk:"asset_types"`
	Severity           types.String `tfsdk:"severity"`
	Query              types.Object `tfsdk:"query"`
	Metadata           types.Object `tfsdk:"metadata"`
	ComplianceMetadata types.List   `tfsdk:"compliance_metadata"`
	Labels             types.Set    `tfsdk:"labels"`
	Enabled            types.Bool   `tfsdk:"enabled"`
	Providers          types.List   `tfsdk:"providers"`
	SystemDefault      types.Bool   `tfsdk:"system_default"`
	CreatedBy          types.String `tfsdk:"created_by"`
	CreatedOn          types.Int64  `tfsdk:"created_on"`
	LastModifiedBy     types.String `tfsdk:"last_modified_by"`
	LastModifiedOn     types.Int64  `tfsdk:"last_modified_on"`
	Deleted            types.Bool   `tfsdk:"deleted"`
	DeletedAt          types.Int64  `tfsdk:"deleted_at"`
	DeletedBy          types.String `tfsdk:"deleted_by"`
}

CloudSecRuleResourceModel represents the Terraform model for a CloudSec rule resource.

func (*CloudSecRuleResourceModel) FromSDKResponse

func (m *CloudSecRuleResourceModel) FromSDKResponse(ctx context.Context, diags *diag.Diagnostics, remote *cloudsecTypes.RuleResponse)

FromSDKResponse populates the Terraform model from an SDK RuleResponse.

func (*CloudSecRuleResourceModel) ToSDKCreateRequest

ToSDKCreateRequest converts the Terraform model to an SDK CreateRuleRequest.

func (*CloudSecRuleResourceModel) ToSDKUpdateRequest

ToSDKUpdateRequest converts the Terraform model to an SDK UpdateRuleRequest, including only fields that changed between the prior state and the new plan. The rule_class field is always included because the API requires it on every PATCH.

type ComplianceMetadataModel

type ComplianceMetadataModel struct {
	ControlID    types.String `tfsdk:"control_id"`
	StandardID   types.String `tfsdk:"standard_id"`
	StandardName types.String `tfsdk:"standard_name"`
	ControlName  types.String `tfsdk:"control_name"`
}

ComplianceMetadataModel represents a compliance metadata item.

type FilterCriteriaModel

type FilterCriteriaModel struct {
	Operator types.String `tfsdk:"operator"` // "AND" or "OR"
	Criteria types.List   `tfsdk:"criteria"` // List of nested FilterCriteriaModel
	Field    types.String `tfsdk:"field"`    // SEARCH_FIELD
	Type     types.String `tfsdk:"type"`     // SEARCH_TYPE
	Value    types.String `tfsdk:"value"`    // SEARCH_VALUE (stored as string, converted as needed)
}

FilterCriteriaModel represents a recursive filter criteria structure for CloudSec policies. Supports both logical operators (AND/OR) and field-based filters.

type IssueModel

type IssueModel struct {
	Recommendation types.String `tfsdk:"recommendation"`
}

IssueModel represents the issue/recommendation block in metadata.

type RuleMatchingModel

type RuleMatchingModel struct {
	Type           types.String `tfsdk:"type"`
	Rules          types.List   `tfsdk:"rules"`
	FilterCriteria types.Object `tfsdk:"filter_criteria"`
}

RuleMatchingModel represents the rule matching configuration.

type RuleMetadataModel

type RuleMetadataModel struct {
	Issue types.Object `tfsdk:"issue"`
}

RuleMetadataModel represents the metadata block in a rule.

type RuleQueryModel

type RuleQueryModel struct {
	XQL types.String `tfsdk:"xql"`
}

RuleQueryModel represents the query block in a rule.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL