google

package
v2.2.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

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateAsset = errors.New("duplicate asset")

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Name          string                    `json:"name"`
	Type          string                    `json:"asset_type"`
	Resource      *caiasset.AssetResource   `json:"resource,omitempty"`
	IAMPolicy     *caiasset.IAMPolicy       `json:"iam_policy,omitempty"`
	OrgPolicy     []*caiasset.OrgPolicy     `json:"org_policy,omitempty"`
	V2OrgPolicies []*caiasset.V2OrgPolicies `json:"v2_org_policies,omitempty"`

	Ancestors []string `json:"ancestors"`
	// contains filtered or unexported fields
}

Asset contains the resource data and metadata in the same format as Google CAI (Cloud Asset Inventory).

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

Converter knows how to convert terraform resources to their Google CAI (Cloud Asset Inventory) format (the Asset type).

func NewConverter

func NewConverter(cfg *resources.Config, ancestryManager ancestrymanager.AncestryManager, offline bool, convertUnchanged bool, errorLogger *zap.Logger) *Converter

NewConverter is a factory function for Converter.

func (*Converter) AddResourceChanges

func (c *Converter) AddResourceChanges(changes []*tfjson.ResourceChange) error

AddResourceChange processes the resource changes in two stages: 1. Process deletions (fetching canonical resources from GCP as necessary) 2. Process creates, updates, and no-ops (fetching canonical resources from GCP as necessary) This will give us a deterministic end result even in cases where for example an IAM Binding and Member conflict with each other, but one is replacing the other.

func (*Converter) Assets

func (c *Converter) Assets() []caiasset.Asset

Assets lists all converted assets previously added by calls to AddResource.

Directories

Path Synopsis
----------------------------------------------------------------------------
----------------------------------------------------------------------------

Jump to

Keyboard shortcuts

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