Hi, Im working on Uptime healthchecks in gcp, and ...
# python
b
Hi, Im working on Uptime healthchecks in gcp, and using the
gcp.monitoring.UptimeCheckConfig
class, when I'm a trying to
pulumi up
the resource, I get the error:
Copy code
creating UptimeCheckConfig: googleapi: Error 400: Name must begin with 'projects/{project_id}/groups/{group_id}', got: project/PROJECT_ID/groups/
but I don't understand what name there is referring to? There is no keyword argument call name and I don't see anything on this formed written in the examples on the document page. Help will be appreciated!
v
Is it possible to share the class you're trying to write? Also, are you using the native or classic gcp provider?
The name with that formatting, should be the output name of the resource
b
The class
Copy code
https = gcp.monitoring.UptimeCheckConfig("UPTIME-CHECK-https",
        # project=gc_project,                                            
        # gcp.monitoring.UptimeCheckConfig
        display_name='uptime-check-pulumi',
        timeout="10s",
        resource_group=gcp.monitoring.UptimeCheckConfigResourceGroupArgs(
            resource_type="INSTANCE"
        ),
        http_check = gcp.monitoring.UptimeCheckConfigHttpCheckArgs(
            path="/"
        ),
        opts=pulumi.ResourceOptions(depends_on=[service])
        )
I'm not sure about your second question - what is the difference between native and classic gcp provider?
v
classic provider wrapps over terraform, native one calls google API directly
It looks to me that you're missing the group_id property on the gcp.monitoring.UptimeCheckConfigResourceGroupArgs object There is an example in a comment of the python gcp provider (I know, it's not a place someone usually looks) https://github.com/pulumi/pulumi-gcp/blob/master/sdk/python/pulumi_gcp/monitoring/uptime_check_config.py#L766
b
That was the problem! Thank you very much! The documentation doesn't explicitly say that it is necessary
v
You're welcome 😄 You could raise a PR regarding the documentation, but I'm not sure where
But sometimes, this calls for some troubleshooting
b
I dont know if you are the right to ask, but do you know why the only resource_types that are supported are
INSTANCE
and
AWS_ELB_LOAD_BALANCER
and not all the possible on gcp console like URL or cloud run service?
v
It's not that you can't, but that you should use something else. You can check the usage of other fields, e.g. http/tcp via http_check and tcp_check.
There are lots of "optional" fields, which used in the right combination, can help you achieve what you want
Have a read through them