pulumi / pulumi-gcp

A Google Cloud Platform (GCP) Pulumi resource package, providing multi-language access to GCP
Apache License 2.0
180 stars 52 forks source link

Cloudrunv2 get url not addressed in docs #1135

Closed yehudamakarov closed 1 year ago

yehudamakarov commented 1 year ago

Would you be able to help me here?

Should I use v1 because the notion of accessing the service's URL is forever gone? What shall I do?

(was redirected from https://github.com/pulumi/pulumi/issues/13574)

mnlumi commented 1 year ago

Hey @yehudamakarov Could you link me to the specific resource api doc you are looking at?

yehudamakarov commented 1 year ago

https://www.pulumi.com/registry/packages/gcp/api-docs/cloudrun/service/#cloud-run-service-pubsub here you can get the service url

https://www.pulumi.com/registry/packages/gcp/api-docs/cloudrunv2/service/ Here there’s no example like above and hence no clue how to get the url

Thanks, Yehuda Makarov On Jul 25, 2023 at 3:15 PM -0400, Monica @.***>, wrote:

Hey @yehudamakarov Could you link me to the specific resource api doc you are looking at? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

rquitales commented 1 year ago

Hi @yehudamakarov apologies that you're facing difficulties with getting the URL of a CloudRun service. It is recommended to use the newer v2 CloudRun API provided by GCP, though v1 is still supported by GCP.

To get the service URL, you should be able to use the uri field: https://www.pulumi.com/registry/packages/gcp/api-docs/cloudrunv2/service/#uri_nodejs.

Below is an example of how to achieve this using Javascript:

const svc = new gcp.cloudrunv2.Service("default", {
    ingress: "INGRESS_TRAFFIC_ALL",
    location: "us-central1",
    template: {
        containers: [{
            image: "us-docker.pkg.dev/cloudrun/container/hello",
        }],
    },
});

exports.svcURL = svc.uri;

I hope this helps unblock you. Feel free to reopen this issue if you require further assistance.

collin commented 3 months ago

I found this issue looking for the same thing.

I think this would be a useful detail to add to the documentation for the uri field.

The current documentation:

(Output) Displays the target URI.

Doesn't match the name used by cloud run, the call it "url" or "address.url" depending on where you look.

URI is technically correct, but in the context of a cloud provider it's ambiguous as to whether it's the location of the service, or just some internal identifier.