tfgcv

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package tfgcv pulls together the other packages in this project to take a terraform plan, extract the planned resources in Google CAI format, and run those CAI assets through the Config Validator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadPlannedAssets

func ReadPlannedAssets(ctx context.Context, path, project, zone, region string, ancestry map[string]string, offline, convertUnchanged bool, errorLogger *zap.Logger, userAgent string) ([]google.Asset, error)

ReadPlannedAssets extracts CAI assets from a terraform plan file. If ancestry path is provided, it assumes the project is in that path rather than fetching the ancestry information using Google API. If convertUnchanged is set then resources that do not have any change from their deployed state are also reported in the output, otherwise only resources that are going to be changed are reported. It ignores non-supported resources.

func ValidateAssets

func ValidateAssets(ctx context.Context, assets []google.Asset, policyRootPath string) ([]*validator.Violation, error)

ValidateAssets instantiates GCV and audits CAI assets using "policies" and "lib" folder under policyRootPath.

func ValidateAssetsWithLibrary

func ValidateAssetsWithLibrary(ctx context.Context, assets []google.Asset, policyPaths []string, policyLibraryDir string) ([]*validator.Violation, error)

ValidateAssetsWithLibrary instantiates GCV and audits CAI assets.

Types

type ReadPlannedAssetsFunc added in v0.8.0

type ReadPlannedAssetsFunc func(ctx context.Context, path, project, zone, region string, ancestry map[string]string, offline, convertUnchanged bool, errorLogger *zap.Logger, userAgent string) ([]google.Asset, error)

type ValidateAssetsFunc added in v0.8.0

type ValidateAssetsFunc func(ctx context.Context, assets []google.Asset, policyRootPath string) ([]*validator.Violation, error)

Jump to

Keyboard shortcuts

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