hi friends, this is probably really simple, but I'...
# google-cloud
a
hi friends, this is probably really simple, but I'm trying to create a gcp instance and a gcp instance group using the pulumi python API. The code for this looks like:
Copy code
instance = gcp.compute.Instance(...a bunch of args)
instance_group = gcp.compute.InstanceGroup(instances=[instance.self_link], ...other args)
When I run pulumi pre, I get
AttributeError: 'NoneType' object has no attribute 'self_link'
, so it looks like the instance is
None
. Are there any tips on how I debug what to do next?
for posterity, I figured out that this wasn't a pulumi issue -- someone was doing something tricky with monkey patching with our pulumi codebase that had unintended consequences
l
Just pass the
id
of the instance to the group:
Copy code
instance_group = gcp.compute.InstanceGroup(instances=[instance.id], ...other args)
See the example named
Example Usage - With instances and Named ports
in the docs: https://www.pulumi.com/registry/packages/gcp/api-docs/compute/instancegroup/