Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Getting error while running create secrets manager command using aws cli

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

  1. use –tags instead — tags
  2. 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\"}"
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading