Documentation
¶
Overview ¶
Package awsparamstore provides a runtimevar implementation with variables read from AWS Systems Manager Parameter Store (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html) Use OpenVariable to construct a *runtimevar.Variable.
URLs ¶
For runtimevar.OpenVariable, awsparamstore registers for the scheme "awsparamstore". The default URL opener will use an AWS session with the default credentials and configuration; see https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ for more details. To customize the URL opener, or for more details on the URL format, see URLOpener. See https://gocloud.dev/concepts/urls/ for background information.
As ¶
awsparamstore exposes the following types for As:
- Snapshot: (V1) *ssm.GetParameterOutput, (V2) *ssmv2.GetParameterOutput
- Error: (V1) awserr.Error, (V2) any error type returned by the service, notably smithy.APIError
Index ¶
Examples ¶
Constants ¶
const Scheme = "awsparamstore"
Scheme is the URL scheme awsparamstore registers its URLOpener under on runtimevar.DefaultMux.
Variables ¶
Set holds Wire providers for this package.
Functions ¶
func OpenVariable ¶ added in v0.13.0
func OpenVariable(sess client.ConfigProvider, name string, decoder *runtimevar.Decoder, opts *Options) (*runtimevar.Variable, error)
OpenVariable constructs a *runtimevar.Variable backed by the variable name in AWS Systems Manager Parameter Store. Parameter Store returns raw bytes; provide a decoder to decode the raw bytes into the appropriate type for runtimevar.Snapshot.Value. See the runtimevar package documentation for examples of decoders.
func OpenVariableV2 ¶ added in v0.24.0
func OpenVariableV2(client *ssmv2.Client, name string, decoder *runtimevar.Decoder, opts *Options) (*runtimevar.Variable, error)
OpenVariableV2 constructs a *runtimevar.Variable backed by the variable name in AWS Systems Manager Parameter Store, using AWS SDK V2. Parameter Store returns raw bytes; provide a decoder to decode the raw bytes into the appropriate type for runtimevar.Snapshot.Value. See the runtimevar package documentation for examples of decoders.
Types ¶
type Options ¶
type Options struct { // WaitDuration controls the rate at which Parameter Store is polled. // Defaults to 30 seconds. WaitDuration time.Duration }
Options sets options.
type URLOpener ¶
type URLOpener struct { // UseV2 indicates whether the AWS SDK V2 should be used. UseV2 bool // ConfigProvider must be set to a non-nil value if UseV2 is false. ConfigProvider client.ConfigProvider // Decoder specifies the decoder to use if one is not specified in the URL. // Defaults to runtimevar.BytesDecoder. Decoder *runtimevar.Decoder // Options specifies the options to pass to New. Options Options }
URLOpener opens AWS Paramstore URLs like "awsparamstore://myvar".
Use "awssdk=v1" to force using AWS SDK v1, "awssdk=v2" to force using AWS SDK v2, or anything else to accept the default.
For V1, see gocloud.dev/aws/ConfigFromURLParams for supported query parameters for overriding the aws.Session from the URL. For V2, see gocloud.dev/aws/V2ConfigFromURLParams.
In addition, the following URL parameters are supported:
- decoder: The decoder to use. Defaults to URLOpener.Decoder, or runtimevar.BytesDecoder if URLOpener.Decoder is nil. See runtimevar.DecoderByName for supported values.
- wait: The poll interval, in time.ParseDuration formats. Defaults to 30s.
func (*URLOpener) OpenVariableURL ¶
OpenVariableURL opens the variable at the URL's path. See the package doc for more details.