https://pulumi.com logo
p

proud-pharmacist-20003

07/07/2020, 7:17 PM
If someone has an example of an alternate way to namespace their buckets using a project-derived attribute, or examples of bucket creation in general, I would appreciate a pointer in the right direction
b

billowy-army-68599

07/07/2020, 7:17 PM
hey! welcome! unfortunately your example won't work, because "computed" values can't be used for pulumi resource names
what you probably want is something like this (i haven't tested this)
Copy code
const bucket = new gcp.storage.Bucket("bucket", {
    name: project.id.apply(projectId => `${projectId}-storage`,
});
h

hallowed-rain-9096

07/07/2020, 7:22 PM
This is the second time this same misunderstanding has appeared in the past couple of days
p

proud-pharmacist-20003

07/07/2020, 7:31 PM
@billowy-army-68599 Thanks for the welcome, and the snippet! I'll give it a whirl.
@hallowed-rain-9096 Guess I am not surprised to hear that; Outputs being promises under the hood was a bit of an adjustment (for me at least).
h

hallowed-rain-9096

07/07/2020, 7:59 PM
yeah, it's odd, but I like that it's clear how it works
i think maybe the docs for the resource names need a little help. I'm brainstorming on it. If I have some inspiration i'll propose it to the Pulumi team
p

proud-pharmacist-20003

07/07/2020, 8:38 PM
Good to know my confusion may have contributed to a positive outcome 😄