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 organization: 

  • 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 organization'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 organization 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 for your organization. If it’s already on, skip to the next section.
  2. If your organization 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 organization's domains need 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. Click Add Add people at the top of the page to add a member to your project.
  4. Paste 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. Click 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.
    3. If you have more than one domain for your organization, add the other domains.

4. Add the Cloud SQL instance to the App Maker settings

  1. Go to SQL instances and click the instance you're using for App Maker.
  2. Locate the instance connection name field, and then click Copy 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 organization. 

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

Was this article helpful?
How can we improve it?