Search code examples
pythonamazon-web-servicesboto3aws-secrets-manager

How to update AWS Secrets Manager via python?


I can't find any documentation on how to upload/update values to the AWS secrets manager. I can only retrieve the values via python. Is there a workaround on this?


Solution

  • You can use update_secret():

    response = client.update_secret(
        SecretId='string',
        ClientRequestToken='string',
        Description='string',
        KmsKeyId='string',
        SecretBinary=b'bytes',
        SecretString='string'
    )
    

    For creating new secrets, use: put_secret_value()