Documentation
¶
Overview ¶
Package aws reads configuration from the stores AWS holds it in.
It is selected by importing it, which is how an application picks a platform without naming one anywhere else:
import _ "github.com/newstack-cloud/celerity-go-sdk/config/aws"
An init registers it for the AWS platform, and the generated platform file links it for an AWS deploy target, so an application does nothing to have its configuration read.
Which store a value comes from ¶
A blueprint's celerity/config resource lists the keys that hold no sensitive value, and the deploy engine uses that to decide how the store is created: a store of mostly plain text becomes parameters under a path, and one whose values are sensitive becomes a single secret. It says which in the environment, and this package reads whichever it names.
A secret is read through the parameters and secrets Lambda extension where the function has it attached, since that is a local cache and avoids a request per cold start. Parameters are always read through the SDK: the extension has no equivalent of the call that reads a tree of parameters by path prefix.
Everything about the extension is here rather than in core, which holds no provider's environment variables.
Index ¶
Constants ¶
const ( // StoreSecretsManager holds a whole store as one secret, read and decoded // in a single request. The default, since a store commonly holds values // that are all sensitive. StoreSecretsManager config.StoreKind = "secrets-manager" // StoreParameterStore holds each value separately under a path, which is // what a store of mostly plain text wants. StoreParameterStore config.StoreKind = "parameter-store" )
The kinds of store AWS holds configuration in, which a deployment names in CELERITY_CONFIG_STORE_KIND. These are AWS's own services, which is why they are named here and not in core.
const ExtensionPortEnvVar = "PARAMETERS_SECRETS_EXTENSION_HTTP_PORT"
ExtensionPortEnvVar is set by AWS when the parameters and secrets extension layer is attached to a function, and is how this package knows the local cache is there to use.
const Name = "aws"
Name identifies this provider in errors.
const SessionTokenEnvVar = "AWS_SESSION_TOKEN"
SessionTokenEnvVar is the function's own credentials token, which the extension requires on every request so that only the function it belongs to can read its secrets.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider reads configuration from AWS.
An application does not construct one, importing this package registers it, and it is selected when the platform is AWS.