2
2
3
3
# GCP Functions
4
4
5
- An example Pulumi component that deploys a TypeScript function to Google Cloud Functions.
5
+ An example of deploying an HTTP Google Cloud Function endpoint using TypeScript.
6
+
7
+ ## Prerequisites
8
+
9
+ 0 . [ Ensure you have the latest Node.js and NPM] ( https://nodejs.org/en/download/ )
10
+ 2 . [ Install the Pulumi CLI] ( https://pulumi.io/quickstart/install.html )
11
+ 3 . [ Configure Pulumi to access your GCP account] ( https://pulumi.io/quickstart/gcp/setup.html )
6
12
7
13
## Running the App
8
14
9
- 1 . Create a new stack :
15
+ 1 . Restore NPM dependencies :
10
16
11
17
```
12
- $ pulumi stack init gcp-fn
18
+ $ npm install
13
19
```
14
20
15
- 1 . Configure GCP project and region :
21
+ 2 . Create a new stack :
16
22
17
23
```
18
- $ pulumi config set gcp:project <projectname>
19
- $ pulumi config set gcp:region <region>
24
+ $ pulumi stack init gcp-fn
20
25
```
21
26
22
- 1 . Restore NPM dependencies :
27
+ 3 . Configure your GCP project and region :
23
28
24
29
```
25
- $ npm install
30
+ $ pulumi config set gcp:project <projectname>
31
+ $ pulumi config set gcp:region <region>
26
32
```
27
33
28
- 1 . Run `pulumi up` to preview and deploy changes:
34
+ 4 . Run `pulumi up` to preview and deploy changes:
29
35
30
36
```
31
37
$ pulumi up
@@ -39,12 +45,20 @@ An example Pulumi component that deploys a TypeScript function to Google Cloud F
39
45
Update duration: 39.65130324s
40
46
```
41
47
42
- 1 . Check the deployed function endpoint:
48
+ 5 . Check the deployed function endpoint:
43
49
44
50
```
45
51
$ pulumi stack output url
46
52
https://us-central1-pulumi-development.cloudfunctions.net/greeting-function-7f95447
47
53
$ curl "$(pulumi stack output url)"
48
54
Greetings from Google Cloud Functions!
55
+ ```
56
+
57
+ 6. Clean up your GCP and Pulumi resources:
58
+
59
+ ```
60
+ $ pulumi destroy
61
+ ...
62
+ $ pulumi stack rm
49
63
...
50
64
```
0 commit comments