chore(terraform): add accessors to underlying raw hcl values (#8306)

This commit is contained in:
Steven Masley
2025-01-30 00:53:07 -06:00
committed by GitHub
parent 2e8e38a8c0
commit 87f3751172
3 changed files with 12 additions and 0 deletions

View File

@@ -90,6 +90,10 @@ func (p *Parser) newModuleParser(moduleFS fs.FS, moduleSource, modulePath, modul
return mp
}
func (p *Parser) Files() map[string]*hcl.File {
return p.underlying.Files()
}
func (p *Parser) ParseFile(_ context.Context, fullPath string) error {
isJSON := strings.HasSuffix(fullPath, ".tf.json")

View File

@@ -61,6 +61,10 @@ func NewAttribute(attr *hcl.Attribute, ctx *context.Context, module string, pare
}
}
func (a *Attribute) HCLAttribute() *hcl.Attribute {
return a.hclAttribute
}
func (a *Attribute) GetMetadata() iacTypes.Metadata {
return a.metadata
}

View File

@@ -123,6 +123,10 @@ func NewBlock(hclBlock *hcl.Block, ctx *context.Context, moduleBlock *Block, par
return &b
}
func (b *Block) HCLBlock() *hcl.Block {
return b.hclBlock
}
func (b *Block) ID() string {
return b.id
}