This message was deleted.
# general
s
This message was deleted.
g
You can use the Random package to get a stable random string that you could use as a suffix. https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/random/#RandomString
e
thanks! I’ll try this out in the morning.
Whenever I declare
Copy code
const id = new random.RandomId("id", {byteLength: 8});
I always get
Copy code
error: Duplicate resource URN 'urn:pulumi:dev::folding-foundation::random:index/randomId:RandomId::id'; try giving it a unique name
if I rename it and try to deploy, I get the same error. I haven’t tried using the generated id in any of the resources yet.
it doesn’t seem to matter what the name is, and I’m only making this one call to the
random
package.
for instance
Copy code
const idasdf = new random.RandomId("id-asdf", {byteLength: 8});

    error: Duplicate resource URN 'urn:pulumi:dev::folding-foundation::random:index/randomId:RandomId::id-asdf'; try giving it a unique name
I figured it out. I forgot that I’m using multiple providers so the id was being used multiple times.
👍 1
doh! I hadn’t noticed
computeEnvironmentNamePrefix
. It’s unfortunate that you can’t set the length of the id to generate, but this does what I need.
g
You can set the length of
RandomString
, but
computeEnvironmentNamePrefix
is likely easier in the long run.
e
yep. Agreed