-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
48 lines (42 loc) · 1.25 KB
/
Copy pathserverless.yml
File metadata and controls
48 lines (42 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
service: node-logging-sink-subscription
frameworkVersion: "3"
provider:
name: google
runtime: nodejs14
project: <project_id> # project id is here
credentials: ~/.gcloud/keyfile.json # path must be absolute
package:
exclude:
- node_modules/**
- .gitignore
- .git/**
functions:
handler:
handler: pubSub
events:
- event:
eventType: providers/cloud.pubsub/eventTypes/topic.publish
resource: 'projects/${self:provider.project, ""}/topics/node-logging-event-topic'
resources:
resources:
- type: pubsub.v1.topic
name: node-logging-event-topic
properties:
topic: node-logging-event-topic
accessControl:
gcpIamPolicy:
bindings:
- role: roles/pubsub.publisher
members:
- "serviceAccount:cloud-logs@system.gserviceaccount.com"
- type: logging.v2.sink
name: node-logging-event-sink
properties:
sink: node-logging-event-sink
destination: 'pubsub.googleapis.com/projects/${self:provider.project, ""}/topics/node-logging-event-topic'
filter: protoPayload.methodName:("storage.buckets.create")
metadata:
dependsOn:
- node-logging-event-topic
plugins:
- serverless-google-cloudfunctions