# Create a Sensitive Data Protection inspection template

This quickstart shows you how to create and use a Sensitive Data Protection inspection
template in the Google Cloud console. [Sensitive Data Protection inspection templates](https://docs.cloud.google.com/sensitive-data-protection/docs/concepts-templates.md.txt)
let you create and persist configuration information in Sensitive Data Protection.

To complete this quickstart, you need to have data that you can scan in
Cloud Storage, BigQuery, or Firestore in Datastore mode (Datastore).

*** ** * ** ***

To follow step-by-step guidance for this task directly in the
Google Cloud console, click **Guide me**:

[Guide me](https://console.cloud.google.com/?walkthrough_id=dlp--quickstart-create-template-inspect)

*** ** * ** ***

## Before you begin

1.


   Enable the Sensitive Data Protection API, if it is not already enabled.


   **Roles required to enable APIs**


   To enable APIs, you need the `serviceusage.services.enable` permission. If you
   created the project, then you likely already have this permission through the
   Owner role (`roles/owner`). Otherwise, you can get this permission through the
   Service Usage Admin role (`roles/serviceusage.serviceUsageAdmin`).
   [Learn how to grant roles](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access.md.txt).

   [Enable the API](https://console.cloud.google.com/apis/enableflow?apiid=dlp.googleapis.com)

## Create a template

In the following sections, you configure and create an inspection template.

### Define template

1. In the Sensitive Data Protection section of the Google Cloud console, go
   to the **Create template** page.

   [Go to Create template](https://console.cloud.google.com/security/sensitive-data-protection/create/template;source=7)
2. On the **Create template** page, define the following options:

   - For **Template type** , use the default setting **Inspect (find sensitive
     data)**.

   - For **Template ID** , enter `quickstart-template`.

   - For **Display name** , enter `Quickstart template`.

   - For **Description**, leave the field empty.

   - For **Resource location** , use the default setting **Global (any
     region)**.

3. Click **Continue**.

### Configure detection

You now configure the template to detect for an infoType such as credit card numbers.

1. In the **Configure detection** section of the **Create template** page, do
   the following:

   - In the **InfoTypes** section, click **Manage infoTypes** , select the
     infoTypes that you want to scan for, and then click **Done**.

   - In the **Confidence threshold** section, select **Possible**
     from the **Likelihood** list.

     The default value **Possible** is sufficient for most purposes. If
     you routinely get matches that are too broad when you use this
     template, move the slider up. If you get too few matches, move the
     slider down.
2. To create the template, click **Create**.

   The template's summary information page appears. To return to the main
   Sensitive Data Protection page, click
   **Inspection template details**.

## Use the template

The following steps describe how to configure the template for use in a scan:

1. In the Google Cloud console, go to the **Create job or job trigger**
   page.

   [Go to Create job or job trigger](https://console.cloud.google.com/security/sensitive-data-protection/create/job;source=7)
2. Follow the prompts to create an inspection job or job trigger (a recurring
   job). When you are prompted to configure the detection, select the template
   that you created.

## Clean up


To avoid incurring charges to your Google Cloud account for
the resources used on this page, follow these steps.

### Delete the project


The easiest way to eliminate billing is to delete the project that you
created for the tutorial.

To delete the project:

> [!CAUTION]
> **Caution** : Deleting a project has the following effects:
>
> - **Everything in the project is deleted.** If you used an existing project for the tasks in this document, when you delete it, you also delete any other work you've done in the project.
> - **Custom project IDs are lost.** When you created this project, you might have created a custom project ID that you want to use in the future. To preserve the URLs that use the project ID, such as an `appspot.com` URL, delete selected resources inside the project instead of deleting the whole project.
>
>
> If you plan to explore multiple architectures, tutorials, or quickstarts, reusing projects
> can help you avoid exceeding project quota limits.

1. In the Google Cloud console, go to the **Manage resources** page.

   [Go to Manage resources](https://console.cloud.google.com/iam-admin/projects)
2. In the project list, select the project that you want to delete, and then click **Delete**.
3. In the dialog, type the project ID, and then click **Shut down** to delete the project.

<br />

<br />

### Delete the template

There are no costs associated with creating and storing templates. However, if
you want to delete a template, follow these steps:

1. In the Google Cloud console, go to the **Configuration** tab of
   Sensitive Data Protection.

   [Go to Configuration](https://console.cloud.google.com/security/sensitive-data-protection/landing/configuration;source=7)
2. Select the project that contains the inspection template that you want to
   delete.

3. On the **Configuration** tab, click the **Templates** subtab. The
   Google Cloud console displays a list of all templates for the current
   project.

4. In the **Actions** column for the template you want to delete, click the
   trigger actions menu ,
   click **Delete** , and then click **Confirm**.

## What's next

- Learn more about [creating and scheduling Sensitive Data Protection inspection
  jobs](https://docs.cloud.google.com/sensitive-data-protection/docs/creating-job-triggers).

- Learn more about [creating Sensitive Data Protection inspection templates](https://docs.cloud.google.com/sensitive-data-protection/docs/creating-templates-inspect.md.txt).

- Learn more about the [infoType detector reference](https://docs.cloud.google.com/sensitive-data-protection/docs/infotypes-reference.md.txt).

- Learn more about how Sensitive Data Protection matches your content using the
  [likelihood value](https://docs.cloud.google.com/sensitive-data-protection/docs/likelihood.md.txt).