policy

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasePolicyResourceAttributes

func BasePolicyResourceAttributes(policyType policytype.PolicyType) map[string]schema.Attribute

func ExpandPolicyEnvironments

func ExpandPolicyEnvironments(ctx context.Context, tfSet types.Set) []policies.Environment

func ExpandPolicyGroups

func ExpandPolicyGroups(ctx context.Context, tfSet types.Set) []policies.Group

func ExpandPolicySubjects

func ExpandPolicySubjects(ctx context.Context, tfSet types.Set) []policies.Subject

func ExpandPolicyTargetUsers

func ExpandPolicyTargetUsers(ctx context.Context, tfSet types.Set) []policies.TargetUser

func ExpandPolicyTargets

func ExpandPolicyTargets(ctx context.Context, tfSet types.Set) []policies.Target

func FlattenPolicyEnvironments

func FlattenPolicyEnvironments(ctx context.Context, apiObject []policies.Environment) types.Set

func FlattenPolicyGroups

func FlattenPolicyGroups(ctx context.Context, apiObject []policies.Group) types.Set

func FlattenPolicySubjects

func FlattenPolicySubjects(ctx context.Context, apiObject []policies.Subject) types.Set

func FlattenPolicyTargetUsers

func FlattenPolicyTargetUsers(ctx context.Context, apiObject []policies.TargetUser) types.Set

func FlattenPolicyTargets

func FlattenPolicyTargets(ctx context.Context, apiObject []policies.Target) types.Set

func GetPolicyGroupModelType

func GetPolicyGroupModelType(ctx context.Context) types.ObjectType

func GetPolicySubjectModelType

func GetPolicySubjectModelType(ctx context.Context) types.ObjectType

func GetPolicyTargetModelType

func GetPolicyTargetModelType(ctx context.Context) types.ObjectType

func ListPolicyParametersSchema

func ListPolicyParametersSchema() map[string]datasource_schema.Attribute

func PolicyEnvironmentsAttribute

func PolicyEnvironmentsAttribute() schema.Attribute

func PolicyTargetsAttribute

func PolicyTargetsAttribute(allowedTypes []targettype.TargetType) schema.Attribute

func SetBasePolicyAttributes

func SetBasePolicyAttributes(ctx context.Context, schema PolicyModelInterface, basePolicy policies.PolicyInterface, modelIsDataSource bool)

SetBasePolicyAttributes populates base policy attributes in the TF schema from a base policy

Types

type ListPolicyParametersModel

type ListPolicyParametersModel struct {
	Subjects types.Set `tfsdk:"filter_subjects"`
	Groups   types.Set `tfsdk:"filter_groups"`
}

ListPolicyParametersModel maps optional, practitioner parameters that can be specified when calling the list policies endpoint. This model is used for data sources that query for a list of policies

type PolicyGroupModel

type PolicyGroupModel struct {
	ID   types.String `tfsdk:"id"`
	Name types.String `tfsdk:"name"`
}

PolicyGroupModel maps policy group data.

type PolicyModelInterface

type PolicyModelInterface interface {
	// SetID sets the policy model's ID attribute.
	SetID(value types.String)
	// SetName sets the policy model's name attribute.
	SetName(value types.String)
	// SetType sets the policy model's type attribute.
	SetType(value types.String)
	// SetDescription sets the policy model's description attribute.
	SetDescription(value types.String)
	// SetSubjects sets the policy model's subjects attribute.
	SetSubjects(value types.Set)
	// SetGroups sets the policy model's groups attribute.
	SetGroups(value types.Set)

	// GetSubjects gets the policy model's subjects attribute.
	GetSubjects() types.Set
	// GetGroups gets the policy model's groups attribute.
	GetGroups() types.Set
}

PolicyModelInterface lets you work with common attributes from any kind of policy model

type PolicySubjectModel

type PolicySubjectModel struct {
	ID   types.String `tfsdk:"id"`
	Type types.String `tfsdk:"type"`
}

PolicySubjectModel maps policy subject data.

type PolicyTargetModel

type PolicyTargetModel struct {
	ID   types.String `tfsdk:"id"`
	Type types.String `tfsdk:"type"`
}

PolicyTargetModel maps policy target data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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