GetRandomPassword
Source:
src/AWS/SecretsManager/GetRandomPassword.ts
Runtime binding for secretsmanager:GetRandomPassword.
Account-level operation (no target secret): bind it with no arguments to
get a callable that generates cryptographically strong random passwords —
typically paired with PutSecretValue for rotation. Provide the
implementation with
Effect.provide(AWS.SecretsManager.GetRandomPasswordHttp).
Generating Passwords
Section titled “Generating Passwords”// init — account-level, no resource argumentconst getRandomPassword = yield* AWS.SecretsManager.GetRandomPassword();const putSecretValue = yield* AWS.SecretsManager.PutSecretValue(secret);
// runtime — generate, then rotate the secret to itconst generated = yield* getRandomPassword({ PasswordLength: 32, ExcludePunctuation: true,});yield* putSecretValue({ SecretString: generated.RandomPassword });