Documentation ¶
Index ¶
- Variables
- func IsValidBlockReference(name string) bool
- func IsValidType(name string) bool
- type Attribute
- func (a *Attribute) AllReferences(blocks ...*Block) []*Reference
- func (a *Attribute) AsBoolValueOrDefault(defaultValue bool, parent *Block) defsecTypes.BoolValue
- func (a *Attribute) AsBytesValueOrDefault(defaultValue []byte, parent *Block) defsecTypes.BytesValue
- func (a *Attribute) AsIntValueOrDefault(defaultValue int, parent *Block) defsecTypes.IntValue
- func (a *Attribute) AsNumber() float64
- func (a *Attribute) AsStringValueOrDefault(defaultValue string, parent *Block) defsecTypes.StringValue
- func (a *Attribute) AsStringValueSliceOrEmpty(parent *Block) (stringValues []defsecTypes.StringValue)
- func (a *Attribute) AsStringValues() defsecTypes.StringValueList
- func (a *Attribute) Contains(checkValue interface{}, equalityOptions ...EqualityOption) bool
- func (a *Attribute) Each(f func(key cty.Value, val cty.Value)) error
- func (a *Attribute) EndsWith(suffix interface{}) bool
- func (a *Attribute) Equals(checkValue interface{}, equalityOptions ...EqualityOption) bool
- func (a *Attribute) GetMetadata() defsecTypes.Metadata
- func (a *Attribute) GetRawValue() interface{}
- func (a *Attribute) GreaterThan(checkValue interface{}) bool
- func (a *Attribute) GreaterThanOrEqualTo(checkValue interface{}) bool
- func (a *Attribute) HasIntersect(checkValues ...interface{}) bool
- func (a *Attribute) IsAny(options ...interface{}) 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) IsNil() bool
- func (a *Attribute) IsNone(options ...interface{}) bool
- func (a *Attribute) IsNotAny(options ...interface{}) 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 interface{}) bool
- func (a *Attribute) LessThanOrEqualTo(checkValue interface{}) bool
- func (a *Attribute) MapValue(mapKey string) cty.Value
- func (a *Attribute) Name() string
- func (a *Attribute) NotContains(checkValue interface{}, equalityOptions ...EqualityOption) bool
- func (a *Attribute) NotEqual(checkValue interface{}, equalityOptions ...EqualityOption) bool
- func (a *Attribute) NullableValue() (ctyVal cty.Value)
- func (a *Attribute) OnlyContains(checkValue interface{}) 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 interface{}) 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) 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() defsecTypes.Metadata
- func (b *Block) GetNestedAttribute(name string) *Attribute
- func (b *Block) GetRawValue() interface{}
- func (b *Block) HasChild(childElement string) bool
- func (b *Block) ID() string
- func (b *Block) InModule() bool
- func (b *Block) InjectBlock(block *Block, name string)
- func (b *Block) IsCountExpanded() bool
- func (b *Block) IsEmpty() 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) ModuleName() 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 Ignore
- type Ignores
- 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 string, alias string) Blocks
- func (c *Module) GetReferencedBlock(referringAttr *Attribute, parentBlock *Block) (*Block, error)
- func (c *Module) GetReferencingBlocks(originalBlock *Block, referencingType string, referencingLabel string, ...) Blocks
- func (c *Module) GetReferencingResources(originalBlock *Block, referencingLabel string, 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() Ignores
- func (c *Module) RootPath() string
- 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) GetReferencedBlock(referringAttr *Attribute, parentBlock *Block) (*Block, error)
- func (m Modules) GetReferencingResources(originalBlock *Block, referencingLabel string, 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", }, }, }
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 ¶
func (*Attribute) AsBoolValueOrDefault ¶
func (a *Attribute) AsBoolValueOrDefault(defaultValue bool, parent *Block) defsecTypes.BoolValue
func (*Attribute) AsBytesValueOrDefault ¶
func (a *Attribute) AsBytesValueOrDefault(defaultValue []byte, parent *Block) defsecTypes.BytesValue
func (*Attribute) AsIntValueOrDefault ¶
func (a *Attribute) AsIntValueOrDefault(defaultValue int, parent *Block) defsecTypes.IntValue
func (*Attribute) AsStringValueOrDefault ¶
func (a *Attribute) AsStringValueOrDefault(defaultValue string, parent *Block) defsecTypes.StringValue
func (*Attribute) AsStringValueSliceOrEmpty ¶ added in v0.60.0
func (a *Attribute) AsStringValueSliceOrEmpty(parent *Block) (stringValues []defsecTypes.StringValue)
func (*Attribute) AsStringValues ¶ added in v0.60.0
func (a *Attribute) AsStringValues() defsecTypes.StringValueList
func (*Attribute) Contains ¶
func (a *Attribute) Contains(checkValue interface{}, equalityOptions ...EqualityOption) bool
func (*Attribute) Equals ¶
func (a *Attribute) Equals(checkValue interface{}, equalityOptions ...EqualityOption) bool
func (*Attribute) GetMetadata ¶
func (a *Attribute) GetMetadata() defsecTypes.Metadata
func (*Attribute) GetRawValue ¶
func (a *Attribute) GetRawValue() interface{}
func (*Attribute) GreaterThan ¶
func (*Attribute) GreaterThanOrEqualTo ¶
func (*Attribute) HasIntersect ¶
func (*Attribute) IsDataBlockReference ¶
func (*Attribute) IsIterable ¶
func (*Attribute) IsNotEmpty ¶
func (*Attribute) IsNotResolvable ¶
func (*Attribute) IsResolvable ¶
func (*Attribute) IsResourceBlockReference ¶
func (*Attribute) LessThanOrEqualTo ¶
func (*Attribute) NotContains ¶
func (a *Attribute) NotContains(checkValue interface{}, equalityOptions ...EqualityOption) bool
func (*Attribute) NotEqual ¶
func (a *Attribute) NotEqual(checkValue interface{}, equalityOptions ...EqualityOption) bool
func (*Attribute) NullableValue ¶ added in v0.90.2
Allows a null value for a variable https://developer.hashicorp.com/terraform/language/expressions/types#null
func (*Attribute) OnlyContains ¶ added in v0.76.0
func (*Attribute) References ¶
func (*Attribute) ReferencesBlock ¶
func (*Attribute) StartsWith ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
func (*Block) Attributes ¶
func (*Block) GetAttribute ¶
func (*Block) GetAttributes ¶
func (*Block) GetFirstMatchingBlock ¶
func (*Block) GetMetadata ¶
func (b *Block) GetMetadata() defsecTypes.Metadata
func (*Block) GetNestedAttribute ¶
func (*Block) GetRawValue ¶
func (b *Block) GetRawValue() interface{}
func (*Block) InjectBlock ¶
func (*Block) IsCountExpanded ¶
func (*Block) IsResourceType ¶
func (*Block) MissingChild ¶
func (*Block) MissingNestedChild ¶
func (*Block) ModuleName ¶
func (*Block) OverrideContext ¶
func (*Block) UniqueName ¶
type Ignore ¶
type Ignore struct { Range defsecTypes.Range RuleID string Expiry *time.Time Workspace string Block bool Params map[string]string }
func (Ignore) MatchParams ¶
func (ignore Ignore) MatchParams(modules Modules, blockMetadata *defsecTypes.Metadata) bool
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) GetBlockByID ¶ added in v0.71.10
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) GetBlockById ¶ added in v0.71.10
func (Modules) GetBlockByIgnoreRange ¶
func (Modules) GetChildResourceIDMapByType ¶
func (m Modules) GetChildResourceIDMapByType(typeLabels ...string) ResourceIDResolutions
func (Modules) GetReferencedBlock ¶
func (Modules) GetReferencingResources ¶
func (Modules) GetResourceByIDs ¶
func (Modules) GetResourcesByType ¶
type PlanBlock ¶ added in v0.39.0
type PlanBlock struct { Type string Name string BlockType string Blocks map[string]map[string]interface{} Attributes map[string]interface{} }
func NewPlanBlock ¶ added in v0.39.0
func (*PlanBlock) HasAttribute ¶ added in v0.39.0
type PlanReference ¶ added in v0.39.0
type PlanReference struct {
Value interface{}
}
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)
Click to show internal directories.
Click to hide internal directories.