Are there are any tutorials to create GCP cloud fu...
# general
s
Are there are any tutorials to create GCP cloud functions with Pulumi? 🤔
b
s
@broad-dog-22463 Thanks for the replies! I found these posts earlier however when creating a gloud project with pulumi and I'm trying to deploy the code (with or without specified project in the .yaml file) it gives an error that it can't create the project. (I'm logged in within the gcloud shell and I'm trying to deploy it within the terminal of my prefered IDE, PHPStorm)
b
What is the error you are getting?
s
Without a specified project:
error: project: required field is not set
With project specified:
Copy code
The Pulumi runtime detected that 63 promises were still active
    at the time that the process exited. There are a few ways that this can occur:
      * Not using `await` or `.then` on a Promise returned from a Pulumi API
      * Introducing a cyclic dependency between two Pulumi Resources
      * A bug in the Pulumi Runtime
    Leaving promises active is probably not what you want. If you are unsure about
    why you are seeing this message, re-run your program with the `PULUMI_DEBUG_PROMISE_LEAKS`
    environment variable. The Pulumi runtime will then print out additional
    debug information about the leaked promises.

  gcp:storage:Bucket (my-bucket):
    error: googleapi: Error 400: Unknown project id: pulumi_gcloud_test, invalid
@broad-dog-22463
b
What Pulumi config have you got set?
Did you run the company Pulumi config set gcp:project <name>
s
@broad-dog-22463 My Pulumi.dev.yaml has the following content:
Copy code
config:
  gcp:project: pulumi-gcloud-test
And my Pulumi.yaml file:
Copy code
name: gcloud
runtime: nodejs
description: A minimal Google Cloud JavaScript Pulumi program
I tried the command a second ago and I do still get the same error on
pulumi up
.
b
What does your code look like?
s
@broad-dog-22463 It's just the standard code that the command
pulumi new gcp-javascript
makes.
Copy code
"use strict";
const pulumi = require("@pulumi/pulumi");
const gcp = require("@pulumi/gcp");

// Create a GCP resource (Storage Bucket)
const bucket = new gcp.storage.Bucket("my-bucket");

// Export the DNS name of the bucket
exports.bucketName = bucket.url;
b
I think this is related to this https://github.com/pulumi/pulumi-gcp/issues/129 Can you try reinit your stack @stale-knife-36790?
s
I solved it. There was a small mistake with the name within the config file. It now deploys properly.
o
@freezing-flag-53289 ^^