https://pulumi.com logo
Title
c

cuddly-father-4905

05/12/2021, 7:13 PM
Is there a reason why some resources are allowed to have a colon in their Pulumi name, whereas others aren't? e.g.
Project
from `@pulumi/gcp/organizations`:
new Project('project:dev', { ...config })
is invalid, whereas
IAMBinding
from `@pulumi/gcp/projects`:
new IAMBinding('iam:my-role', { ...config })
is valid
b

billowy-army-68599

05/12/2021, 7:14 PM
this is enforced by the upstream API I believe, we just consume it
IE I think this is a Google thing
c

cuddly-father-4905

05/12/2021, 7:18 PM
@billowy-army-68599 isn't this name only used by Pulumi though? I'd understand if it was the
name
field inside the args object for the resource, but this is the "name" parameter that all Pulumi resources have, regardless of the cloud provider being used
I might have missed something of course - I'm still fairly new to Pulumi
b

billowy-army-68599

05/12/2021, 7:18 PM
So the name of inside the resource gets used as the
name
field with auto naming
so let's say you creating
new Project('project:dev')
it creates a resource with name
project:dev-xxxxxx
which is still used for the API call
if you look at the API spec: https://cloud.google.com/resource-manager/reference/rest/v1/projects#resource:-project here's the allowed characters
c

cuddly-father-4905

05/12/2021, 7:24 PM
Ahh thanks @billowy-army-68599 - I didn't realise that auto-naming was a thing
c

cuddly-father-4905

05/12/2021, 7:27 PM
I'll have a read over that - thanks again!