import boto3
client = boto3.client('secretsmanager')
new_secret = 'new_value'
response = client.update_secret(SecretId='my_secret_name', SecretString=new_secret)
import json
secret = '{"username": "my_username", "password": "my_password"}'
json_secret = json.loads(secret)
print(json_secret)
输出结果为:
{'username': 'my_username', 'password': 'my_password'}