dumpinventory

package
v0.0.18-rc7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 9 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.

Required environment variables

- CAIEXPORTBUCKETNAME the name of the GCS bucket where CAI dumps should be delivered.

- SETTINGSFILENAME name of the JSON setting file.

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 ram.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 ram.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)

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

Types

type Global

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

Global structure for global variables to optimize the cloud function performances

Jump to

Keyboard shortcuts

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