SecretsManagerClient.put_secret_value
rboto-secrets-manager==0.4.0 · Service index · Types
Model summary (excerpt): Creates a new version of your secret by creating a new encrypted value and attaching it to the secret. version can contain a new SecretString value or a new SecretBinary value. Do not call PutSecretValue at a sustained rate of more than once every 10 minutes. When you update the secret value, Secrets Manager creates a new version of the secret. Secrets Manager keeps 100 of the most recent...
Install and imports
from rboto import SecretsManagerClient
from collections.abc import Sequence
from rboto_secrets_manager.types import (
PutSecretValueOutput,
)
Signature
async def put_secret_value(
*,
secret_id: str,
client_request_token: str | None = None,
secret_binary: bytes | None = None,
secret_string: str | None = None,
version_stages: Sequence[str] | None = None,
rotation_token: str | None = None,
) -> PutSecretValueOutput: ...
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 to add a new version to. For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See Finding a secret from a partial ARN . If the secret doesn't already exist, use CreateSecret instead. |
client_request_token |
No | A unique identifier for the new version of the secret. 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 for this parameter in the request. If you generate a raw HTTP request to the Secrets Manager service endpoint, then you... |
secret_binary |
No | The binary data to encrypt and store in the new version of the secret. To use this parameter in the command-line tools, we recommend that you store your binary data in a file and then pass the contents of the file as a parameter. You must include SecretBinary or SecretString , but not both. You can't access this value from the Secrets Manager console. Sensitive: This field contains sensitive... |
secret_string |
No | The text to encrypt and store in the new version of the secret. You must include SecretBinary or SecretString , but not both. We recommend you create the secret string as JSON key/value pairs, as shown in the example. 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... |
version_stages |
No | A list of staging labels to attach to this version of the secret. Secrets Manager uses staging labels to track versions of a secret through the rotation process. If you specify a staging label that's already associated with a different version of the same secret, then Secrets Manager removes the label from the other version and attaches it to this version. If you specify AWSCURRENT , and it is... |
rotation_token |
No | A unique identifier that indicates the source of the request. Required for secret rotations using an IAM assumed role or cross-account rotation, in which you rotate a secret in one account by using a Lambda rotation function in another account. In both cases, the rotation function assumes an IAM role to call Secrets Manager, and then Secrets Manager validates the identity using the token. For... |
Output
PutSecretValueOutput.
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 | — |
version_stages |
list[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.
Related types
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, ResourceExistsError, ResourceNotFoundError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.