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.
2. Set up a Cloud SQL instance for App Maker
- Go to the Cloud SQL Instances page in GCP.
- Click Create Instance to set up a new instance.
The following are required settings:
- MySQL—database engine
- Second Generation—type of instance
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.
- Open IAM & Admin in GCP.
- Click Select a project at the top of the page, then select the project that contains the SQL instance.
- Select Add at the top of the page to add a member to your project.
- Paste firstname.lastname@example.org into the New members field.
- Click the Roles drop-down list and choose the following roles:
- Cloud SQL Cloud SQL Admin
- Cloud SQL Cloud SQL Client
- Click Save.
- Select Add to give your domain access to the SQL instance:
- Enter your domain as the member name.
- Assign the Cloud SQL Cloud SQL Client role.
4. Add the Cloud SQL instance to the Admin console
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.