Hey :slightly_smiling_face: I am looking at deplo...
# general
Hey 🙂 I am looking at deploying a Nextjs application as a Google Cloud Run Service. https://next-auth.js.org/ I am using this for authentication, and one of the environment variables that is needed is
which should be the URL used on deployed instance, however, for my staging environment this is dynamic and not known e.g.
Copy code
const app = new gcp.cloudrun.Service(`app`, {
  template: {
    spec: {
      containers: [
          // Use pushed image from CI (assume local if not)
          image: pulumi.interpolate`<http://gcr.io/${gcp.config.project}/app:${prNumber}|gcr.io/${gcp.config.project}/app:${prNumber}>`,
          ports: [{ containerPort: 3000 }],
          resources: {
            limits: {
              memory: `1Gi`,
      containerConcurrency: 50,
  metadata: {
    annotations: {
      "<http://run.googleapis.com/cloudsql-instances|run.googleapis.com/cloudsql-instances>": pgInstance.connectionName,
e.g. yields https://some-chars.a.run.app and is available as
Copy code
// Export the URL
export const appUrl = app.statuses[0].url;
But I am not sure you can include setting this back to the cloud run env variable?
It sounds like you want to use the resource outputs of an object that doesn't exist yet, to create that object. Which is obviously not going to work. Based on https://next-auth.js.org/getting-started/example,
looks intended to be a "friendly" name for a user to interact with. My guess is you need to pick a friendly name
and then create a the dns entry by hand or based on the output of
Yeah it looks like best approach is to include a
and then this way I can categorically know what my domain will be e.g.
and not use the dynamic url's that are output, this way it is safe. I think that this has to be set for production deploys rather than for users (AFAIK) - bit of a funny req