I want to create a new secret in Secrets Manager. The secret needs to be a key/value pair. When I create the secret using the CLI it is stored as plaintext instead of as a key/value pair:
aws secretsmanager create-secret --name github/oauthtoken \
--description "GitHub OAuth Token" \
--secret-string file:///tmp/github_oauth.json
github_oauth.json
[
{
"Key": "oauth_token",
"Value": "MYOAUTHTOKEN"
}
]
When I attempt to resolve the secret in CloudFormation I'm getting an error:
Secrets Manager can?t find the specified secret.
When I access the secret in the Secrets Manager UI the secret is in plaintext with an error under Secret key/value:
The secret value can't be converted to key name and value pairs
How can I create a secret in Secrets Manager stored as a key/value pair?