Skip to content

Commit

Permalink
Automate DB creation (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhutchinson authored Oct 25, 2023
1 parent 0834b29 commit 06ef4a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 0 additions & 4 deletions deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ terraform apply
```

This should bring up the DB and Distributor running in Cloud Run.
To create the Database, the easiest thing to do is to find the instance
within Cloud SQL in GCP UI, and create a database called "distributor".

- [ ] TODO(mhutchinson): Automate the DB creation

After doing that, it's possible to query the distributor using curl:

Expand Down
6 changes: 6 additions & 0 deletions deployment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ resource "google_sql_database_instance" "default" {
depends_on = [google_project_service.sqladmin_api]
}

resource "google_sql_database" "distributordb" {
name = "distributor"
instance = google_sql_database_instance.default.name
charset = "utf8"
}

resource "google_sql_user" "db_user" {
name = local.dbuser
instance = google_sql_database_instance.default.name
Expand Down

0 comments on commit 06ef4a4

Please sign in to comment.