Skip to content

Instantly share code, notes, and snippets.

@fourgates
Created March 23, 2022 18:49
Show Gist options
  • Save fourgates/c1ff4b95f106ff6403969f6bf84d73dd to your computer and use it in GitHub Desktop.
Save fourgates/c1ff4b95f106ff6403969f6bf84d73dd to your computer and use it in GitHub Desktop.
creating a secret using the AWS CDK
// first, lets generate a secret to be used as credentials for our database
const databaseCredentialsSecret = new secretsManager.Secret(this, `${env}-DBCredentialsSecret`, {
secretName: `${env}-rds-credentials`,
generateSecretString: {
secretStringTemplate: JSON.stringify({
username: 'postgres',
}),
excludePunctuation: true,
includeSpace: false,
generateStringKey: 'password'
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment