Package tfjson is a de-coupled helper library containing types for the plan format output by "terraform show -json" command. This command is designed for the export of Terraform plan data in a format that can be easily processed by tools unrelated to Terraform.
This format is stable and should be used over the binary plan data whenever possible.
This section is empty.
View Sourcevar MetadataFunctionsFormatVersionConstraints = "~> 1.0"
MetadataFunctionsFormatVersionConstraints defines the versions of the JSON metadata functions format that are supported by this package.
View Sourcevar PlanFormatVersionConstraints = ">= 0.1, < 2.0"
PlanFormatVersionConstraints defines the versions of the JSON plan format that are supported by this package.
View Sourcevar ProviderSchemasFormatVersionConstraints = ">= 0.1, < 2.0"
ProviderSchemasFormatVersionConstraints defines the versions of the JSON provider schema format that are supported by this package.
View Sourcevar StateFormatVersionConstraints = ">= 0.1, < 2.0"
StateFormatVersionConstraints defines the versions of the JSON state format that are supported by this package.
View Sourcevar UnknownConstantValue = &unknownConstantValue{}
UnknownConstantValue is a singleton type that denotes that a constant value is explicitly unknown. This is set during an unmarshal when references are found in an expression to help more explicitly differentiate between an explicit null and unknown value.
View Sourcevar ValidateFormatVersionConstraints = ">= 0.1, < 2.0"
ValidateFormatVersionConstraints defines the versions of the JSON validate format that are supported by this package.
This section is empty.
Action is a valid action type for a resource change.
Note that a singular Action is not telling of a full resource change operation. Certain resource actions, such as replacement, are a composite of more than one type. See the Actions type and its helpers for more information.
const ( ActionNoop Action = "no-op" ActionCreate Action = "create" ActionRead Action = "read" ActionUpdate Action = "update" ActionDelete Action = "delete" ActionForget Action = "forget" )
Actions denotes a valid change type.
Create is true if this set of Actions denotes creation of a new resource.
CreateBeforeDestroy is true if this set of Actions denotes a create-before-destroy operation, usually the result of replacement to a resource that has the create_before_destroy lifecycle option set.
Delete is true if this set of Actions denotes resource removal.
DestroyBeforeCreate is true if this set of Actions denotes a destroy-before-create operation. This is the standard resource replacement method.
Forget is true if this set of Actions denotes a forget operation.
NoOp is true if this set of Actions denotes a no-op.
Read is true if this set of Actions denotes a read operation only.
Replace is true if this set of Actions denotes a valid replacement operation.
Update is true if this set of Actions denotes an update operation.
type Change struct { Actions Actions `json:"actions,omitempty"` Before interface{} `json:"before,"` After interface{} `json:"after,omitempty"` AfterUnknown interface{} `json:"after_unknown,omitempty"` BeforeSensitive interface{} `json:"before_sensitive,omitempty"` AfterSensitive interface{} `json:"after_sensitive,omitempty"` Importing *Importing `json:"importing,omitempty"` GeneratedConfig string `json:"generated_config,omitempty"` ReplacePaths []interface{} `json:"replace_paths,omitempty"` BeforeIdentity interface{} `json:"before_identity,omitempty"` AfterIdentity interface{} `json:"after_identity,omitempty"` }
Change is the representation of a proposed change for an object.
type CheckDynamicAddress struct { ToDisplay string `json:"to_display"` Module string `json:"module,omitempty"` InstanceKey interface{} `json:"instance_key,omitempty"` }
CheckDynamicAddress contains the InstanceKey field for any resources that have multiple instances. A complete address can be built by combining the CheckStaticAddress with the CheckDynamicAddress.
CheckKind is a string representation of the type of conditional check referenced in a check result.
const ( CheckKindResource CheckKind = "resource" CheckKindOutputValue CheckKind = "output_value" CheckKindCheckBlock CheckKind = "check" )
CheckResultDynamic describes the check result for a dynamic object that results from the expansion of the containing object.
type CheckResultProblem struct { Message string `json:"message"` }
CheckResultProblem describes one of potentially several problems that led to a check being classied as CheckStatusFail.
CheckResultStatic is the container for a "checkable object".
A "checkable object" is a resource or data source, an output, or a check block.
type CheckStaticAddress struct { ToDisplay string `json:"to_display"` Kind CheckKind `json:"kind"` Module string `json:"module,omitempty"` Mode ResourceMode `json:"mode,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` }
CheckStaticAddress details the address of the object that performed a given check. The static address points to the overall resource, as opposed to the dynamic address which contains the instance key for any resource that has multiple instances.
CheckStatus is a string representation of the status of a given conditional check.
Config represents the complete configuration source.
Validate checks to ensure that the config is present.
ConfigModule describes a module in Terraform configuration.
type ConfigOutput struct { Sensitive bool `json:"sensitive,omitempty"` Expression *Expression `json:"expression,omitempty"` Description string `json:"description,omitempty"` DependsOn []string `json:"depends_on,omitempty"` }
ConfigOutput defines an output as defined in configuration.
type ConfigProvisioner struct { Type string `json:"type,omitempty"` Expressions map[string]*Expression `json:"expressions,omitempty"` }
ConfigProvisioner describes a provisioner declared in a resource configuration.
type ConfigResource struct { Address string `json:"address,omitempty"` Mode ResourceMode `json:"mode,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` ProviderConfigKey string `json:"provider_config_key,omitempty"` Provisioners []*ConfigProvisioner `json:"provisioners,omitempty"` Expressions map[string]*Expression `json:"expressions,omitempty"` SchemaVersion uint64 `json:"schema_version"` CountExpression *Expression `json:"count_expression,omitempty"` ForEachExpression *Expression `json:"for_each_expression,omitempty"` DependsOn []string `json:"depends_on,omitempty"` }
ConfigResource is the configuration representation of a resource.
type ConfigVariable struct { Default interface{} `json:"default,omitempty"` Description string `json:"description,omitempty"` Sensitive bool `json:"sensitive,omitempty"` }
ConfigVariable defines a variable as defined in configuration.
type DeferredResourceChange struct { Reason string `json:"reason,omitempty"` ResourceChange *ResourceChange `json:"resource_change,omitempty"` }
DeferredResourceChange is a description of a resource change that has been deferred for some reason.
Diagnostic represents information to be presented to a user about an error or anomaly in parsing or evaluating configuration
type DiagnosticExpressionValue struct { Traversal string `json:"traversal"` Statement string `json:"statement"` }
DiagnosticExpressionValue represents an HCL traversal string (e.g. "var.foo") and a statement about its value while the expression was evaluated (e.g. "is a string", "will be known only after apply"). These are intended to help the consumer diagnose why an expression caused a diagnostic to be emitted.
type DiagnosticSeverity string
These severities map to the tfdiags.Severity values, plus an explicit unknown in case that enum grows without us noticing here.
type DiagnosticSnippet struct { Context *string `json:"context"` Code string `json:"code"` StartLine int `json:"start_line"` HighlightStartOffset int `json:"highlight_start_offset"` HighlightEndOffset int `json:"highlight_end_offset"` Values []DiagnosticExpressionValue `json:"values"` }
DiagnosticSnippet represents source code information about the diagnostic. It is possible for a diagnostic to have a source (and therefore a range) but no source code can be found. In this case, the range field will be present and the snippet field will not.
Expression describes the format for an individual key in a Terraform configuration.
This struct wraps ExpressionData to support custom JSON parsing.
MarshalJSON implements json.Marshaler for Expression.
UnmarshalJSON implements json.Unmarshaler for Expression.
type ExpressionData struct { ConstantValue interface{} `json:"constant_value,omitempty"` References []string `json:"references,omitempty"` NestedBlocks []map[string]*Expression `json:"-"` }
ExpressionData describes the format for an individual key in a Terraform configuration.
type FunctionParameter struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` IsNullable bool `json:"is_nullable,omitempty"` Type cty.Type `json:"type"` }
FunctionParameter represents a parameter to a function.
type FunctionSignature struct { Description string `json:"description,omitempty"` Summary string `json:"summary,omitempty"` DeprecationMessage string `json:"deprecation_message,omitempty"` ReturnType cty.Type `json:"return_type"` Parameters []*FunctionParameter `json:"parameters,omitempty"` VariadicParameter *FunctionParameter `json:"variadic_parameter,omitempty"` }
FunctionSignature represents a function signature.
type IdentityAttribute struct { IdentityType cty.Type `json:"type,omitempty"` Description string `json:"description,omitempty"` RequiredForImport bool `json:"required_for_import,omitempty"` OptionalForImport bool `json:"optional_for_import,omitempty"` }
IdentityAttribute describes an identity attribute
IdentitySchema is the JSON representation of a particular resource identity schema
type Importing struct { ID string `json:"id,omitempty"` Unknown bool `json:"unknown,omitempty"` Identity interface{} `json:"identity,omitempty"` }
Importing is a nested object for the resource import metadata.
type MetadataFunctions struct { FormatVersion string `json:"format_version"` Signatures map[string]*FunctionSignature `json:"function_signatures,omitempty"` }
MetadataFunctions is the top-level object returned when exporting function signatures
Validate checks to ensure that MetadataFunctions is present, and the version matches the version supported by this library.
type ModuleCall struct { Source string `json:"source,omitempty"` Expressions map[string]*Expression `json:"expressions,omitempty"` CountExpression *Expression `json:"count_expression,omitempty"` ForEachExpression *Expression `json:"for_each_expression,omitempty"` Module *ConfigModule `json:"module,omitempty"` VersionConstraint string `json:"version_constraint,omitempty"` DependsOn []string `json:"depends_on,omitempty"` }
ModuleCall describes a declared "module" within a configuration. It also contains the data for the module itself.
type Plan struct { FormatVersion string `json:"format_version,omitempty"` TerraformVersion string `json:"terraform_version,omitempty"` Variables map[string]*PlanVariable `json:"variables,omitempty"` PlannedValues *StateValues `json:"planned_values,omitempty"` ResourceDrift []*ResourceChange `json:"resource_drift,omitempty"` ResourceChanges []*ResourceChange `json:"resource_changes,omitempty"` DeferredChanges []*DeferredResourceChange `json:"deferred_changes,omitempty"` Complete *bool `json:"complete,omitempty"` OutputChanges map[string]*Change `json:"output_changes,omitempty"` PriorState *State `json:"prior_state,omitempty"` Config *Config `json:"configuration,omitempty"` RelevantAttributes []ResourceAttribute `json:"relevant_attributes,omitempty"` Checks []CheckResultStatic `json:"checks,omitempty"` Timestamp string `json:"timestamp,omitempty"` }
Plan represents the entire contents of an output Terraform plan.
UseJSONNumber controls whether the Plan will be decoded using the json.Number behavior or the float64 behavior. When b is true, the Plan will represent numbers in PlanOutputs as json.Numbers. When b is false, the Plan will represent numbers in PlanOutputs as float64s.
Validate checks to ensure that the plan is present, and the version matches the version supported by this library.
type PlanVariable struct { Value interface{} `json:"value,omitempty"` }
PlanVariable is a top-level variable in the Terraform plan.
type Pos struct { Line int `json:"line"` Column int `json:"column"` Byte int `json:"byte"` }
Pos represents a position in a config file
type ProviderConfig struct { Name string `json:"name,omitempty"` FullName string `json:"full_name,omitempty"` Alias string `json:"alias,omitempty"` ModuleAddress string `json:"module_address,omitempty"` Expressions map[string]*Expression `json:"expressions,omitempty"` VersionConstraint string `json:"version_constraint,omitempty"` }
ProviderConfig describes a provider configuration instance.
type ProviderSchema struct { ConfigSchema *Schema `json:"provider,omitempty"` ResourceSchemas map[string]*Schema `json:"resource_schemas,omitempty"` DataSourceSchemas map[string]*Schema `json:"data_source_schemas,omitempty"` EphemeralResourceSchemas map[string]*Schema `json:"ephemeral_resource_schemas,omitempty"` Functions map[string]*FunctionSignature `json:"functions,omitempty"` ResourceIdentitySchemas map[string]*IdentitySchema `json:"resource_identity_schemas,omitempty"` ListResourceSchemas map[string]*Schema `json:"list_resource_schemas,omitempty"` }
ProviderSchema is the JSON representation of the schema of an entire provider, including the provider configuration and any resources and data sources included with the provider.
type ProviderSchemas struct { FormatVersion string `json:"format_version,omitempty"` Schemas map[string]*ProviderSchema `json:"provider_schemas,omitempty"` }
ProviderSchemas represents the schemas of all providers and resources in use by the configuration.
Validate checks to ensure that ProviderSchemas is present, and the version matches the version supported by this library.
type Range struct { Filename string `json:"filename"` Start Pos `json:"start"` End Pos `json:"end"` }
Range represents a range of bytes between two positions
type ResourceAttribute struct { Resource string `json:"resource"` Attribute []json.RawMessage `json:"attribute"` }
ResourceAttribute describes a full path to a resource attribute
type ResourceChange struct { Address string `json:"address,omitempty"` PreviousAddress string `json:"previous_address,omitempty"` ModuleAddress string `json:"module_address,omitempty"` Mode ResourceMode `json:"mode,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Index interface{} `json:"index,omitempty"` ProviderName string `json:"provider_name,omitempty"` DeposedKey string `json:"deposed,omitempty"` Change *Change `json:"change,omitempty"` }
ResourceChange is a description of an individual change action that Terraform plans to use to move from the prior state to a new state matching the configuration.
ResourceMode is a string representation of the resource type found in certain fields in the plan.
type Schema struct { Version uint64 `json:"version"` Block *SchemaBlock `json:"block,omitempty"` }
Schema is the JSON representation of a particular schema (provider configuration, resources, data sources).
type SchemaAttribute struct { AttributeType cty.Type `json:"type,omitempty"` AttributeNestedType *SchemaNestedAttributeType `json:"nested_type,omitempty"` Description string `json:"description,omitempty"` DescriptionKind SchemaDescriptionKind `json:"description_kind,omitempty"` Deprecated bool `json:"deprecated,omitempty"` Required bool `json:"required,omitempty"` Optional bool `json:"optional,omitempty"` Computed bool `json:"computed,omitempty"` Sensitive bool `json:"sensitive,omitempty"` WriteOnly bool `json:"write_only,omitempty"` }
SchemaAttribute describes an attribute within a schema block.
SchemaBlock represents a nested block within a particular schema.
type SchemaBlockType struct { NestingMode SchemaNestingMode `json:"nesting_mode,omitempty"` Block *SchemaBlock `json:"block,omitempty"` MinItems uint64 `json:"min_items,omitempty"` MaxItems uint64 `json:"max_items,omitempty"` }
SchemaBlockType describes a nested block within a schema.
type SchemaDescriptionKind string
SchemaDescriptionKind describes the format type for a particular description's field.
type SchemaNestedAttributeType struct { Attributes map[string]*SchemaAttribute `json:"attributes,omitempty"` NestingMode SchemaNestingMode `json:"nesting_mode,omitempty"` MinItems uint64 `json:"min_items,omitempty"` MaxItems uint64 `json:"max_items,omitempty"` }
SchemaNestedAttributeType describes a nested attribute which could also be just expressed simply as cty.Object(...), cty.List(cty.Object(...)) etc. but this allows tracking additional metadata which can help interpreting or validating the data.
SchemaNestingMode is the nesting mode for a particular nested schema block.
type State struct { FormatVersion string `json:"format_version,omitempty"` TerraformVersion string `json:"terraform_version,omitempty"` Values *StateValues `json:"values,omitempty"` Checks []CheckResultStatic `json:"checks,omitempty"` }
State is the top-level representation of a Terraform state.
UseJSONNumber controls whether the State will be decoded using the json.Number behavior or the float64 behavior. When b is true, the State will represent numbers in StateOutputs as json.Numbers. When b is false, the State will represent numbers in StateOutputs as float64s.
Validate checks to ensure that the state is present, and the version matches the version supported by this library.
type StateModule struct { Resources []*StateResource `json:"resources,omitempty"` Address string `json:"address,omitempty"` ChildModules []*StateModule `json:"child_modules,omitempty"` }
StateModule is the representation of a module in the common state representation. This can be the root module or a child module.
type StateOutput struct { Sensitive bool `json:"sensitive"` Value interface{} `json:"value,omitempty"` Type cty.Type `json:"type,omitempty"` }
StateOutput represents an output value in a common state representation.
type StateResource struct { Address string `json:"address,omitempty"` Mode ResourceMode `json:"mode,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Index interface{} `json:"index,omitempty"` ProviderName string `json:"provider_name,omitempty"` SchemaVersion uint64 `json:"schema_version,"` AttributeValues map[string]interface{} `json:"values,omitempty"` SensitiveValues json.RawMessage `json:"sensitive_values,omitempty"` DependsOn []string `json:"depends_on,omitempty"` Tainted bool `json:"tainted,omitempty"` DeposedKey string `json:"deposed_key,omitempty"` IdentitySchemaVersion *uint64 `json:"identity_schema_version,omitempty"` IdentityValues map[string]interface{} `json:"identity,omitempty"` }
StateResource is the representation of a resource in the common state representation.
type StateValues struct { Outputs map[string]*StateOutput `json:"outputs,omitempty"` RootModule *StateModule `json:"root_module,omitempty"` }
StateValues is the common representation of resolved values for both the prior state (which is always complete) and the planned new state.
type ValidateOutput struct { FormatVersion string `json:"format_version"` Valid bool `json:"valid"` ErrorCount int `json:"error_count"` WarningCount int `json:"warning_count"` Diagnostics []Diagnostic `json:"diagnostics"` }
ValidateOutput represents JSON output from terraform validate (available from 0.12 onwards)
Validate checks to ensure that data is present, and the version matches the version supported by this library.
type VersionOutput struct { Version string `json:"terraform_version"` Revision string `json:"terraform_revision"` Platform string `json:"platform,omitempty"` ProviderSelections map[string]string `json:"provider_selections"` Outdated bool `json:"terraform_outdated"` }
VersionOutput represents output from the version -json command added in v0.13
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4