---
title: "POST /v1/{+parent}/targets"
method: POST
path: "/v1/{+parent}/targets"
tags: ["projects"]
---

# POST /v1/{+parent}/targets

`POST /v1/{+parent}/targets`

Creates a new Target in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `requestId` string
- `targetId` string
- `validateOnly` boolean

## Request body

- Target — A `Target` resource in the Cloud Deploy API. A `Target` defines a location to which a Skaffold configuration can be deployed.
  - `deployParameters` object — Optional. The deploy parameters to use for this target.
  - `uid` string — Output only. Unique identifier of the `Target`.
  - `etag` string — Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
  - `gke` GkeCluster — Information specifying a GKE Cluster.
    - `cluster` string — Optional. Information specifying a GKE Cluster. Format is `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`.
    - `internalIp` boolean — Optional. If true, `cluster` is accessed using the private IP address of the control plane endpoint. Otherwise, the default IP address of the control plane endpoint is used. The default IP address is the private IP address for clusters with private control-plane endpoints and the public IP address otherwise. Only specify this option when `cluster` is a [private GKE cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept). Note that `internal_ip` and `dns_endpoint` cannot both be set to true.
    - `dnsEndpoint` boolean — Optional. If set, the cluster will be accessed using the DNS endpoint. Note that both `dns_endpoint` and `internal_ip` cannot be set to true.
    - `proxyUrl` string — Optional. If set, used to configure a [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy) to the Kubernetes server.
  - `anthosCluster` AnthosCluster — Information specifying an Anthos Cluster.
    - `membership` string — Optional. Membership of the GKE Hub-registered cluster to which to apply the Skaffold configuration. Format is `projects/{project}/locations/{location}/memberships/{membership_name}`.
  - `name` string — Identifier. Name of the `Target`. Format is `projects/{project}/locations/{location}/targets/{target}`. The `target` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
  - `annotations` object — Optional. User annotations. These attributes can only be set and used by the user, and not by Cloud Deploy. See https://google.aip.dev/128#annotations for more details such as format and size limitations.
  - `createTime` string, google-datetime — Output only. Time at which the `Target` was created.
  - `run` CloudRunLocation — Information specifying where to deploy a Cloud Run Service.
    - `location` string — Required. The location for the Cloud Run Service. Format must be `projects/{project}/locations/{location}`.
  - `labels` object — Optional. Labels are attributes that can be set and used by both the user and by Cloud Deploy. Labels must meet the following constraints: * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. * All characters must use UTF-8 encoding, and international characters are allowed. * Keys must start with a lowercase letter or international character. * Each resource is limited to a maximum of 64 labels. Both keys and values are additionally constrained to be <= 128 bytes.
  - `associatedEntities` object — Optional. Map of entity IDs to their associated entities. Associated entities allows specifying places other than the deployment target for specific features. For example, the Gateway API canary can be configured to deploy the HTTPRoute to a different cluster(s) than the deployment cluster using associated entities. An entity ID must consist of lower-case letters, numbers, and hyphens, start with a letter and end with a letter or a number, and have a max length of 63 characters. In other words, it must match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
  - `description` string — Optional. Description of the `Target`. Max length is 255 characters.
  - `targetId` string — Output only. Resource id of the `Target`.
  - `multiTarget` MultiTarget — Information specifying a multiTarget.
    - `targetIds` string[] — Required. The target_ids of this multiTarget.
  - `customTarget` CustomTarget — Information specifying a Custom Target.
    - `customTargetType` string — Required. The name of the CustomTargetType. Format must be `projects/{project}/locations/{location}/customTargetTypes/{custom_target_type}`.
  - `updateTime` string, google-datetime — Output only. Most recent time at which the `Target` was updated.
  - `executionConfigs` ExecutionConfig[] — Optional. Configurations for all execution that relates to this `Target`. Each `ExecutionEnvironmentUsage` value may only be used in a single configuration; using the same value multiple times is an error. When one or more configurations are specified, they must include the `RENDER` and `DEPLOY` `ExecutionEnvironmentUsage` values. When no configurations are specified, execution will use the default specified in `DefaultPool`.
    - `serviceAccount` string — Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) is used.
    - `verbose` boolean — Optional. If true, additional logging will be enabled when running builds in this execution environment.
    - `defaultPool` DefaultPool — Execution using the default Cloud Build pool.
      - `serviceAccount` string — Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) will be used.
      - `artifactStorage` string — Optional. Cloud Storage location where execution outputs should be stored. This can either be a bucket ("gs://my-bucket") or a path within a bucket ("gs://my-bucket/my-dir"). If unspecified, a default bucket located in the same region will be used.
    - `privatePool` PrivatePool — Execution using a private Cloud Build pool.
      - `workerPool` string — Required. Resource name of the Cloud Build worker pool to use. The format is `projects/{project}/locations/{location}/workerPools/{pool}`.
      - `serviceAccount` string — Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) will be used.
      - `artifactStorage` string — Optional. Cloud Storage location where execution outputs should be stored. This can either be a bucket ("gs://my-bucket") or a path within a bucket ("gs://my-bucket/my-dir"). If unspecified, a default bucket located in the same region will be used.
    - `executionTimeout` string, google-duration — Optional. Execution timeout for a Cloud Build Execution. This must be between 10m and 24h in seconds format. If unspecified, a default timeout of 1h is used.
    - `workerPool` string — Optional. The resource name of the `WorkerPool`, with the format `projects/{project}/locations/{location}/workerPools/{worker_pool}`. If this optional field is unspecified, the default Cloud Build pool will be used.
    - `artifactStorage` string — Optional. Cloud Storage location in which to store execution outputs. This can either be a bucket ("gs://my-bucket") or a path within a bucket ("gs://my-bucket/my-dir"). If unspecified, a default bucket located in the same region will be used.
    - `usages` string[] — Required. Usages when this configuration should be applied.
  - `requireApproval` boolean — Optional. Whether or not the `Target` requires approval.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/clouddeploy.md) · [All operations](https://skmtc.net/google/apis/clouddeploy/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/clouddeploy/versions/a8819765974a/schema)
