auto

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package auto automatically parses berglas references when imported.

import (
  _ "github.com/GoogleCloudPlatform/berglas/v2/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.

To see log output, set `BERGLAS_LOG_LEVEL` to "trace" or "debug".

Jump to

Keyboard shortcuts

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