AWS:使用变量将标签分配给秘密

AWS: Assign tag to secret using variable

我想将变量的值分配给机密。我试过了。 aws secretsmanager tag-resource --secret-id blah-blah --tags '[{"Key": "abc", "Value": "{$a}"}]'

我收到此错误: An error occurred (InvalidRequestException) when calling the TagResource operation: Request rejected by the downstream tagging service. Please check that you're only using allowed characters.

有什么帮助吗???

您使用了错误的字符和引号。应该是:

aws secretsmanager tag-resource --secret-id blah-blah --tags '[{"Key": "abc", "Value": "'${a}'"}]'