Skip to content

Conversation

@ptrutanicex
Copy link
Contributor

This PR adds random password to mongo service if no password is provided

@ptrutanicex ptrutanicex requested a review from ikovac November 24, 2023 08:32
serviceName: string;
username: pulumi.Input<string>;
password: pulumi.Input<string>;
password?: pulumi.Input<string>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also describe in the readme that if the password is not provided it will be auto-generated.

*/
username: pulumi.Input<string>;
/**
* Password for the master DB user.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update comment to describe password autogeneration (same as with rds password).

}

private createRandomPassword() {
return new random.RandomPassword(`${this.name}-db-password`, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return new random.RandomPassword(`${this.name}-db-password`, {
return new random.RandomPassword(`${this.name}-mongo-password`, {

Comment on lines 82 to 86
return new random.RandomPassword(`${this.name}-db-password`, {
length: 16,
overrideSpecial: '_%$',
special: true,
}).result;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return new random.RandomPassword(`${this.name}-db-password`, {
length: 16,
overrideSpecial: '_%$',
special: true,
}).result;
const password = new random.RandomPassword(`${this.name}-db-password`, {
length: 16,
overrideSpecial: '_%$',
special: true,
});
return password.result;

Feel free to ignore this readability improvement if you don't like it.

@ikovac ikovac merged commit 3a00a75 into master Nov 24, 2023
@ikovac ikovac deleted the feature/random-mongo-password branch November 24, 2023 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants