Skip to content

Peter554/gcp-cloud-run-contacts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcp-cloud-run-contacts

CI

An example app using GCP Cloud Run with Cloud SQL.

Project ID

  • Set the GitHub actions secret GCP_PROJECT_ID

Database preparations

https://cloud.google.com/sql/docs/postgres/connect-run

  • Create a Cloud SQL postgres instance.
  • Connect to the instance (gcloud sql connect) and create the contacts table:
create table if not exists contacts (
    id serial primary key,
    name varchar(100),
    email varchar(100)
);
  • Obtain the INSTANCE_CONNECTION_NAME (gcloud sql instances describe).
  • Set the GitHub actions secret GCP_SQL_CONNECTION_NAME.
  • Determine the postgres Data Source Name (DSN): user=postgres password=<password> database=postgres host=/cloudsql/<INSTANCE_CONNECTION_NAME>
  • Set the GitHub actions secret GCP_SQL_DSN.

Service account

About

GCP Cloud Run example with Cloud SQL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published