cross_schema

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AutoSyncSchema = schema.SingleNestedAttribute{
	MarkdownDescription: "Set up auto sync configurations.",
	Optional:            true,
	Attributes: map[string]schema.Attribute{
		"deploy_when_drift_detected": schema.BoolAttribute{
			MarkdownDescription: "If set to `true`, a deployment will start automatically upon detecting a drift or multiple drifts",
			Optional:            true,
		},
	},
}
View Source
var DeploymentApprovalPolicyRuleSchema = schema.ListNestedAttribute{
	MarkdownDescription: "Set up rules for approving deployment processes. At least one rule should be configured",
	Required:            true,
	Validators: []validator.List{
		listvalidator.SizeAtLeast(1),
	},
	NestedObject: schema.NestedAttributeObject{
		Attributes: map[string]schema.Attribute{
			"type": schema.StringAttribute{
				MarkdownDescription: "The type of the rule. Find supported types [here](https://docs.controlmonkey.io/controlmonkey-api/api-enumerations#deployment-approval-policy-rule-types)",
				Required:            true,
				Validators: []validator.String{
					cmStringValidators.NotBlank(),
				},
			},
			"parameters": schema.StringAttribute{
				MarkdownDescription: fmt.Sprintf("JSON format of the rule parameters according to the `type`. Find supported parameters [here](https://docs.controlmonkey.io/controlmonkey-api/approval-policy-rules)"),
				Optional:            true,
				CustomType:          jsontypes.NormalizedType{},
			},
		},
	},
}
View Source
var IacConfigSchema = schema.SingleNestedAttribute{
	MarkdownDescription: "IaC configuration.",
	Optional:            true,
	Attributes: map[string]schema.Attribute{
		"terraform_version": schema.StringAttribute{
			MarkdownDescription: "the Terraform version that will be used for terraform operations.",
			Optional:            true,
		},
		"terragrunt_version": schema.StringAttribute{
			MarkdownDescription: "the Terragrunt version that will be used for terragrunt operations.",
			Optional:            true,
		},
		"opentofu_version": schema.StringAttribute{
			MarkdownDescription: "the OpenTofu version that will be used for tofu operations.",
			Optional:            true,
		},
		"is_terragrunt_run_all": schema.BoolAttribute{
			MarkdownDescription: "When using terragrunt, as long as this field is set to `True`, this field will execute \"run-all\" commands on multiple modules for init/plan/apply",
			Optional:            true,
		},
		"var_files": schema.ListAttribute{
			ElementType:         types.StringType,
			Optional:            true,
			MarkdownDescription: "Custom variable files to pass on to Terraform. For more information: [ControlMonkey Docs](https://docs.controlmonkey.io/main-concepts/stack/stack-settings#var-files)",
			Validators:          commons.ValidateUniqueNotEmptyListWithNoBlankValues(),
		},
	},
}
View Source
var RunTriggerSchema = schema.SingleNestedAttribute{
	MarkdownDescription: "Glob patterns to specify additional paths that should trigger a stack run.",
	Optional:            true,
	Attributes: map[string]schema.Attribute{
		"patterns": schema.ListAttribute{
			MarkdownDescription: "Patterns that trigger a stack run.",
			ElementType:         types.StringType,
			Optional:            true,
			Validators:          commons.ValidateUniqueNotEmptyListWithNoBlankValues(),
		},
		"exclude_patterns": schema.ListAttribute{
			MarkdownDescription: "Patterns that will not trigger a stack run.",
			ElementType:         types.StringType,
			Optional:            true,
			Validators:          commons.ValidateUniqueNotEmptyListWithNoBlankValues(),
		},
	},
}
View Source
var StackDeploymentApprovalPolicySchema = schema.SingleNestedAttribute{
	MarkdownDescription: "Set up requirements to approve a deployment",
	Optional:            true,
	Attributes: map[string]schema.Attribute{
		"rules": DeploymentApprovalPolicyRuleSchema,
	},
}
View Source
var StackDeploymentBehaviorSchema = schema.SingleNestedAttribute{
	MarkdownDescription: "The deployment behavior configuration.",
	Required:            true,
	Attributes: map[string]schema.Attribute{
		"deploy_on_push": schema.BoolAttribute{
			MarkdownDescription: "Choose whether to initiate a deployment when a push event occurs or not.",
			Required:            true,
		},
		"wait_for_approval": schema.BoolAttribute{
			MarkdownDescription: "Use `deployment_approval_policy`. Decide whether to wait for approval before proceeding with the deployment or not.",
			Optional:            true,
			DeprecationMessage:  "Attribute \"deployment_behavior.wait_for_approval\" is deprecated. Use \"deployment_approval_policy\" instead",
			Validators: []validator.Bool{
				boolvalidator.ConflictsWith(
					path.MatchRoot("deployment_approval_policy")),
			},
		},
	},
}
View Source
var StackRunnerConfigSchema = schema.SingleNestedAttribute{
	MarkdownDescription: "Configure the runner settings to specify whether ControlMonkey manages the runner or it is self-hosted.",
	Optional:            true,
	Attributes: map[string]schema.Attribute{
		"mode": schema.StringAttribute{
			MarkdownDescription: fmt.Sprintf("The runner mode. Allowed values: %s.", helpers.EnumForDocs(cmTypes.RunnerConfigModeTypes)),
			Required:            true,
			Validators: []validator.String{
				stringvalidator.OneOf(cmTypes.RunnerConfigModeTypes...),
			},
		},
		"groups": schema.ListAttribute{
			MarkdownDescription: fmt.Sprintf("In case that `mode` is `%s`, groups must contain at least one runners group. If `mode` is `%s`, this field must not be configured.", cmTypes.SelfHosted, cmTypes.Managed),
			ElementType:         types.StringType,
			Optional:            true,
		},
	},
}
View Source
var ValueConditionsSchema = schema.ListNestedAttribute{
	Optional:            true,
	MarkdownDescription: "Specify conditions for the variable value using an operator and another value. Typically used for stacks launched from templates. For more information: [ControlMonkey Docs] (https://docs.controlmonkey.io/main-concepts/variables/variable-conditions)",
	NestedObject: schema.NestedAttributeObject{
		Attributes: map[string]schema.Attribute{
			"operator": schema.StringAttribute{
				Required:            true,
				MarkdownDescription: fmt.Sprintf("Logical operators. Allowed values: %s.", helpers.EnumForDocs(cmTypes.VariableConditionOperatorTypes)),
				Validators: []validator.String{
					stringvalidator.OneOf(cmTypes.VariableConditionOperatorTypes...),
				},
			},
			"value": schema.StringAttribute{
				Optional:            true,
				MarkdownDescription: fmt.Sprintf("The value associated with the operator. Input a number or string depending on the chosen operator. Use `values` field for operator of type `%s`", cmTypes.In),
				Validators:          []validator.String{cm_stringvalidators.NotBlank(), stringvalidator.ConflictsWith(path.MatchRelative().AtParent().AtName("values"))},
			},
			"values": schema.ListAttribute{
				ElementType:         types.StringType,
				Optional:            true,
				MarkdownDescription: fmt.Sprintf("A list of strings when using operator type `%s`. For other operators use `value`", cmTypes.In),
				Validators:          commons.ValidateUniqueNotEmptyListWithNoBlankValues(),
			},
		},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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