Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taxintt/cloudsql-restore-workflow
https://github.com/taxintt/cloudsql-restore-workflow
gcp workflows
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/taxintt/cloudsql-restore-workflow
- Owner: taxintt
- Created: 2022-06-12T01:37:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-10T14:27:56.000Z (about 1 year ago)
- Last Synced: 2024-04-17T19:27:32.976Z (9 months ago)
- Topics: gcp, workflows
- Language: HCL
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cloudsql-restore-workflow
This is a sample for restore of Cloud SQL instance.- Restore database from backup
- Execute sql statements (by using cloud functions)
- Create a backup of the database1. Prepare an initial backup of cloud sql instance
```bash
❯ gcloud sql backups list --project --instance sample-instance-v1-for-backupID WINDOW_START_TIME ERROR STATUS INSTANCE
1654919319590 2022-06-11T03:48:39.590+00:00 - SUCCESSFUL sample-instance-v1-for-backup
```2. Setup infra
> **Note**
> Specify cloud sql instance id (`sample-instance-v1-for-backup`) and backup id (`1654919319590`) in `infra/workflows/restore_db.yaml````bash
cd infra
terraform apply -var project=""
```3. Run a job of cloud scheduler (`sample-scheduler-job`)
4. Confirm the result
> **Note**
> Check the instance name that is created with random suffix by using cloud logging.```
❯ gcloud sql backups list --project --instance sample-instance-v1-1654996390
ID WINDOW_START_TIME ERROR STATUS INSTANCE
1654996758862 2022-06-12T01:19:18.862+00:00 - SUCCESSFUL sample-instance-v1-1654996390
```