Set up a Google Cloud SQL database for App Maker

Although developers can configure their apps to use external data sources, we recommend G Suite administrators provide a default Google Cloud SQL instance that App Maker can use to store app data. Once you set up the default database for your domain: 

  • Developers can quickly add data models to their apps with just a few clicks.
  • App Maker handles interactions with SQL, letting developers forgo database management tasks and focus on building great apps.
  • You can ensure your domain's G Suite data is stored securely in a database controlled by your organization.

If you decline to provide a default Cloud SQL database, developers can deploy apps that use external databases, such as a MySQL database that resides outside of Google Cloud.  

Set up the default database

To set up a database, you need to:

  • Make sure Google Cloud Platform (GCP) is on.
  • Create or use an existing Cloud SQL instance.
  • Give App Maker and your domain access to Cloud SQL.
  • Add Cloud SQL details to the Google Admin Console.

1. Make sure Google Cloud is enabled for your organization

Google Cloud SQL is part of GCP and has its own pricing structure

  1. Check the status of GCP in your domain. If it’s already on, skip to the next section.
  2. If your domain isn't using GCP, create an account. You may be eligible for a free trial.
  3. You need to:
    • Accept the Terms of Service.
    • Add your company information and set up billing.

2. Set up a Cloud SQL instance for App Maker

  1. Go to the Cloud SQL Instances page in GCP.
  2. Click Create Instance to set up a new instance.
    The following are required settings:
    • MySQL—database engine
    • Second Generation—type of instance
    • us-central—region
    Note: App Maker can use an existing Cloud SQL instance if it meets these requirements.

3. Add Cloud SQL roles for App Maker

Before App Maker can use Cloud SQL, you must grant some permissions in GCP:

  • App Maker needs the SQL admin role to create and manage databases. It needs the SQL client role for apps to read and write data.
  • Your domain needs the SQL client role so apps can read and write data on behalf of app users. 
  1. Open IAM & Admin in GCP.
  2. Click Select a project at the top of the page, then select the project that contains the SQL instance.
  3. Select Add Add people at the top of the page to add a member to your project.
  4. Paste appmaker-maestro@appspot.gserviceaccount.com into the New members field.
  5. Click the Roles drop-down list and choose the following roles:
    • Cloud SQL and then Cloud SQL Admin
    • Cloud SQL and then Cloud SQL Client
  6. Click Save.
  7. Select Add Add people to give your domain access to the SQL instance:
    1. Enter your domain as the member name.
    2. Assign the Cloud SQL and then Cloud SQL Client role. 

4. Add the Cloud SQL instance to the Admin console

  1. Go to SQL instances and click instance you're using for App Maker.
  2. Locate the instance connection name field, and then click the copy button Copy.
  3. Open App Maker settings in the Admin console.
  4. Paste the instance details in the Database settings field and click Save.

5. Verify that you can create models in App Maker

Default SQL is typically enabled soon after you save your changes in the Admin console. However, it can take up to 24 hours to propagate to all users in your domain. 

Open App Maker and verify that you can create a new SQL model.

Was this article helpful?
How can we improve it?