Skip to content

Commit bd3e8f4

Browse files
author
Vivek Lakshmanan
committed
Use google-native instead
1 parent 99ab28c commit bd3e8f4

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: gcp-functions
1+
name: google-cloud-ts-functions
22
runtime: nodejs
3-
description: GCP Functions example
3+
description: Google Cloud Functions example
44
template:
55
config:
6-
gcp:project:
6+
google-native:project:
77
description: The Google Cloud project to deploy into
8-
gcp:region:
8+
google-native:region:
99
description: The Google Cloud region

gcp-native-ts-functions/README.md renamed to google-native-ts-functions/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
# Google Cloud Functions
44

5-
An example of deploying an HTTP Google Cloud Function endpoint using GCP Native provider and TypeScript.
5+
An example of deploying an HTTP Google Cloud Function endpoint using Google Cloud Native provider and TypeScript.
66

77
## Prerequisites
88

99
0. [Ensure you have the latest Node.js and NPM](https://nodejs.org/en/download/)
1010
2. [Install the Pulumi CLI](https://www.pulumi.com/docs/get-started/install/)
11-
3. [Configure Pulumi to access your GCP account](https://www.pulumi.com/docs/intro/cloud-providers/gcp/setup/)
11+
3. [Configure Pulumi to access your Google Cloud account](https://www.pulumi.com/docs/intro/cloud-providers/google/setup/)
1212

1313
## Running the App
1414

@@ -21,14 +21,14 @@ An example of deploying an HTTP Google Cloud Function endpoint using GCP Native
2121
2. Create a new stack:
2222
2323
```
24-
$ pulumi stack init gcp-fn
24+
$ pulumi stack init google-fn
2525
```
2626
27-
3. Configure your GCP project and region:
27+
3. Configure your Google Cloud project and region:
2828
2929
```
30-
$ pulumi config set gcp-native:project <projectname>
31-
$ pulumi config set gcp-native:region <region>
30+
$ pulumi config set google-native:project <projectname>
31+
$ pulumi config set google-native:region <region>
3232
```
3333
3434
4. Run `pulumi up` to preview and deploy changes:
@@ -50,11 +50,11 @@ An example of deploying an HTTP Google Cloud Function endpoint using GCP Native
5050
```
5151
$ pulumi stack output url
5252
https://us-central1-pulumi-development.cloudfunctions.net/greeting-function-7f95447
53-
$ curl "$(pulumi stack output url)"
53+
$ curl "$(pulumi stack output functionUrl)"
5454
Greetings from Google Cloud Functions!
5555
```
5656
57-
6. Clean up your GCP and Pulumi resources:
57+
6. Clean up your Google Cloud and Pulumi resources:
5858
5959
```
6060
$ pulumi destroy

gcp-native-ts-functions/index.ts renamed to google-native-ts-functions/index.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Copyright 2016-2021, Pulumi Corporation.
22

3-
import * as gcp from "@pulumi/gcp-native";
3+
import * as gcloud from "@pulumi/google-native";
44
import * as pulumi from "@pulumi/pulumi";
55
import * as random from "@pulumi/random";
66

7-
const config = new pulumi.Config("gcp-native");
7+
const config = new pulumi.Config("google-native");
88
const project = config.require("project");
99
const region = config.require("region");
1010

@@ -16,14 +16,14 @@ const randomString = new random.RandomString("name", {
1616
});
1717

1818
const bucketName = pulumi.interpolate`bucket-${randomString.result}`;
19-
const bucket = new gcp.storage.v1.Bucket("bucket", {
19+
const bucket = new gcloud.storage.v1.Bucket("bucket", {
2020
project: project,
2121
bucket: bucketName,
2222
name: bucketName,
2323
});
2424

2525
const archiveName = "zip";
26-
const bucketObject = new gcp.storage.v1.BucketObject(archiveName, {
26+
const bucketObject = new gcloud.storage.v1.BucketObject(archiveName, {
2727
object: archiveName,
2828
name: archiveName,
2929
bucket: bucket.name,
@@ -33,7 +33,7 @@ const bucketObject = new gcp.storage.v1.BucketObject(archiveName, {
3333
});
3434

3535
const functionName = pulumi.interpolate`func-${randomString.result}`;
36-
const func = new gcp.cloudfunctions.v1.Function("function-py", {
36+
const func = new gcloud.cloudfunctions.v1.Function("function-py", {
3737
projectsId: project,
3838
locationsId: region,
3939
functionsId: functionName,
@@ -47,7 +47,7 @@ const func = new gcp.cloudfunctions.v1.Function("function-py", {
4747
ingressSettings: "ALLOW_ALL",
4848
});
4949

50-
const invoker = new gcp.cloudfunctions.v1.FunctionIamPolicy("function-py-iam", {
50+
const invoker = new gcloud.cloudfunctions.v1.FunctionIamPolicy("function-py-iam", {
5151
projectsId: project,
5252
locationsId: region,
5353
functionsId: functionName, // func.name returns the long `projects/foo/locations/bat/functions/buzz` name which doesn't suit here

gcp-native-ts-functions/package.json renamed to google-native-ts-functions/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "gcp-ts-functions",
2+
"name": "google-cloud-ts-functions",
33
"version": "1.0.0",
44
"devDependencies": {
55
"@types/node": "^8.0.0",
66
"@types/express": "^4.16.0"
77
},
88
"dependencies": {
9-
"@pulumi/gcp-native": "^0.0.2a",
9+
"@pulumi/google-native": "^0.0.1a",
1010
"@pulumi/pulumi": "^3.0.0a",
1111
"@pulumi/random": "^4.0.0a"
1212
}

0 commit comments

Comments
 (0)