lang

package
v0.0.0-...-1f3526c Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func References

func References(traversals []hcl.Traversal) ([]*addrs.Reference, tfdiags.Diagnostics)

References finds all of the references in the given set of traversals, returning diagnostics if any of the traversals cannot be interpreted as a reference.

This function does not do any de-duplication of references, since references have source location information embedded in them and so any invalid references that are duplicated should have errors reported for each occurence.

If the returned diagnostics contains errors then the result may be incomplete or invalid. Otherwise, the returned slice has one reference per given traversal, though it is not guaranteed that the references will appear in the same order as the given traversals.

func ReferencesInBlock

func ReferencesInBlock(body hcl.Body, schema *configschema.Block) ([]*addrs.Reference, tfdiags.Diagnostics)

ReferencesInBlock is a helper wrapper around References that first searches the given body for traversals, before converting those traversals to references.

A block schema must be provided so that this function can determine where in the body variables are expected.

func ReferencesInExpr

func ReferencesInExpr(expr hcl.Expression) ([]*addrs.Reference, tfdiags.Diagnostics)

ReferencesInExpr is a helper wrapper around References that first searches the given expression for traversals, before converting those traversals to references.

Types

This section is empty.

Directories

Path Synopsis
Package blocktoattr includes some helper functions that can perform preprocessing on a HCL body where a configschema.Block schema is available in order to allow list and set attributes defined in the schema to be optionally written by the user as block syntax.
Package blocktoattr includes some helper functions that can perform preprocessing on a HCL body where a configschema.Block schema is available in order to allow list and set attributes defined in the schema to be optionally written by the user as block syntax.
Package types contains non-standard cty types used only within Terraform.
Package types contains non-standard cty types used only within Terraform.

Jump to

Keyboard shortcuts

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