docs/1.5/03-Tutorials/04-Cluster-Deployment/06-Prisma-Coud-(Google-Cloud-SQL).md
This guide gets you up and running with Prisma Cloud and Google Cloud SQL.
In Google Cloud you are able to receive 300$ credit for free for 12 months.
In the following sections, you are going to learn how to:
If you don't have an Google account yet, sign up here. If you have you can use your Google account.
</Instruction>
This process might take a little while, but you'll get there! Note that you'll have to provide credit card info as well as your phone number at some point during the process.
Follow the steps to add your credit card, ...
Click on the red box shown below in the image to create a new project.
Create a name for your project.
In this section, you'll spin up a new Google Cloud SQL instance in the us-east1 region. If you prefer, feel free to choose any of the other supported regions instead:
us-central1 / US Central (Iowa)us-east1 / US East (South Carolina)us-east4 / US East (Northern Virginia)us-west1 / US West (Oregon)southamerica-east1 / South America East (São Paulo)northamerica-northeast1 / Canada North-East (Montréal)europe-west1 / Belgium (St. Ghislain)europe-west2 / Belgium (St. Ghislain)europe-west3 / Belgium (St. Ghislain)europe-west4 / Belgium (St. Ghislain)australia-southeast1 / Australia (Sydney)asia-east1 / Asia Pacific (Changhua County, Taiwan)asia-northeast1 / Asia Pacific (Tokyo)asia-south1 / India (Mumbai)To setup a new Google Cloud SQL instance in the us-east1 region, go in the navigation on the left to Storage/SQL. And click the button Create Instance
In the Select MySQL, click Next. And you will be prompted between First and Second Generation. Click Choose Second Generation.
</Instruction>
For the the purpose of this you can use whatever you want. For example:
us-east1You can change the advanced configurations. But for the purpose of this tutorial we won't get in it.
And click Create
</Instruction> <Instruction>Now your instance is being created. This can take some time.
</Instruction>Click the name of your instance, in this case prisma.
And continue to the tab Authorization.
Here a network needs to be added. Click Add Network (Step 1), and a box above will appear (Step 2.). And put 0.0.0.0/0 in the Network input (Step 3.), name is optional.
Click Done (Step 4.) to save the changes. Now Prisma Cloud should be able to reach your Google Cloud SQL instance using user root and the password you defined using the public ip of the instance.
The public ip can be found in the tab Overview of your instance located on Connect to this instance.
</Instruction>Note: Creating your own Prisma Cluster requires you to provide valid credit card information. Pricing starts at $45 / month per cluster in a pay-as-you-go fashion. Find more info about the pricing here.
Navigate to the Prisma Cloud Console and login or sign up.
</Instruction>To create a new Prisma cluster that is connected to your newly created MySQL database, navigate to the Clusters view by selecting the corresponding tab in the top-menu.
</Instruction> <Instruction>To move on to the form where you can provide the details about your database to connect it with your cluster, click the Create Clusters button.
</Instruction><Instruction>Note: To learn more about the required information to create a new cluster, you can check out this 3-min tutorial video.
Insert the required data:
myusername)prismagraphql)When you're done with that, select click Test connection.
</Instruction> <Instruction>After the connection was successfully tested, you need to provide a Cluster name (e.g. my-cluster) and optionally a Description.
Finally, you need to select a Cluster region - choose the one that's closest to where the majority of your users is supposably located.
</Instruction> <Instruction>If you haven't done so before, you need now need to provide your credit card information. Finally, click Create Cluster.
</Instruction>The process of setting up a cluster usually shouldn't take longer than a few seconds. The provisioning status of your cluster will be printed continuously.
You can navigate back to the cluster overview and follow the provisioning status. Once your cluster is up and running, the status says Healthy.
Now that you provisioned a cluster, you can use it as a runtime environment for your Prisma services by using it as a deployment target.
<Instruction>Install the latest CLI version with the following command:
npm install -g prisma
Then, log into your Prisma Cloud account:
prisma login
This will store your cloud session key in ~/.prisma/config.yml. This key is used by the CLI to authenticate you against Prisma Cloud.
Next, go ahead and create a new service:
prisma init hello-world
When prompted by the CLI, choose the Minimal setup: database-only option. Then navigate into the newly created directory and deploy the service:
cd hello-world
prisma deploy
After running prisma deploy, the Prisma CLI will prompt you to choose a cluster you'd like to use as a deployment target. Among the options, you'll find the cluster that you've just setup.
Select the cluster that you just created in the CLI.
</Instruction>This is it - your Prisma service is now deployed to your own Prisma Cloud cluster 🚀
Google Cloud SQL - Maarten Coppens