# Cloud Build features

This page describes some optional configurations to build the
Cortex Framework Data Foundation with Cloud Build features,
such as building in a specific region
or using a private worker pool. These configurations offer significant benefits
in terms of data privacy, performance, security, and customization. The best
approach depends on your specific requirements and the nature of your application.

## Build in a specific region

Regional Building ensures that your data remains within a specific geographic
region. This can help you to comply with local data privacy regulation,
availability and latency reduction. For more information, see
[Cloud Build locations](https://docs.cloud.google.com/build/docs/locations).

To run the deployment through a specific [region](https://docs.cloud.google.com/build/docs/locations#selecting_the_region),
add the substitution parameter `_CLOUD_BUILD_REGION` with `--region` bash parameter,
as the following command:

    gcloud builds submit \
      --config=./cloudbuild.yaml \
      --substitutions=_GCS_BUCKET=BUCKET_FOR_LOGS,_CLOUD_BUILD_REGION=REGION \
      --region=REGION

Replace the following:

- `BUCKET_FOR_LOGS` with the bucket name for the logs.
- `REGION` with the region for your deployment. For more information about available regions, see [Geography and regions](https://docs.cloud.google.com/docs/geography-and-regions).

## Build with a private worker pool

Using a [private worker pool](https://docs.cloud.google.com/build/docs/private-pools/run-builds-in-private-pool)
provides a more secure environment for your builds.
Private pools are private, dedicated pools of workers that offer
customization over the build environment, including the ability to access
resources in a private network. For more information, see
[Private pools overview](https://docs.cloud.google.com/build/docs/private-pools/private-pools-overview).

To configure a private worker, add the `_WORKER_POOL_NAME` with corresponding
`_CLOUD_BUILD_REGION` parameter, as the following command:

    gcloud builds submit \
      --config=./cloudbuild.yaml
      --substitutions=_GCS_BUCKET=BUCKET_FOR_LOGS,_WORKER_POOL_NAME='projects/SOURCE_PROJECT/locations/us-central1/workerPools/YOUR_WORKER_POOL_NAME',_CLOUD_BUILD_REGION=REGION \
      --region=REGION

Replace the following:

- `BUCKET_FOR_LOGS` with the bucket name for the logs.
- `SOURCE_PROJECT` with the source project for Cortex Framework Data Foundation deployment.
- `YOUR_WORKER_POOL_NAME` with the name for your worker pool.
- `REGION` with the region for your deployment. For more information about available regions, see [Geography and regions](https://docs.cloud.google.com/docs/geography-and-regions).