Documentation ¶
Index ¶
- Variables
- func IsValidBlockReference(name string) bool
- func IsValidType(name string) bool
- func MapNestedAttribute[T any](block *Block, path string, f func(attr *Attribute, parent *Block) T) T
- type Attribute
- func (a *Attribute) AllReferences(blocks ...*Block) []*Reference
- func (a *Attribute) AsBoolValueOrDefault(defaultValue bool, parent *Block) iacTypes.BoolValue
- func (a *Attribute) AsBytesValueOrDefault(defaultValue []byte, parent *Block) iacTypes.BytesValue
- func (a *Attribute) AsIntValueOrDefault(defaultValue int, parent *Block) iacTypes.IntValue
- func (a *Attribute) AsMapValue() iacTypes.MapValue
- func (a *Attribute) AsNumber() float64
- func (a *Attribute) AsStringValueOrDefault(defaultValue string, parent *Block) iacTypes.StringValue
- func (a *Attribute) AsStringValueSliceOrEmpty() (stringValues []iacTypes.StringValue)
- func (a *Attribute) AsStringValues() iacTypes.StringValueList
- func (a *Attribute) AsStringValuesOrDefault(parent *Block, defaults ...string) []iacTypes.StringValue
- func (a *Attribute) Contains(checkValue any, equalityOptions ...EqualityOption) bool
- func (a *Attribute) DecodeVarType() (cty.Type, *typeexpr.Defaults, error)
- func (a *Attribute) Each(f func(key cty.Value, val cty.Value)) error
- func (a *Attribute) EndsWith(suffix any) bool
- func (a *Attribute) Equals(checkValue any, equalityOptions ...EqualityOption) bool
- func (a *Attribute) GetMetadata() iacTypes.Metadata
- func (a *Attribute) GetRawValue() any
- func (a *Attribute) GreaterThan(checkValue any) bool
- func (a *Attribute) GreaterThanOrEqualTo(checkValue any) bool
- func (a *Attribute) HasIntersect(checkValues ...any) bool
- func (a *Attribute) IsAny(options ...any) bool
- func (a *Attribute) IsBool() bool
- func (a *Attribute) IsDataBlockReference() bool
- func (a *Attribute) IsEmpty() bool
- func (a *Attribute) IsFalse() bool
- func (a *Attribute) IsIterable() bool
- func (a *Attribute) IsLiteral() bool
- func (a *Attribute) IsMapOrObject() bool
- func (a *Attribute) IsNil() bool
- func (a *Attribute) IsNone(options ...any) bool
- func (a *Attribute) IsNotAny(options ...any) bool
- func (a *Attribute) IsNotEmpty() bool
- func (a *Attribute) IsNotNil() bool
- func (a *Attribute) IsNotResolvable() bool
- func (a *Attribute) IsNumber() bool
- func (a *Attribute) IsResolvable() bool
- func (a *Attribute) IsResourceBlockReference(resourceType string) bool
- func (a *Attribute) IsString() bool
- func (a *Attribute) IsTrue() bool
- func (a *Attribute) LessThan(checkValue any) bool
- func (a *Attribute) LessThanOrEqualTo(checkValue any) bool
- func (a *Attribute) MapValue(mapKey string) cty.Value
- func (a *Attribute) Name() string
- func (a *Attribute) NotContains(checkValue any, equalityOptions ...EqualityOption) bool
- func (a *Attribute) NotEqual(checkValue any, equalityOptions ...EqualityOption) bool
- func (a *Attribute) NullableValue() (ctyVal cty.Value)
- func (a *Attribute) OnlyContains(checkValue any) bool
- func (a *Attribute) References(r Reference) bool
- func (a *Attribute) ReferencesBlock(b *Block) bool
- func (a *Attribute) RegexMatches(re regexp.Regexp) bool
- func (a *Attribute) StartsWith(prefix any) bool
- func (a *Attribute) Type() cty.Type
- func (a *Attribute) Value() (ctyVal cty.Value)
- type Block
- func (b *Block) AllBlocks() Blocks
- func (b *Block) Attributes() map[string]*Attribute
- func (b *Block) Clone(index cty.Value) *Block
- func (b *Block) Context() *context.Context
- func (b *Block) ExpandBlock() error
- func (b *Block) FullLocalName() string
- func (b *Block) FullName() string
- func (b *Block) GetAttribute(name string) *Attribute
- func (b *Block) GetAttributes() []*Attribute
- func (b *Block) GetBlock(name string) *Block
- func (b *Block) GetBlocks(name string) Blocks
- func (b *Block) GetFirstMatchingBlock(names ...string) *Block
- func (b *Block) GetMetadata() iacTypes.Metadata
- func (b *Block) GetNestedAttribute(name string) (*Attribute, *Block)
- func (b *Block) GetRawValue() any
- func (b *Block) GetValueByPath(path string) cty.Value
- func (b *Block) HasChild(childElement string) bool
- func (b *Block) ID() string
- func (b *Block) InModule() bool
- func (b *Block) IsEmpty() bool
- func (b *Block) IsExpanded() bool
- func (b *Block) IsNil() bool
- func (b *Block) IsNotNil() bool
- func (b *Block) IsResourceType(resourceType string) bool
- func (b *Block) Label() string
- func (b *Block) Labels() []string
- func (b *Block) LocalName() string
- func (b *Block) MissingChild(childElement string) bool
- func (b *Block) MissingNestedChild(name string) bool
- func (b *Block) ModuleKey() string
- func (b *Block) NameLabel() string
- func (b *Block) OverrideContext(ctx *context.Context)
- func (b *Block) Reference() Reference
- func (b *Block) Type() string
- func (b *Block) TypeLabel() string
- func (b *Block) UniqueName() string
- func (b *Block) Values() cty.Value
- type Blocks
- type EqualityOption
- type Module
- func (c *Module) GetBlockByID(id string) (*Block, error)
- func (c *Module) GetBlocks() Blocks
- func (h *Module) GetBlocksByTypeLabel(typeLabel string) Blocks
- func (c *Module) GetDatasByType(label string) Blocks
- func (c *Module) GetProviderBlocksByProvider(providerName, alias string) Blocks
- func (c *Module) GetReferencedBlock(referringAttr *Attribute, parentBlock *Block) (*Block, error)
- func (c *Module) GetReferencingBlocks(originalBlock *Block, ...) Blocks
- func (c *Module) GetReferencingResources(originalBlock *Block, referencingLabel, referencingAttributeName string) Blocks
- func (c *Module) GetResourcesByIDs(ids ...string) Blocks
- func (c *Module) GetResourcesByType(labels ...string) Blocks
- func (c *Module) GetsModulesBySource(moduleSource string) (Blocks, error)
- func (c *Module) Ignores() ignore.Rules
- func (c *Module) RootPath() string
- func (c *Module) SetParent(parent *Module)
- type Modules
- func (m Modules) GetBlockById(id string) (*Block, error)
- func (m Modules) GetBlockByIgnoreRange(blockMetadata *types.Metadata) *Block
- func (m Modules) GetBlocks() Blocks
- func (m Modules) GetChildResourceIDMapByType(typeLabels ...string) ResourceIDResolutions
- func (m Modules) GetDatasByType(typeLabel string) Blocks
- func (m Modules) GetReferencedBlock(referringAttr *Attribute, parentBlock *Block) (*Block, error)
- func (m Modules) GetReferencingResources(originalBlock *Block, referencingLabel, referencingAttributeName string) Blocks
- func (m Modules) GetResourceByIDs(id ...string) Blocks
- func (m Modules) GetResourcesByType(typeLabel ...string) Blocks
- type PlanBlock
- type PlanReference
- type Reference
- func (r Reference) BlockType() Type
- func (r Reference) HumanReadable() string
- func (r Reference) Key() string
- func (r Reference) KeyBracketed() string
- func (r Reference) LogicalID() string
- func (r Reference) NameLabel() string
- func (r Reference) RawKey() cty.Value
- func (r Reference) RefersTo(other Reference) bool
- func (r *Reference) SetKey(key cty.Value)
- func (r Reference) String() string
- func (r Reference) TypeLabel() string
- type ResourceIDResolutions
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var Schema = &hcl.BodySchema{ Blocks: []hcl.BlockHeaderSchema{ { Type: "terraform", }, { Type: "required_providers", }, { Type: "provider", LabelNames: []string{"name"}, }, { Type: "variable", LabelNames: []string{"name"}, }, { Type: "locals", }, { Type: "output", LabelNames: []string{"name"}, }, { Type: "module", LabelNames: []string{"name"}, }, { Type: "check", LabelNames: []string{"name"}, }, { Type: "resource", LabelNames: []string{"type", "name"}, }, { Type: "data", LabelNames: []string{"type", "name"}, }, { Type: "moved", }, { Type: "import", }, { Type: "removed", }, }, }
Schema is regularly lifted from terraform source to ensure compatibility
View Source
var TypeCheck = Type{ // contains filtered or unexported fields }
View Source
var TypeData = Type{ // contains filtered or unexported fields }
View Source
var TypeImport = Type{ // contains filtered or unexported fields }
View Source
var TypeLocal = Type{ // contains filtered or unexported fields }
View Source
var TypeModule = Type{ // contains filtered or unexported fields }
View Source
var TypeMoved = Type{ // contains filtered or unexported fields }
View Source
var TypeOutput = Type{ // contains filtered or unexported fields }
View Source
var TypeProvider = Type{ // contains filtered or unexported fields }
View Source
var TypeResource = Type{ // contains filtered or unexported fields }
View Source
var TypeTerraform = Type{ // contains filtered or unexported fields }
View Source
var TypeVariable = Type{ // contains filtered or unexported fields }
View Source
var ValidTypes = []Type{ TypeCheck, TypeData, TypeImport, TypeLocal, TypeModule, TypeMoved, TypeOutput, TypeProvider, TypeResource, TypeTerraform, TypeVariable, }
Functions ¶
func IsValidBlockReference ¶
func IsValidType ¶
Types ¶
type Attribute ¶
type Attribute struct {
// contains filtered or unexported fields
}
func NewAttribute ¶
func (*Attribute) AllReferences ¶
nolint
func (*Attribute) AsBoolValueOrDefault ¶
func (*Attribute) AsBytesValueOrDefault ¶
func (a *Attribute) AsBytesValueOrDefault(defaultValue []byte, parent *Block) iacTypes.BytesValue
func (*Attribute) AsIntValueOrDefault ¶
func (*Attribute) AsMapValue ¶
func (*Attribute) AsStringValueOrDefault ¶
func (a *Attribute) AsStringValueOrDefault(defaultValue string, parent *Block) iacTypes.StringValue
func (*Attribute) AsStringValueSliceOrEmpty ¶
func (a *Attribute) AsStringValueSliceOrEmpty() (stringValues []iacTypes.StringValue)
func (*Attribute) AsStringValues ¶
func (a *Attribute) AsStringValues() iacTypes.StringValueList
func (*Attribute) AsStringValuesOrDefault ¶
func (a *Attribute) AsStringValuesOrDefault(parent *Block, defaults ...string) []iacTypes.StringValue
func (*Attribute) Contains ¶
func (a *Attribute) Contains(checkValue any, equalityOptions ...EqualityOption) bool
func (*Attribute) DecodeVarType ¶
func (*Attribute) Equals ¶
func (a *Attribute) Equals(checkValue any, equalityOptions ...EqualityOption) bool
func (*Attribute) GetMetadata ¶
func (*Attribute) GetRawValue ¶
func (*Attribute) GreaterThan ¶
func (*Attribute) GreaterThanOrEqualTo ¶
func (*Attribute) HasIntersect ¶
func (*Attribute) IsDataBlockReference ¶
func (*Attribute) IsIterable ¶
func (*Attribute) IsMapOrObject ¶
func (*Attribute) IsNotEmpty ¶
func (*Attribute) IsNotResolvable ¶
func (*Attribute) IsResolvable ¶
func (*Attribute) IsResourceBlockReference ¶
func (*Attribute) LessThanOrEqualTo ¶
func (*Attribute) NotContains ¶
func (a *Attribute) NotContains(checkValue any, equalityOptions ...EqualityOption) bool
func (*Attribute) NotEqual ¶
func (a *Attribute) NotEqual(checkValue any, equalityOptions ...EqualityOption) bool
func (*Attribute) NullableValue ¶
Allows a null value for a variable https://developer.hashicorp.com/terraform/language/expressions/types#null
func (*Attribute) OnlyContains ¶
func (*Attribute) References ¶
func (*Attribute) ReferencesBlock ¶
func (*Attribute) StartsWith ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
func (*Block) Attributes ¶
func (*Block) ExpandBlock ¶
func (*Block) FullLocalName ¶
func (*Block) GetAttribute ¶
func (*Block) GetAttributes ¶
func (*Block) GetFirstMatchingBlock ¶
func (*Block) GetMetadata ¶
func (*Block) GetNestedAttribute ¶
func (*Block) GetRawValue ¶
func (*Block) GetValueByPath ¶
GetValueByPath returns the value of the attribute located at the given path. Supports special paths like "count.index," "each.key," and "each.value." The path may contain indices, keys and dots (used as separators).
func (*Block) IsExpanded ¶
func (*Block) IsResourceType ¶
func (*Block) MissingChild ¶
func (*Block) MissingNestedChild ¶
func (*Block) OverrideContext ¶
func (*Block) UniqueName ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) GetBlocksByTypeLabel ¶
func (*Module) GetDatasByType ¶
func (*Module) GetProviderBlocksByProvider ¶
func (*Module) GetReferencedBlock ¶
func (*Module) GetReferencingBlocks ¶
func (*Module) GetReferencingResources ¶
func (*Module) GetResourcesByIDs ¶
func (*Module) GetResourcesByType ¶
func (*Module) GetsModulesBySource ¶
type Modules ¶
type Modules []*Module
func (Modules) GetBlockByIgnoreRange ¶
func (Modules) GetChildResourceIDMapByType ¶
func (m Modules) GetChildResourceIDMapByType(typeLabels ...string) ResourceIDResolutions
func (Modules) GetDatasByType ¶
func (Modules) GetReferencedBlock ¶
func (Modules) GetReferencingResources ¶
func (Modules) GetResourceByIDs ¶
func (Modules) GetResourcesByType ¶
type PlanBlock ¶
type PlanBlock struct { Type string Name string BlockType string Blocks map[string]map[string]any Attributes map[string]any }
func NewPlanBlock ¶
func (*PlanBlock) HasAttribute ¶
type PlanReference ¶
type PlanReference struct {
Value any
}
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
func (Reference) HumanReadable ¶
func (Reference) KeyBracketed ¶
type ResourceIDResolutions ¶
func (ResourceIDResolutions) Orphans ¶
func (r ResourceIDResolutions) Orphans() (orphanIDs []string)
func (ResourceIDResolutions) Resolve ¶
func (r ResourceIDResolutions) Resolve(id string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.