Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidatePrebuilds ¶ added in v1.0.6
ValidatePrebuilds will iterate over each preset, validate the inputs as a set, and attach any diagnostics to the preset if there are issues. This must be done because prebuilds have to be valid without user input.
This will only validate presets that have prebuilds configured and have no existing error diagnostics. This should only be used when doing Template Imports as a protection against invalid presets.
A preset doesn't need to specify all required parameters, as users can provide the remaining values when creating a workspace. However, since prebuild creation has no user input, presets used for prebuilds must provide all required parameter values.
Types ¶
type Input ¶
type Input struct {
// PlanJSONPath is an optional path to a plan file. If PlanJSON isn't
// specified, and PlanJSONPath is, then the file will be read and treated
// as if the contents were passed in directly.
PlanJSONPath string
PlanJSON json.RawMessage
ParameterValues map[string]string
Owner types.WorkspaceOwner
Logger *slog.Logger
// TFVars will override any variables set in '.tfvars' files.
// The value set must be a cty.Value, as the type can be anything.
TFVars map[string]cty.Value
}
type Output ¶
type Output struct {
// ModuleOutput is any 'output' values from the terraform files. This has 0
// effect on the parameters, tags, etc. It can be helpful for debugging, as it
// allows exporting some terraform values to the caller to review.
//
// JSON marshalling is handled in the custom methods.
ModuleOutput cty.Value `json:"-"`
Parameters []types.Parameter `json:"parameters"`
WorkspaceTags types.TagBlocks `json:"workspace_tags"`
Presets []types.Preset `json:"presets"`
Variables []types.Variable `json:"variables"`
// Files is included for printing diagnostics.
// They can be marshalled, but not unmarshalled. This is a limitation
// of the HCL library.
Files map[string]*hcl.File `json:"-"`
}
func (Output) MarshalJSON ¶ added in v1.0.0
MarshalJSON includes the ModuleOutput and files in the JSON output. Output should never be unmarshalled. Marshalling to JSON is strictly useful for debugging information.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
preview
command
|
|
|
internal
|
|
|
Package gorules defines custom lint rules for ruleguard.
|
Package gorules defines custom lint rules for ruleguard. |
|
Code taken from https://github.com/aquasecurity/trivy/blob/0449787eb52854cbdd7f4c5794adbf58965e60f8/pkg/iac/scanners/terraform/parser/load_vars.go
|
Code taken from https://github.com/aquasecurity/trivy/blob/0449787eb52854cbdd7f4c5794adbf58965e60f8/pkg/iac/scanners/terraform/parser/load_vars.go |