I'm making my first steps with Pulumi, trying to s...
# getting-started
c
I'm making my first steps with Pulumi, trying to set up a GCP
IAMCustomRole
, however, I'm confused why the docs at https://www.pulumi.com/registry/packages/gcp/api-docs/projects/iamcustomrole/#inputs don't show the
orgId
property while the TS compiler (by way of VS Code) seems to insist on it being there
ahh, I guess I'm confusing
organizations.IAMCustomRole
and
projects.IAMCustomRole
so now I've got a
projects.IAMBinding
and I'm setting
project
in the
IAMBindingArgs
which appeases VS Code, but when running
pulumi preview
I get a stack trace saying
Missing required property 'project'
so it seems it likes a string literal but not a string variable? Even though the variable seems to work for
serviceaccount.Account
input args
lots of uncanny valley here 😞
a
const
string is allowed apparently
l
String variables should be allowed. If you want help to get to the bottom of the project weirdness, you could post some code here and we'll have a look.
c
code
message has been deleted
message has been deleted
so the
project
import in the first screenshot refers to the variable in the second one
seems reasonably straightforward? and as you can see,
project
is already used for the
Account
input args, where it apparently works fine
l
Sorry, having a hard time reading pictures of text.. gimme a sec...
Okay, the problem is not related to the first screenshot.
Only the require is failing.
Is the project property correctly set in your stack config file?
c
I have a
Pulumi.staging.yaml
that has a
gcp:project
key within
config
(also, it has been working for that
Account
, so why does it fail for this?)
also, so I can make more sense of these errors myself, how do you figure it's a require error? the top-most stack frame in my code points to
IAMBinding
definition
l
Is the name of your project "gcp"?
c
no
l
Ah never mind, I see the other line in the screenshot, that looks good.
My thinking so far: IAMBinding needs a project property, which you're providing but it isn't getting. Therefore, the value is probably undefined.
You're importing it from the top level of an imported file. That's likely related. Sorry, got a meeting now, I'll be back later, let me know if you make any progress!
c
ugh, you're right that the
project
value is
undefined
but not sure why the import wouldn't work, VS Code seems to find the symbol just fine (to be fair, I'm relatively new at TS)
so that makes it smell like a bug in Pulumi's TS language model thing maybe?