我正在嘗試使用 aws cli 命令創建一個秘密管理器。我試過的命令是
aws secretsmanager create-secret \
--name sample_auth_aws_secret1 \
--description "My test secret created with the CLI." \
-- tags {"env":"dev","sample=test"} \
--secret-string "{\"clientId\":\"sample123\",\"secret\":\"wjwjwjwjwjwjwjsjsjsj\"}"
我收到錯誤
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
Unknown options: env:dev, sample=test, --secret-string, {"clientId":"sample123","secret":"wjwjwjwjwjwjwjsjsjsj"}, tags
我做錯了什么?
uj5u.com熱心網友回復:
你的命令有兩個問題。
- 使用 --tags 代替 --tags
- 鍵值的 json 格式不正確。
請使用以下命令
aws secretsmanager create-secret \
--name sample_auth_aws_secret1 \
--description "My test secret created with the CLI." \
--tags '{"Key":"CostCenter","Value":"12345"}' \
--secret-string "{\"clientId\":\"sample123\",\"secret\":\"wjwjwjwjwjwjwjsjsjsj\"}"
uj5u.com熱心網友回復:
--在和之間有一個空格tags:
-- tags {"env":"dev","sample=test"} \
它應該是:
--tags {"env":"dev","sample=test"} \
此外,設定標簽的語法完全錯誤。您:在第一個標簽和=第二個標簽中使用,但無論如何您的整體語法都是錯誤的。我建議查看檔案并復制他們的示例。
它應該是:
--tags [{"Key":"env","Value":"dev"},{"Key":"sample","Value":"test"}] \
uj5u.com熱心網友回復:
它與tags你正在傳遞的那個有關。您需要正確的鍵和值分配。
嘗試傳遞作業速記:
--tags Key="env",Value="dev" Key="sample",Value="test" \
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/435118.html
