By using AWS re:Post, you agree to the Terms of Use
/create Secret with namy generated password/keys with CDK/

create Secret with namy generated password/keys with CDK


Hi team,

I want to create a secret via CDK that contains 2 passwords (API keys)

secretName = ApiKeys

keys/values =

  • key: password1, value: auto-generated password (current)

  • key: password2, value: auto-generated password (previous)

the CDK syntax I found allows only to create a secret with one secret inside it, is there a way to create a secret in a secret manager with many generated secrets inside it? any snippet code would be helpful.

Thank you.

1 Answers

Here is a example of secrets creation using SAM. You can potentially update line 113 for SecretString in this file to create multiple KVs.

Hope that helps.

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions