googlecloud

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 10 Imported by: 0

README

GoogleCloud Secrets Secret-Store Plugin

This plugin allows to retrieve token-based Google Cloud Credentials.

Usage

Secrets defined by a store are referenced with @{<store-id>:<secret_key>} the Telegraf configuration. Only certain Telegraf plugins and options of support secret stores. To see which plugins and options support secrets, see their respective documentation (e.g. plugins/outputs/influxdb/README.md). If the plugin's README has the Secret-store support section, it will detail which options support secret store usage.

Configuration

## Fetch tokens from Google Cloud Authentication
[[secretstores.googlecloud]]
  ## Unique identifier for the secret-store.
  ## This id can later be used in plugins to reference the secrets
  ## in this secret-store via @{<id>:token}(mandatory)
  id = "googlecloud_secret"

  ## Path to the service account credentials file
  credentials_file = "./testdata/gdch.json"

  ## Audience sent to when retrieving an STS token.
  ## Currently only used for GDCH auth flow
  sts_audience = "https://{AUDIENCE_URL}"

[!IMPORTANT] This plugin only provides one secret with the key token, other keys lead to errors.

Additional Information

To generate a Google-Distributed-Cloud-Hosted service account credentials file check the Manage service accounts.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleCloud

type GoogleCloud struct {
	STSAudience     string          `toml:"sts_audience"`
	CredentialsFile string          `toml:"credentials_file"`
	Log             telegraf.Logger `toml:"-"`
	common_http.HTTPClientConfig
	// contains filtered or unexported fields
}

func (*GoogleCloud) Get

func (g *GoogleCloud) Get(key string) ([]byte, error)

Get retrieves the token. The key is ignored as this secret store only provides one secret.

func (*GoogleCloud) GetResolver

func (g *GoogleCloud) GetResolver(key string) (telegraf.ResolveFunc, error)

GetResolver returns a resolver function for the secret.

func (*GoogleCloud) Init

func (g *GoogleCloud) Init() error

func (*GoogleCloud) List

func (*GoogleCloud) List() ([]string, error)

List returns the list of secrets provided by this store.

func (*GoogleCloud) SampleConfig

func (*GoogleCloud) SampleConfig() string

func (*GoogleCloud) Set

func (*GoogleCloud) Set(_, _ string) error

Set is not supported for the gcloud secret store.

Jump to

Keyboard shortcuts

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