尝试更新 AWS 机密不会在 AWS 中保存

Attempting to update AWS secret isn't saving in AWS

我在 Mac 蒙特雷。使用 AWS CLI,我想更新密钥的值,所以我这样做了

aws secretsmanager update-secret --secret-id 'development/database' --description '{"adapter": "mysql2", "encoding": "utf8", "host": "host.docker.internal"}'

我回来了

{
    "ARN": "arn:aws:secretsmanager:us-east-1:1234678901234:secret:development/database-4walfE",
    "Name": "development/database"
}

但是,当我去查看我的secret的值时,它并没有改变

$ aws secretsmanager get-secret-value     --secret-id 'development/database'
{
    "ARN": "arn:aws:secretsmanager:us-east-1:1234678901234:secret:development/database-4abcdE",
    "Name": "development/database",
    "VersionId": "378861d2-c5f0-48a4-a965-13877321da62",
    "SecretString": "{\"adapter\": \"mysql2\", \"encoding\": \"utf8\", \"host\": \"127.0.0.1\"}",
    "VersionStages": [
        "AWSCURRENT"
    ],
    "CreatedDate": "2022-04-11T12:00:43.029000-05:00"
}

什么给了?我错过了什么?

如果您要更新密钥的值,您应该使用 --secret-string

aws secretsmanager update-secret --secret-id 'development/database' --secret-string '{"adapter": "mysql2", "encoding": "utf8", "host": "host.docker.internal"}'