dumpinventory

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package dumpinventory request CAI to perform an export

Triggered by

Cloud Scheduler Job, through PubSub messages.

Instances

- one for all IAM bindings policies.

- one per AssetType for resource metadata exports.

Output

None, CAI execute exports as an asynchonous task delivered in a Google Cloud Storage bucket.

Automatic retrying

Yes.

Implementation example

package p
import (
    "context"

    "github.com/BrunoReboul/ram/services/dumpinventory"
    "github.com/BrunoReboul/ram/utilities/ram"
)
var global dumpinventory.Global
var ctx = context.Background()

// EntryPoint is the function to be executed for each cloud function occurence
func EntryPoint(ctxEvent context.Context, PubSubMessage gps.PubSubMessage) error {
    return dumpinventory.EntryPoint(ctxEvent, PubSubMessage, &global)
}

func init() {
    dumpinventory.Initialize(ctx, &global)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntryPoint

func EntryPoint(ctxEvent context.Context, PubSubMessage gps.PubSubMessage, global *Global) error

EntryPoint is the function to be executed for each cloud function occurence

func Initialize

func Initialize(ctx context.Context, global *Global) (err error)

Initialize is to be executed in the init() function of the cloud function to optimize the cold start

Types

type Global

type Global struct {
	PubSubID string
	// contains filtered or unexported fields
}

Global structure for global variables to optimize the cloud function performances

type InstanceDeployment added in v0.0.24

type InstanceDeployment struct {
	DumpTimestamp time.Time `yaml:"dumpTimestamp"`
	Artifacts     struct {
		JobName   string `yaml:"jobName"`
		TopicName string `yaml:"topicName"`
		Schedule  string
	}
	Core     *deploy.Core
	Settings struct {
		Service struct {
			GSU gsu.Parameters
			IAM iamgt.Parameters
			GCB gcb.Parameters
			GCF gcf.Parameters
		}
		Instance struct {
			CAI cai.Parameters
			SCH sch.Parameters
		}
	}
}

InstanceDeployment settings and artifacts structure

func NewInstanceDeployment added in v0.0.24

func NewInstanceDeployment() *InstanceDeployment

NewInstanceDeployment create deployment structure with default settings set

func (*InstanceDeployment) Deploy added in v0.0.24

func (instanceDeployment *InstanceDeployment) Deploy() (err error)

Deploy a service instance

func (*InstanceDeployment) ReadValidate added in v0.0.24

func (instanceDeployment *InstanceDeployment) ReadValidate() (err error)

ReadValidate reads and validates service and instance settings

func (*InstanceDeployment) Situate added in v0.0.24

func (instanceDeployment *InstanceDeployment) Situate() (err error)

Situate complement settings taking in account the situation for service and instance settings

Jump to

Keyboard shortcuts

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