Use google-native instead
RENAME
gcp-native-ts-functions/Pulumi.yaml
google-native-ts-functions/Pulumi.yaml
-name: gcp-functions
+name: google-cloud-ts-functions
runtime: nodejs
-description: GCP Functions example
+description: Google Cloud Functions example
template:
config:
- gcp:project:
+ google-native:project:
description: The Google Cloud project to deploy into
- gcp:region:
+ google-native:region:
description: The Google Cloud region

RENAME
gcp-native-ts-functions/README.md
google-native-ts-functions/README.md
# Google Cloud Functions
-An example of deploying an HTTP Google Cloud Function endpoint using GCP Native provider and TypeScript.
+An example of deploying an HTTP Google Cloud Function endpoint using Google Cloud Native provider and TypeScript.
## Prerequisites
0. [Ensure you have the latest Node.js and NPM](https://nodejs.org/en/download/)
2. [Install the Pulumi CLI](https://www.pulumi.com/docs/get-started/install/)
-3. [Configure Pulumi to access your GCP account](https://www.pulumi.com/docs/intro/cloud-providers/gcp/setup/)
+3. [Configure Pulumi to access your Google Cloud account](https://www.pulumi.com/docs/intro/cloud-providers/google/setup/)
## Running the App
@@ -21,14 +21,14 @@ An example of deploying an HTTP Google Cloud Function endpoint using GCP Native
2. Create a new stack:
```
- $ pulumi stack init gcp-fn
+ $ pulumi stack init google-fn
```
-3. Configure your GCP project and region:
+3. Configure your Google Cloud project and region:
```
- $ pulumi config set gcp-native:project <projectname>
- $ pulumi config set gcp-native:region <region>
+ $ pulumi config set google-native:project <projectname>
+ $ pulumi config set google-native:region <region>
```
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
```
$ pulumi stack output url
https://us-central1-pulumi-development.cloudfunctions.net/greeting-function-7f95447
- $ curl "$(pulumi stack output url)"
+ $ curl "$(pulumi stack output functionUrl)"
Greetings from Google Cloud Functions!
```
-6. Clean up your GCP and Pulumi resources:
+6. Clean up your Google Cloud and Pulumi resources:
```
$ pulumi destroy

RENAME
gcp-native-ts-functions/index.ts
google-native-ts-functions/index.ts
// Copyright 2016-2021, Pulumi Corporation.
-import * as gcp from "@pulumi/gcp-native";
+import * as gcloud from "@pulumi/google-native";
import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
-const config = new pulumi.Config("gcp-native");
+const config = new pulumi.Config("google-native");
const project = config.require("project");
const region = config.require("region");
@@ -16,14 +16,14 @@ const randomString = new random.RandomString("name", {
});
const bucketName = pulumi.interpolate`bucket-${randomString.result}`;
-const bucket = new gcp.storage.v1.Bucket("bucket", {
+const bucket = new gcloud.storage.v1.Bucket("bucket", {
project: project,
bucket: bucketName,
name: bucketName,
});
const archiveName = "zip";
-const bucketObject = new gcp.storage.v1.BucketObject(archiveName, {
+const bucketObject = new gcloud.storage.v1.BucketObject(archiveName, {
object: archiveName,
name: archiveName,
bucket: bucket.name,
@@ -33,7 +33,7 @@ const bucketObject = new gcp.storage.v1.BucketObject(archiveName, {
});
const functionName = pulumi.interpolate`func-${randomString.result}`;
-const func = new gcp.cloudfunctions.v1.Function("function-py", {
+const func = new gcloud.cloudfunctions.v1.Function("function-py", {
projectsId: project,
locationsId: region,
functionsId: functionName,
@@ -47,7 +47,7 @@ const func = new gcp.cloudfunctions.v1.Function("function-py", {
ingressSettings: "ALLOW_ALL",
});
-const invoker = new gcp.cloudfunctions.v1.FunctionIamPolicy("function-py-iam", {
+const invoker = new gcloud.cloudfunctions.v1.FunctionIamPolicy("function-py-iam", {
projectsId: project,
locationsId: region,
functionsId: functionName, // func.name returns the long `projects/foo/locations/bat/functions/buzz` name which doesn't suit here

RENAME
gcp-native-ts-functions/package.json
google-native-ts-functions/package.json
{
- "name": "gcp-ts-functions",
+ "name": "google-cloud-ts-functions",
"version": "1.0.0",
"devDependencies": {
"@types/node": "^8.0.0",
"@types/express": "^4.16.0"
},
"dependencies": {
- "@pulumi/gcp-native": "^0.0.2a",
+ "@pulumi/google-native": "^0.0.1a",
"@pulumi/pulumi": "^3.0.0a",
"@pulumi/random": "^4.0.0a"
}

RENAME
gcp-native-ts-functions/pythonfunc/main.py
google-native-ts-functions/pythonfunc/main.py
RENAME
gcp-native-ts-functions/tsconfig.json
google-native-ts-functions/tsconfig.json
Use google-native instead