-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
69 lines (63 loc) · 1.87 KB
/
serverless.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
service: text-to-podcast
custom: ${file(./config.js)}
provider:
name: google
project: ${self:custom.gcp.project}
runtime: nodejs8
region: us-central1
credentials: ${self:custom.gcp.credentialsPath}
plugins:
- serverless-google-cloudfunctions
- serverless-plugin-typescript
- tts-podcast-info
package:
exclude:
- node_modules/**
- .git/**
- .build/**
- test-data/**
- .gitignore
- .eslintrc.yml
- .tsconfig.json
- example-config.json
- Readme.md
functions:
parse-webpage:
handler: parseWebpage
events:
- event:
eventType: providers/cloud.pubsub/eventTypes/topic.publish
resource: projects/${self:provider.project}/topics/${self:custom.gcp.parserPubSubTopic}
text-to-speech:
handler: textToSpeech
memorySize: 2048
timeout: 540s
events:
- event:
eventType: providers/cloud.pubsub/eventTypes/topic.publish
resource: projects/${self:provider.project}/topics/${self:custom.gcp.ttsPubSubTopic}
generate-podcast-rss:
handler: generatePodcastRss
events:
- event:
eventType: providers/cloud.storage/eventTypes/object.change
resource: projects/${self:provider.project}/buckets/${self:custom.gcp.bucket}
resources:
resources:
# Enable required APIs
- type: deploymentmanager.v2.virtual.enableService
name: texttospeech-enable
properties:
consumerId: project:${self:provider.project}
serviceName: texttospeech.googleapis.com
# Create required resources
- type: storage.v1.bucket
name: ${self:custom.gcp.bucket}
- type: pubsub.v1.topic
name: ${self:custom.gcp.parserPubSubTopic}
properties:
topic: ${self:custom.gcp.parserPubSubTopic}
- type: pubsub.v1.topic
name: ${self:custom.gcp.ttsPubSubTopic}
properties:
topic: ${self:custom.gcp.ttsPubSubTopic}