Skip to content

Instantly share code, notes, and snippets.

@youngsoul
Created March 11, 2022 19:39
Show Gist options
  • Save youngsoul/7f7897820dcbebdeff10df9cd9165a06 to your computer and use it in GitHub Desktop.
Save youngsoul/7f7897820dcbebdeff10df9cd9165a06 to your computer and use it in GitHub Desktop.
CDK example of creating a database password secret
secrets_template = json.dumps({
"username": f'{db_username}'
})
db_credentials_secret = secrets.Secret(self, id=f'{resource_prefix}-DBCredentialsSecret',
secret_name=construct_id + '-rds-credentials',
generate_secret_string=secrets.SecretStringGenerator(
secret_string_template=secrets_template,
exclude_punctuation=True,
include_space=False,
generate_string_key="password"
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment