I am going to use postgress extension for pulumi t...
# general
l
I am going to use postgress extension for pulumi to create role and extension, however this is my flow: 1. create a random string for user's password 2. create a new role 3. create a new secret manager to save it everything seems good, but the problem is that as the random value changes every time, it tries to replace role and secret manager value. what can I do?
b
how are you creating the random string?
l
using this typescript function
Copy code
export const generateRandomString = (length: number): string => {

    const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';

    // rest of code remains the same
    let result = '';
    const charactersLength = characters.length;
    for (let i = 0; i < length; i++) {
        result += characters.charAt(Math.floor(Math.random() * charactersLength));
    }

    return result;
}
it is my own function
b
l
perfect, you have everything on your side...
I will try it, thank you