Secret Manager generateSecretString and generateStringKey must be specified together
See original GitHub issueSecret manager Secret creation in the cdk require to mention both generateSecretString and generateStringKey together. This is not required in cloudformation.
I can help implementing if needed I just posted it not to forget.
Reproduction Steps
import * as cdkSecret from '@aws-cdk/aws-secretsmanager';
new cdkSecret.Secret(
this, 'Secret' + instance, {
generateSecretString: {
secretStringTemplate: JSON.stringify({
username: "hello-secret",
}),
// generateStringKey should't be required
generateStringKey: 'tmp'
}
});
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
AWS::SecretsManager::Secret GenerateSecretString
Generates a random password. We recommend that you specify the maximum length and include every character type that the system you are generating...
Read more >Using AWS Secrets manager's Secret in Cloudformation
Yes, you need to use Roles for EC2 to setup permissions for the instance to access the secret. You can find more details...
Read more >awssecretsmanager - Go Packages
The `AWS::SecretsManager::SecretTargetAttachment` resource completes the final link between a Secrets Manager secret and the associated database by adding the ...
Read more >AWS::SecretsManager::Secret - Amazon CloudFormation
A structure that specifies how to generate a password to encrypt and store in the secret. To include a specific string in the...
Read more >AWS Secrets Manager: Create and Rotate secrets automatically
Description: 'Secret with dynamically generated password.' GenerateSecretString: RequireEachIncludedType: True SecretStringTemplate: '{"username": "MyDBAdmin"}'
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You could for example aggregate multiple secrets from other secrets into one big. I see what you sent in the documentation @jogold however this template is valid and deploy in cloudformation :
There’s an inconsistency between cdk and cloudformation.
Seams that now it is consistent