Skip to content

SecretsManagerClient.update_secret

rboto-secrets-manager==0.4.0 · Service index · Types

Model summary (excerpt): Modifies the details of a secret, including metadata and the secret value. To change the secret value, you can also use PutSecretValue . To change the rotation configuration of a secret, use RotateSecret instead. To change a secret so that it is managed by another service, you need to recreate the secret in that service. See Secrets Manager secrets managed by other Amazon Web Services services...

Install and imports

python -m pip install "rboto[secrets-manager]==0.4.0"
from rboto import SecretsManagerClient
from rboto_secrets_manager.types import (
    UpdateSecretOutput,
)

Signature

async def update_secret(
    *,
    secret_id: str,
    client_request_token: str | None = None,
    description: str | None = None,
    kms_key_id: str | None = None,
    secret_binary: bytes | None = None,
    secret_string: str | None = None,
    type: str | None = None,
) -> UpdateSecretOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
secret_id Yes The ARN or name of the secret. For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See Finding a secret from a partial ARN .
client_request_token No If you include SecretString or SecretBinary , then Secrets Manager creates a new version for the secret, and this parameter specifies the unique identifier for the new version. If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value...
description No The description of the secret.
kms_key_id No The ARN, key ID, or alias of the KMS key that Secrets Manager uses to encrypt new secret versions as well as any existing versions with the staging labels AWSCURRENT , AWSPENDING , or AWSPREVIOUS . If you don't have kms:Encrypt permission to the new key, Secrets Manager does not re-encrypt existing secret versions with the new key. For more information about versions and staging labels, see...
secret_binary No The binary data to encrypt and store in the new version of the secret. We recommend that you store your binary data in a file and then pass the contents of the file as a parameter. Either SecretBinary or SecretString must have a value, but not both. You can't access this parameter in the Secrets Manager console. Sensitive: This field contains sensitive information, so the service does not...
secret_string No The text data to encrypt and store in the new version of the secret. We recommend you use a JSON structure of key/value pairs for your secret value. Either SecretBinary or SecretString must have a value, but not both. Sensitive: This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you create your own log entries, you must also avoid...
type No The exact string that identifies the third-party partner that holds the external secret. For more information, see Managed external secret partners .

Output

UpdateSecretOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
arn str | None Always present —
name str | None Always present —
version_id str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

UpdateSecretOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_secrets_manager.exceptions:

DecryptionFailureError, EncryptionFailureError, InternalServiceError, InvalidParameterError, InvalidRequestError, LimitExceededError, MalformedPolicyDocumentError, PreconditionNotMetError, ResourceExistsError, ResourceNotFoundError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model