I am trying to create one secrets manager using aws cli command .The command I tried is
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\"}"
I am getting error usage: aws [options] [ …] [parameters]
To see help text, you can run:
aws help
aws help
aws help
Unknown options: env:dev, sample=test, –secret-string, {"clientId":"sample123","secret":"wjwjwjwjwjwjwjsjsjsj"}, tags
could you please help me on this .Thanks in advanced !
>Solution :
There are two problems in your command.
- use –tags instead — tags
- key value are not in correct json format.
please use below command
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\"}"