I want to use the AWS secrets manager to manage all my secrets for my CDK stacks. Since I would be managing hundreds of secrets, I want to create a CDK stack that would allow me to create these secrets in different environments (and manage them).
Some of the secret values need to be a specific set of values that cannot be autogenerated.
From what I understand, I cannot create such secrets that have predetermined values using CDK. So my question is: How do I create these secrets programmatically and not manually? The burden of creating the same set of secrets in different environments manually without messing up is too great.
Edit: To be clear, I understand the reason behind CDK not allowing to specify SecretString
of AWS::SecretsManager::Secret
since it could risk exposing secrets. I definitely thought about creating secrets with randomly generated values and then replacing those values manually, but for someone like me who has multiple environments and hundreds of secrets to manage, even that could be quite taxing. There has to be a better way of doing this.