the.vaibhav.rajput
the.vaibhav.rajput

Reputation: 47

Create AWS SecretsManager using AWS CLI for Other type (plaintext)

I am trying to store a new Secret in AWS Secrets Manager using AWS CLI.

On console i get an option to create a Other type of secrets under Select secret type where i choose a plaintext type under Specify the key/value pairs to be stored in this secret.

I want to do that using CLI. Below is the format to use the CLI Command

aws secretsmanager create-secret
--name <value>
[--client-request-token <value>]
[--description <value>]
[--kms-key-id <value>]
[--secret-binary <value>]
[--secret-string <value>]
[--tags <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Upvotes: 1

Views: 3767

Answers (1)

sidhartha madipalli
sidhartha madipalli

Reputation: 623

You can use the --secret-string option for this.

For Key-Value pairs you can do JSON formatted string and it will show up as Key-Value pairs in console:

aws secretsmanager create-secret --name my-secret-kv-pairs --secret-string '{"foo":"bar"}'

If you just want plain text you can do :

aws secretsmanager create-secret --name my-secret-just-text --secret-string 'My random string'

Upvotes: 5

Related Questions