Skip to content

Commit 8c0b902

Browse files
committed
updated README.md
1 parent 3db4aa9 commit 8c0b902

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

gcp_cloud_function_sql_export/README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,34 @@ Upload the function to GCF in the current GCP project - this script will call `g
1717
./deploy.sh
1818
```
1919

20+
or use the [Serverless](https://www.serverless.com/) framework for which a `serverless.yml` config is provided:
21+
22+
```
23+
serverless deploy
24+
```
25+
26+
If this is your first time using Serverless then you'll need to install the GCP plugin:
27+
28+
```
29+
serverless plugin install --name serverless-google-cloudfunctions
30+
```
31+
32+
The `serverless.yml` config expects to find `$GOOGLE_PROJECT_ID` and `$GOOGLE_REGION` environment variables.
33+
34+
Serverless requires additional permissions for the service account: Deployment Manager Editor and Storage Admin to create deployments and staging buckets.
35+
36+
You can also build a serverless artifact to `.serverless/` without deploying it (generates Google [Deployment Manager](https://cloud.google.com/deployment-manager) templates and a zip file - useful to check what would be uploaded / ignored):
37+
38+
```
39+
serverless package
40+
```
41+
2042
### Solution Dependencies
2143

2244
- a [Cloud PubSub](https://cloud.google.com/pubsub) topic
2345
- [Cloud Scheduler](https://cloud.google.com/scheduler) jobs to trigger backups
2446
- see `gcp_cloud_schedule_sql_exports.sh` in [DevOps Bash tools](https://github.com/HariSekhon/DevOps-Bash-tools/) repo
25-
- a service account with permissions to access [Cloud SQL](https://cloud.google.com/sql) and the [GCS](https://cloud.google.com/storage) bucket
26-
- see `gcp_sql_exports_create_service_account.sh` in [DevOps Bash tools](https://github.com/HariSekhon/DevOps-Bash-tools/) repo
47+
- a service account with permissions to access [Cloud SQL](https://cloud.google.com/sql)
48+
- see `gcp_sql_create_readonly_service_account.sh` in [DevOps Bash tools](https://github.com/HariSekhon/DevOps-Bash-tools/) repo
49+
- each [Cloud SQL](https://cloud.google.com/sql) instance to be backed up requires objectCreator permissions to the [GCS](https://cloud.google.com/storage) bucket
50+
- see `gcp_sql_grant_instances_gcs_object_creator.sh` in [DevOps Bash tools](https://github.com/HariSekhon/DevOps-Bash-tools/) repo

0 commit comments

Comments
 (0)