auto

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: Apache-2.0 Imports: 9 Imported by: 8

Documentation

Overview

Package auto automatically parses berglas references when imported.

import (
  _ "github.com/GoogleCloudPlatform/berglas/pkg/auto"
)

Set environment variables on your deployment using the berglas:// prefix in the format:

berglas://<bucket>/<secret>?<params>

- "bucket" is the name of the Google Cloud Storage bucket where secrets are stored - "secret" is the path to the full path to a secret inside the bucket - "params" are URL query parameters that configure behavior

Examples:

berglas://my-bucket/my-secret
berglas://my-bucket/path/to/secret?destination=tempfile
berglas://my-bucket/path/to/secret?destination=/var/foo/bar

On init, the package queries the list of configured environment variables against the metadata service. If environment variables match, their values are automatically replaced with the secret value.

By default, any errors result in a panic. If you want the function to continue executing even if resolution or communication fails, set the environment variable `BERGLAS_CONTINUE_ON_ERROR` to `true` or do not use the auto package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(ctx context.Context, runtimeEnv berglas.RuntimeEnvironment) (map[string]string, error)

Resolve resolves the environment variables. Importing the package calls Resolve. It's a separate method primarily for testing. Implementers should not call this method.

Types

This section is empty.

Jump to

Keyboard shortcuts

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