Skip to contents

This function does not create your database username and/or password. Instead, it creates a "secret", which is typically a combination of credentials (username + password + other metadata)

Usage

aws_secrets_create(name, secret, description = NULL, ...)

Arguments

name

(character) The name of the new secret. required

secret

(character/raw) The text or raw data to encrypt and store in this new version of the secret. AWS recommends for text to use a JSON structure of key/value pairs for your secret value (see examples below). required

description

(character) The description of the secret. optional

...

further named parameters passed on to create_secret https://www.paws-r-sdk.com/docs/secretsmanager_create_secret/

Value

(list) with fields:

  • ARN

  • Name

  • VersionId

  • ReplicationStatus

Details

Note that we autogenerate a random UUID to pass to the ClientRequestToken parameter of the paws function create_secret used internally in this function.

This function creates a new secret. See aws_secrets_update() to update an existing secret. This function fails if you call it with an existing secret with the same name or ARN

Examples

if (FALSE) {
# Text secret
x <- aws_secrets_create(
  name = "MyTestDatabaseSecret",
  secret = '{"username":"david","password":"EXAMPLE-PASSWORD"}',
  description = "My test database secret as a string"
)

# Raw secret
x <- aws_secrets_create(
  name = "MyRawDatabaseSecret",
  secret = charToRaw('{"username":"david","password":"EXAMPLE-PASSWORD"}'),
  description = "My test database secret as raw"
)
}