a

    aloof-traffic-97122

    1 month ago
    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:
    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

    limited-rainbow-51650

    4 weeks ago
    Just pass the
    id
    of the instance to the group:
    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/