GetSecretValue
Source:
src/AWS/SecretsManager/GetSecretValue.ts
Runtime binding for secretsmanager:GetSecretValue.
Bind this operation to a Secret in the function’s init phase to get a
callable that reads the current (or a specific) secret version — the secret
ARN is injected automatically and secretsmanager:GetSecretValue is
granted on the secret. Provide the implementation with
Effect.provide(AWS.SecretsManager.GetSecretValueHttp).
Secret values are sensitive: SecretString / SecretBinary may be handed
back wrapped in Redacted — unwrap with Redacted.value before use.
Reading Secret Values
Section titled “Reading Secret Values”// init — bind the operation to the secretconst secret = yield* AWS.SecretsManager.Secret("DbPassword", { secretString: Redacted.make("initial-password"),});const getSecretValue = yield* AWS.SecretsManager.GetSecretValue(secret);
// runtime — reads the AWSCURRENT versionconst result = yield* getSecretValue();const value = typeof result.SecretString === "string" ? result.SecretString : Redacted.value(result.SecretString!);