-
Notifications
You must be signed in to change notification settings - Fork 0
/
scaleway_serverless_config.yaml
137 lines (137 loc) · 4.02 KB
/
scaleway_serverless_config.yaml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# yaml-language-server: $schema=https://raw.githubusercontent.com/norbjd/scaleway-serverless-module/main/scaleway-serverless-module-validator/config_json_schema.json
function_namespaces:
- name: my-namespace-1
region: "${region}"
project_id: "${project_id}"
description: |
1st namespace
environment_variables:
- key: var1
value: value1
- key: var2
value: ${var2}
secret_environment_variables:
- key: secret_var1
value: ${secret_var1}
- key: secret_var2
value: ${secret_var2}
functions:
- name: func1
runtime: node20
memory_limit: 512
handler: handler.handle
source: ./func1
privacy: public
description: |
Just a simple function
environment_variables:
- key: varA
value: valueA
- key: varB
value: valueB
secret_environment_variables:
- key: secret_varA
value: ${secret_varA}
- key: secret_varB
value: ${secret_varB}
min_scale: 0
max_scale: 10
timeout: 300
http_option: redirected
triggers:
crons:
- name: cron1
schedule: 0 0 * * *
json_args: |
{
"key1": "value1",
"key2": "value2"
}
- name: cron2
schedule: 10 0 * * *
json_args: |
{
"key3": "value3"
}
sqs:
- name: trigger-sqs-1
queue: queue1
- name: trigger-sqs-2
queue: queue2
project_id: "${project_id}"
region: "${region}"
# nats: # technically, this works, but it requires to have a NATS account created before, which we don't have in this example
# - name: trigger-nats-1
# account_id: "AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# subject: subject1
# - name: trigger-nats-2
# account_id: "AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# subject: subject2
# project_id: ${project_id}
# region: ${region}
tokens:
- description: a function token
expires_at: "2100-01-01T00:00:00+00:00"
- description: another function token
tokens:
- description: a namespace token
expires_at: "2100-01-01T00:00:00+00:00"
- description: another namespace token
- name: my-namespace-2
region: "${region}"
project_id: "${project_id}"
functions:
- name: func2
runtime: node18
memory_limit: 1024
handler: handler.handle
source: ./func2
privacy: public
triggers:
crons:
- name: cron1
schedule: 0 0 * * *
json_args: |
{
"key1": "value1",
"key2": "value2"
}
# domains:
# - some.domain.example.com # won't set it here, because domain must be configured to point to the function first
- name: func3
runtime: node20
memory_limit: 256
handler: handler.handle
source: ./func3
privacy: public
- name: my-namespace3
region: "${region}"
project_id: "${project_id}"
container_namespaces:
- name: cont-namespace1
region: "${region}"
project_id: "${project_id}"
containers:
- name: nginx
cpu_limit: 240
memory_limit: 512
image: "nginx:latest"
port: 80
privacy: public
min_scale: 0
max_scale: 1
timeout: 300
http_option: redirected
max_concurrency: 80
- name: custom
cpu_limit: 240
memory_limit: 512
build:
context: ./custom_nginx
port: 80
privacy: public
min_scale: 0
max_scale: 1
- name: cont-namespace2
region: "${region}"
project_id: "${project_id}"