Cloud Run jobs let you run containerized, non-HTTP tasks, such as
scheduled batch processing and data transformations, that execute to completion
and exit. Application Design Center helps you configure these job components
for your specific component connections and configuration parameters. The
configuration parameters are listed in the
[terraform-google-cloud-run/modules/job-exec](https://github.com/GoogleCloudPlatform/terraform-google-cloud-run/tree/main/modules/job-exec)
Terraform module.

## Component connections

The following table includes the components that you can connect to a
Cloud Run job component, and the resulting updates to your
application and its generated Terraform code.

| Connected component | Application updates | Background information |
|---|---|---|
| [Service account](https://docs.cloud.google.com/application-design-center/docs/configure-service-account) | - The Cloud Run job uses the service account as a service identity. - The service account email is added to the Cloud Run job. | [Configure service identity for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/service-identity) |
| [Cloud SQL (MySQL)](https://docs.cloud.google.com/application-design-center/docs/configure-cloud-sql-mysql) | - The Cloud Run job can read and write data to the Cloud SQL (MySQL) instance. | [Connect from Cloud Run](https://docs.cloud.google.com/sql/docs/mysql/connect-run) |
| [Cloud SQL (PostgreSQL)](https://docs.cloud.google.com/application-design-center/docs/configure-cloud-sql-postgresql) | - The Cloud Run job can read and write data to the Cloud SQL (PostgreSQL) instance. | [Connect from Cloud Run](https://docs.cloud.google.com/sql/docs/postgres/connect-run) |
| [Cloud Storage](https://docs.cloud.google.com/application-design-center/docs/configure-cloud-storage) | - The Cloud Run job can communicate with the Cloud Storage bucket. - The Cloud Storage bucket name is added to the Cloud Run job. | [Connect to Google Cloud services](https://docs.cloud.google.com/run/docs/integrate/using-gcp-services) |

## Required configuration parameters

If your template includes a Cloud Run job, you must configure the
following parameters before you deploy.

| Parameter name | Description and constraints | Background information |
|---|---|---|
| **Project ID** | The project where you want to deploy the Cloud Run job. | [Configure components](https://docs.cloud.google.com/application-design-center/docs/design-application-templates#configure_components) |
| **Name** | [name](https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs#Job.FIELDS.name) | [Cloud Run services](https://docs.cloud.google.com/run/docs/resource-model#services) |
| **Region** | The Cloud Run service deployment location. | [Cloud Run locations](https://docs.cloud.google.com/run/docs/locations) |
| **Image** | [image](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#FIELDS.image) | [Deploying container images](https://docs.cloud.google.com/run/docs/deploying) |

## Optional configuration parameters

The following parameters are optional. To display advanced parameters, in the
**Configuration** area, select **Show advanced fields**.

| Feature | Parameter name | Description and constraint information | Background information |
|---|---|---|---|
|   | **Create Service Account** | Create a new service account for the Cloud Run job. | [Configure service identity for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/service-identity) |
|   | **Service Account Project Roles** | Roles to grant to the newly created service account. Enable **Create Service Account** and don't provide input for **Service Account**. | [Configure service identity for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/service-identity) |
|   | **Exec** | Whether to execute the job after it's created. | [Execute jobs](https://docs.cloud.google.com/run/docs/execute/jobs) |
|   | **Service Account Email** | [serviceAccount](https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs.executions.tasks#Task.FIELDS.service_account) | [Configure service identity for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/service-identity) |
|   | **Argument** | [args\[\]](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#FIELDS.args) | [Configure containers for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/containers) |
|   | **Container Command** | [command](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#FIELDS.command) | [Configure containers for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/containers) |
| Env Vars | **Name** | [name](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#EnvVar.FIELDS.name) | [Environment variables for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/environment-variables) |
| Env Vars | **Value** | [value](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#EnvVar.FIELDS.value) | [Environment variables for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/environment-variables) |
| Env Secret Vars | **Name** | [EnvVarSource](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#envvarsource) | [Configure secrets for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/secrets) |
| Env Secret Vars | **Secret** | [secret](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#SecretKeySelector.FIELDS.secret) | [Configure secrets for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/secrets) |
| Env Secret Vars | **Version** | [version](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#SecretKeySelector.FIELDS.version) | [Configure secrets for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/secrets) |
|   | **Launch Stage** | [LaunchStage](https://docs.cloud.google.com/run/docs/reference/rest/v2/LaunchStage) | [Product launch stages](https://docs.cloud.google.com/products#product-launch-stages) |
| Labels | **Key** | [labels](https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs#Job.FIELDS.labels) | [Configure labels for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/labels) |
| Labels | **Value** | [labels](https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs#Job.FIELDS.labels) | [Configure labels for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/labels) |
|   | **Max Retries** | [maxRetries](https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs.executions.tasks#Task.FIELDS.max_retries) | [Set maximum retries for jobs](https://docs.cloud.google.com/run/docs/configuring/max-retries) |
|   | **Parallelism** | [parallelism](https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs.executions#Execution.FIELDS.parallelism) | [Set parallelism for jobs](https://docs.cloud.google.com/run/docs/configuring/parallelism) |
|   | **Task Count** | [taskCount](https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs.executions#Execution.FIELDS.task_count) | [Override job configuration for a specific execution](https://docs.cloud.google.com/run/docs/execute/jobs#override-job-configuration) |
| Volumes | **Name** | [name](https://docs.cloud.google.com/run/docs/reference/rest/v2/Volume#FIELDS.name) | [Configure in-memory volume mounts for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/in-memory-volume-mounts) |
| Volumes | **Instances** | [instances\[\]](https://docs.cloud.google.com/run/docs/reference/rest/v2/Volume#cloudsqlinstance) | [Connect from Cloud Run](https://docs.cloud.google.com/sql/docs/mysql/connect-run#terraform) |
| Volumes | **Bucket** | [bucket](https://docs.cloud.google.com/run/docs/reference/rest/v2/Volume#GCSVolumeSource.FIELDS.bucket) | [Configure Cloud Storage volume mounts for services](https://docs.cloud.google.com/run/docs/configuring/jobs/cloud-storage-volume-mounts) |
| Volumes | **Read Only** | [readOnly](https://docs.cloud.google.com/run/docs/reference/rest/v2/Volume#GCSVolumeSource.FIELDS.read_only) | [Configure Cloud Storage volume mounts for services](https://docs.cloud.google.com/run/docs/configuring/jobs/cloud-storage-volume-mounts) |
| Volumes | **Mount Options** | [mountOptions\[\]](https://docs.cloud.google.com/run/docs/reference/rest/v2/Volume#GCSVolumeSource.FIELDS.mount_options) | [Configure Cloud Storage volume mounts for services](https://docs.cloud.google.com/run/docs/configuring/jobs/cloud-storage-volume-mounts) |
| Volume Mounts | **Name** | [name](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#VolumeMount.FIELDS.name) | [Connect from Cloud Run](https://docs.cloud.google.com/sql/docs/mysql/connect-run) |
| Volume Mounts | **Mount Path** | [mountPath](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#VolumeMount.FIELDS.mount_path) | [Connect from Cloud Run](https://docs.cloud.google.com/sql/docs/mysql/connect-run) |
| Vpc Access | **Connector** | [connector](https://docs.cloud.google.com/run/docs/reference/rest/v2/VpcAccess#FIELDS.connector) | [VPC with connectors](https://docs.cloud.google.com/run/docs/configuring/vpc-connectors) |
| Vpc Access | **Egress** | [egress](https://docs.cloud.google.com/run/docs/reference/rest/v2/VpcAccess#FIELDS.egress) | [Control egress service traffic](https://docs.cloud.google.com/run/docs/configuring/vpc-connectors#egress-service) |
| Limits | **Cpu** | [limits](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#ResourceRequirements.FIELDS.limits) | [Configure CPU limits for jobs](https://docs.cloud.google.com/run/docs/configuring/jobs/cpu) |
| Limits | **Memory** | [limits](https://docs.cloud.google.com/run/docs/reference/rest/v2/Container#ResourceRequirements.FIELDS.limits) | [Configure memory limits for services](https://docs.cloud.google.com/run/docs/configuring/jobs/memory-limits) |
|   | **Timeout** | [timeout](https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs.executions.tasks#Task.FIELDS.timeout) | [Set task timeout for jobs](https://docs.cloud.google.com/run/docs/configuring/task-timeout) |
|   | **Cloud Run Deletion Protection** | Prevents Terraform from destroying or recreating Cloud Run jobs and services. | [deletion_protection](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_job#deletion_protection-1) |