https://pulumi.com logo
#general
Title
# general
s

stale-knife-36790

03/27/2020, 10:31 AM
Are there are any tutorials to create GCP cloud functions with Pulumi? 🤔
b

broad-dog-22463

03/27/2020, 11:28 AM
s

stale-knife-36790

03/27/2020, 12:05 PM
@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

broad-dog-22463

03/27/2020, 12:09 PM
What is the error you are getting?
s

stale-knife-36790

03/27/2020, 12:19 PM
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

broad-dog-22463

03/27/2020, 12:49 PM
What Pulumi config have you got set?
Did you run the company Pulumi config set gcp:project <name>
s

stale-knife-36790

03/27/2020, 1:03 PM
@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

broad-dog-22463

03/27/2020, 1:18 PM
What does your code look like?
s

stale-knife-36790

03/27/2020, 1:30 PM
@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

billowy-army-68599

03/27/2020, 4:19 PM
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

stale-knife-36790

03/30/2020, 8:45 AM
I solved it. There was a small mistake with the name within the config file. It now deploys properly.
o

orange-tailor-85423

04/02/2020, 9:54 PM
@freezing-flag-53289 ^^