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.
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 organization's domains need 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.
- Click Add at the top of the page to add a member to your project.
- Paste email@example.com 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.
- Click 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.
- 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
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.