Configure your project's metadata store

Vertex ML Metadata lets you track and analyze the metadata produced by your machine learning (ML) workflows. The first time that you use Vertex ML Metadata in a Google Cloud project, Vertex AI creates your project's MetadataStore.

If you want your metadata encrypted using a customer-managed encryption key (CMEK), you must create your metadata store using a CMEK before you use Vertex ML Metadata to track or analyze metadata.

After the metadata store has been created, the CMEK key that the metadata store uses is independent of the CMEK key used by processes that log metadata, such as a pipeline run.

Create a metadata store that uses a CMEK

Use the following instructions to create a CMEK and set up a Vertex ML Metadata metadata store that uses this CMEK.

  1. Use Cloud Key Management Service to configure a customer-managed encryption key.

  2. Use the following REST call to create your project's default metadata store using your CMEK.

    Before using any of the request data, make the following replacements:

    • LOCATION: Your region.
    • PROJECT: Your project ID or project number.
    • KEY_RING: The name of the Cloud Key Management Service key ring that your encryption key is on.
    • KEY_NAME: The name of the encryption key that you want to use for this metadata store.

    HTTP method and URL:

    POST https://LOCATION-aiplatform.googleapis.com/v1beta1/projects/PROJECT/locations/LOCATION/metadataStores?metadata_store_id=default

    Request JSON body:

    {
      "encryption_spec": {
        "kms_key_name": "projects/PROJECT/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"
      },
    }
    

    To send your request, expand one of these options:

    You should receive a JSON response similar to the following:

    {
      "name": "projects/12345/locations/us-central1/operations/67890",
      "metadata": {
        "@type": "type.googleapis.com/google.cloud.aiplatform.v1beta1.CreateMetadataStoreOperationMetadata",
        "genericMetadata": {
          "createTime": "2021-05-18T18:47:14.494997Z",
          "updateTime": "2021-05-18T18:47:14.494997Z"
        }
      }
    }