Skip to content

Deploy a sample Spring boot REST APIs with Google SQL on Google Cloud Run using Terraform

Notifications You must be signed in to change notification settings

mozammal/spring-boot-terraform-google-sql-gcloud-run-demo

Repository files navigation

spring-boot-terraform-google-sql-gcloud-run-demo

This example shows how to run a hello world service on Google Run using Terraform

Prerequisites: Java 11

Terraform

Google SQL

Getting Started

Terraform is used to create the Google Cloud Run infrastructure needed to deploy our hello world spring boot service. The following commands create the cloud infrastructure and will eventually show the URL of the deployed service,

git clone https://github.com/mozammal/spring-boot-terraform-google-sql-gcloud-run-demo.git
cd spring-boot-terraform-google-sql-gcloud-run-demo
mvn clean compile jib:build 
cd terraform
terraform init
terraform plan
terraform apply
terraform output url

You’ve now come to the point where you can finally make post and get requests if you open the URL of the aforementioned deployed service on Google Cloud Run using terraform output url.

Create a contact

{
  "firstName": "mozammal",
  "lastName": "hossain"
}
find all customers

Destroy the infrastructure that we created in the previous step by running the following command:

terraform destroy

About

Deploy a sample Spring boot REST APIs with Google SQL on Google Cloud Run using Terraform

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published