AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Write-SECSecretValue-SecretString <String>-ClientRequestToken <String>-SecretBinary <Byte[]>-SecretId <String>-VersionStage <String[]>-Select <String>-PassThru <SwitchParameter>-Force <SwitchParameter>-ClientConfig <AmazonSecretsManagerConfig>
SecretString
value or a new SecretBinary
value.
We recommend you avoid calling 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 removes outdated versions when there are more than 100, but it does not remove versions created less than 24 hours ago. If you call PutSecretValue
more than once every 10 minutes, you create more versions than Secrets Manager removes, and you will reach the quota for secret versions.
You can specify the staging labels to attach to the new version in VersionStages
. If you don't include VersionStages
, then Secrets Manager automatically moves the staging label AWSCURRENT
to this version. If this operation creates the first version for the secret, then Secrets Manager automatically attaches the staging label AWSCURRENT
to it. If this operation moves the staging label AWSCURRENT
from another version to this version, then Secrets Manager also automatically moves the staging label AWSPREVIOUS
to the version that AWSCURRENT
was removed from.
This operation is idempotent. If you call this operation with a ClientRequestToken
that matches an existing version's VersionId, and you specify the same secret data, the operation succeeds but does nothing. However, if the secret data is different, then the operation fails because you can't modify an existing version; you can only create new ones.
Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters except SecretBinary
or SecretString
because it might be logged. For more information, see Logging Secrets Manager events with CloudTrail. Required permissions: secretsmanager:PutSecretValue
. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
ClientRequestToken
yourself for new versions and include that value in the request. This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental creation of duplicate versions if there are failures and retries during the Lambda rotation function processing. We recommend that you generate a UUID-type value to ensure uniqueness within the specified secret. ClientRequestToken
value isn't already associated with a version of the secret then a new version of the secret is created. SecretString
or SecretBinary
values are the same as those in the request then the request is ignored. The operation is idempotent. SecretString
and SecretBinary
values are different from those in the request, then the request fails because you can't modify a secret version. You can only create new versions to store new secret values.VersionId
of the new version. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
SecretBinary
or SecretString
, but not both.You can't access this value from the Secrets Manager console.The cmdlet will automatically convert the supplied parameter of type string, string[], System.IO.FileInfo or System.IO.Stream to byte[] before supplying it to the service. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
CreateSecret
instead. Required? | True |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
SecretBinary
or SecretString
, but not both.We recommend you create the secret string as JSON key/value pairs, as shown in the example. Required? | False |
Position? | 1 |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
AWSCURRENT
, and it is already attached to another version, then Secrets Manager also moves the staging label AWSPREVIOUS
to the version that AWSCURRENT
was removed from.If you don't include VersionStages
, then Secrets Manager automatically moves the staging label AWSCURRENT
to this version. Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | VersionStages |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AK |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | AWSProfilesLocation, ProfilesLocation |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | StoredCredentials, AWSProfileName |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | RegionToCall |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | SK, SecretAccessKey |
Required? | False |
Position? | Named |
Accept pipeline input? | True (ByPropertyName) |
Aliases | ST |
AWS Tools for PowerShell: 2.x.y.z