googleClouddeployTarget
The Cloud Deploy target
resource
Example Usage - multi_target
tests creating and updating a multi-target
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.clouddeployTarget.ClouddeployTarget(this, "primary", {
annotations: [
{
my_first_annotation: "example-annotation-1",
my_second_annotation: "example-annotation-2",
},
],
description: "multi-target description",
execution_configs: [
{
execution_timeout: "3600s",
usages: ["RENDER", "DEPLOY"],
},
],
labels: [
{
my_first_label: "example-label-1",
my_second_label: "example-label-2",
},
],
location: "us-west1",
multi_target: [
{
target_ids: ["1", "2"],
},
],
name: "target",
project: "my-project-name",
provider: "${google-beta}",
require_approval: false,
});
Example Usage - run_target
tests creating and updating a cloud run target
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.clouddeployTarget.ClouddeployTarget(this, "primary", {
annotations: [
{
my_first_annotation: "example-annotation-1",
my_second_annotation: "example-annotation-2",
},
],
description: "basic description",
execution_configs: [
{
execution_timeout: "3600s",
usages: ["RENDER", "DEPLOY"],
},
],
labels: [
{
my_first_label: "example-label-1",
my_second_label: "example-label-2",
},
],
location: "us-west1",
name: "target",
project: "my-project-name",
provider: "${google-beta}",
require_approval: false,
run: [
{
location: "projects/my-project-name/locations/us-west1",
},
],
});
Example Usage - target
Creates a basic Cloud Deploy target
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.clouddeployTarget.ClouddeployTarget(this, "primary", {
annotations: [
{
my_first_annotation: "example-annotation-1",
my_second_annotation: "example-annotation-2",
},
],
description: "basic description",
gke: [
{
cluster:
"projects/my-project-name/locations/us-west1/clusters/example-cluster-name",
},
],
labels: [
{
my_first_label: "example-label-1",
my_second_label: "example-label-2",
},
],
location: "us-west1",
name: "target",
project: "my-project-name",
require_approval: false,
});
Argument Reference
The following arguments are supported:
-
location
- (Required) The location for the resource -
name
- (Required) Name of thetarget
. Format is [a-z][a-z0-9-]{0,62}.
-
annotations
- (Optional) Optional. User annotations. These attributes can only be set and used by the user, and not by Google Cloud Deploy. See https://google.aip.dev/128#annotations for more details such as format and size limitations. -
anthosCluster
- (Optional) Information specifying an Anthos Cluster. -
description
- (Optional) Optional. Description of thetarget
. Max length is 255 characters. -
executionConfigs
- (Optional) Configurations for all execution that relates to thistarget
. EachexecutionEnvironmentUsage
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 therender
anddeploy
executionEnvironmentUsage
values. When no configurations are specified, execution will use the default specified indefaultPool
. -
gke
- (Optional) Information specifying a GKE Cluster. -
labels
- (Optional) Optional. Labels are attributes that can be set and used by both the user and by Google 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. -
multiTarget
- (Optional) (Beta only) Information specifying a multiTarget. -
project
- (Optional) The project for the resource -
requireApproval
- (Optional) Optional. Whether or not thetarget
requires approval. -
run
- (Optional) (Beta only) Information specifying a Cloud Run deployment target.
The anthosCluster
block supports:
membership
- (Optional) Membership of the GKE Hub-registered cluster to which to apply the Skaffold configuration. Format isprojects/{project}/locations/{location}/memberships/{membershipName}
.
The executionConfigs
block supports:
-
artifactStorage
- (Optional) 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. -
executionTimeout
- (Optional) 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. -
serviceAccount
- (Optional) Optional. Google service account to use for execution. If unspecified, the project execution service account (-compute@developer.gserviceaccount.com) is used. -
usages
- (Required) Required. Usages when this configuration should be applied. -
workerPool
- (Optional) Optional. The resource name of theworkerPool
, with the formatprojects/{project}/locations/{location}/workerPools/{workerPool}
. If this optional field is unspecified, the default Cloud Build pool will be used.
The gke
block supports:
-
cluster
- (Optional) Information specifying a GKE Cluster. Format is `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. -
internalIp
- (Optional) 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 whencluster
is a private GKE cluster.
The multiTarget
block supports:
targetIds
- (Required) Required. The target_ids of this multiTarget.
The run
block supports:
location
- (Required) Required. The location where the Cloud Run Service should be located. Format isprojects/{project}/locations/{location}
.
Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
-
id
- an identifier for the resource with formatprojects/{{project}}/locations/{{location}}/targets/{{name}}
-
createTime
- Output only. Time at which thetarget
was created. -
etag
- 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. -
targetId
- Output only. Resource id of thetarget
. -
uid
- Output only. Unique identifier of thetarget
. -
updateTime
- Output only. Most recent time at which thetarget
was updated.
Timeouts
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.
Import
Target can be imported using any of these accepted formats: