Jump to Content

Amazon Web Services Secrets Manager

Amazon Web Services Secrets Manager provides a service to enable you to store, manage, and retrieve, secrets.

This guide provides descriptions of the Secrets Manager API. For more information about using this service, see the Amazon Web Services Secrets Manager User Guide.

API Version

This version of the Secrets Manager API Reference documents the Secrets Manager API version 2017-10-17.

For a list of endpoints, see Amazon Web Services Secrets Manager endpoints.

Support and Feedback for Amazon Web Services Secrets Manager

We welcome your feedback. Send your comments to awssecretsmanager-feedback@amazon.com, or post your feedback and questions in the Amazon Web Services Secrets Manager Discussion Forum. For more information about the Amazon Web Services Discussion Forums, see Forums Help.

Logging API Requests

Amazon Web Services Secrets Manager supports Amazon Web Services CloudTrail, a service that records Amazon Web Services API calls for your Amazon Web Services account and delivers log files to an Amazon S3 bucket. By using information that's collected by Amazon Web Services CloudTrail, you can determine the requests successfully made to Secrets Manager, who made the request, when it was made, and so on. For more about Amazon Web Services Secrets Manager and support for Amazon Web Services CloudTrail, see Logging Amazon Web Services Secrets Manager Events with Amazon Web Services CloudTrail in the Amazon Web Services Secrets Manager User Guide. To learn more about CloudTrail, including enabling it and find your log files, see the Amazon Web Services CloudTrail User Guide.

Hierarchy

Constructors

Properties

The resolved configuration of SecretsManagerClient class. This is resolved and normalized from the constructor configuration interface.

middlewareStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>

Methods

  • Creates a new secret. A secret can be a password, a set of credentials such as a user name and password, an OAuth token, or other secret information that you store in an encrypted form in Secrets Manager. The secret also includes the connection information to access a database or other service, which Secrets Manager doesn't encrypt. A secret in Secrets Manager consists of both the protected secret data and the important information needed to manage the secret.

    For secrets that use managed rotation, you need to create the secret through the managing service. For more information, see Secrets Manager secrets managed by other Amazon Web Services services.

    </p>
    <p>For information about creating a secret in the console, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_create-basic-secret.html">Create a secret</a>.</p>
    <p>To create a secret, you can provide the secret value to be encrypted in either the
    <code>SecretString</code> parameter or the <code>SecretBinary</code> parameter, but not both.
    If you include <code>SecretString</code> or <code>SecretBinary</code>
    then Secrets Manager creates an initial secret version and automatically attaches the staging
    label <code>AWSCURRENT</code> to it.</p>
    <p>For database credentials you want to rotate, for Secrets Manager to be able to rotate the secret,
    you must make sure the JSON you store in the <code>SecretString</code> matches the <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_secret_json_structure.html">JSON structure of
    a database secret</a>.</p>
    <p>If you don't specify an KMS encryption key, Secrets Manager uses the Amazon Web Services managed key
    <code>aws/secretsmanager</code>. If this key
    doesn't already exist in your account, then Secrets Manager creates it for you automatically. All
    users and roles in the Amazon Web Services account automatically have access to use <code>aws/secretsmanager</code>.
    Creating <code>aws/secretsmanager</code> can result in a one-time significant delay in returning the
    result.</p>
    <p>If the secret is in a different Amazon Web Services account from the credentials calling the API, then
    you can't use <code>aws/secretsmanager</code> to encrypt the secret, and you must create
    and use a customer managed KMS key. </p>
    <p>Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters except <code>SecretBinary</code> or <code>SecretString</code> because it might be logged. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html">Logging Secrets Manager events with CloudTrail</a>.</p>
    <p>
    <b>Required permissions: </b>
    <code>secretsmanager:CreateSecret</code>. If you
    include tags in the secret, you also need <code>secretsmanager:TagResource</code>.
    For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions">
    IAM policy actions for Secrets Manager</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html">Authentication
    and access control in Secrets Manager</a>. </p>
    <p>To encrypt the secret with a KMS key other than <code>aws/secretsmanager</code>, you need <code>kms:GenerateDataKey</code> and <code>kms:Decrypt</code> permission to the key. </p>

    Parameters

    Returns Promise<CreateSecretCommandOutput>

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Type Parameters

    Parameters

    Returns Promise<OutputType>

  • Type Parameters

    Parameters

    • command: Command<ServiceInputTypes, InputType, ServiceOutputTypes, OutputType, SmithyResolvedConfiguration<HttpHandlerOptions>>
    • cb: ((err: any, data?: OutputType) => void)
        • (err: any, data?: OutputType): void
        • Parameters

          • err: any
          • Optional data: OutputType

          Returns void

    Returns void

  • Type Parameters

    Parameters

    • command: Command<ServiceInputTypes, InputType, ServiceOutputTypes, OutputType, SmithyResolvedConfiguration<HttpHandlerOptions>>
    • options: HttpHandlerOptions
    • cb: ((err: any, data?: OutputType) => void)
        • (err: any, data?: OutputType): void
        • Parameters

          • err: any
          • Optional data: OutputType

          Returns void

    Returns void