converter

package
v0.0.0-...-5a3b474 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

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.

type TerraformConverterOptions

type TerraformConverterOptions interface {
	SetDebug()
	SetStopOnHCLError()
	SetAllowDownloads(allowed bool)
	SetTFVarsPaths(paths ...string)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL