Documentation
¶
Overview ¶
Copyright The Cloud Custodian Authors. SPDX-License-Identifier: Apache-2.0
Copyright The Cloud Custodian Authors. SPDX-License-Identifier: Apache-2.0
Copyright The Cloud Custodian Authors. SPDX-License-Identifier: Apache-2.0
Copyright The Cloud Custodian Authors. SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTerraformConverter ¶
func NewTerraformConverter(filePath string, opts ...TerraformConverterOption) (*terraformConverter, error)
NewTerraformConverter creates a new TerraformConverter. A TerraformConverter loads the HCL from the filePath and parses it in to memory as "blocks". These blocks get extrated as JSON structured data for use by other tools.
Types ¶
type TerraformConverter ¶
type TerraformConverter interface {
VisitJSON() *gabs.Container
}
TerraformConverter uses defsec to parse HCL blocks in to memory and output them as JSON. Further post-processing can be done on the HCL blocks in memory by calling the public methods of TerraformConverter.
type TerraformConverterOption ¶
type TerraformConverterOption func(t TerraformConverterOptions)
func WithAllowDownloads ¶
func WithAllowDownloads(allowed bool) TerraformConverterOption
WithStopOnHCLError sets the underlying defsec parser to error and stop on HCL parsing errors.
func WithDebug ¶
func WithDebug() TerraformConverterOption
WithDebug specifies an io.Writer for debug logs - if not set, they are discarded
func WithStopOnHCLError ¶
func WithStopOnHCLError() TerraformConverterOption
WithStopOnHCLError sets the underlying defsec parser to error and stop on HCL parsing errors.
func WithTFVarsPaths ¶
func WithTFVarsPaths(paths ...string) TerraformConverterOption
WithTFVarsPaths sets a variables file for hcl interpolation.
func WithWorkspaceName ¶
func WithWorkspaceName(workspace string) TerraformConverterOption
WithWorkspaceName sets the Terraform workspace name.