mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 15:50:15 -08:00
chore(terraform): add accessors to underlying raw hcl values (#8306)
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user