google_clouddeploy_target

The Cloud Deploy Target resource

Example Usage - multi_target

tests creating and updating a multi-target

resource "google_clouddeploy_target" "primary" {
  location          = "us-west1"
  name              = "target"
  deploy_parameters = {}
  description       = "multi-target description"

  execution_configs {
    usages            = ["RENDER", "DEPLOY"]
    execution_timeout = "3600s"
  }

  multi_target {
    target_ids = ["1", "2"]
  }

  project          = "my-project-name"
  require_approval = false

  annotations = {
    my_first_annotation = "example-annotation-1"

    my_second_annotation = "example-annotation-2"
  }

  labels = {
    my_first_label = "example-label-1"

    my_second_label = "example-label-2"
  }
  provider          = google-beta
}

Example Usage - run_target

tests creating and updating a cloud run target

resource "google_clouddeploy_target" "primary" {
  location          = "us-west1"
  name              = "target"
  deploy_parameters = {}
  description       = "basic description"

  execution_configs {
    usages            = ["RENDER", "DEPLOY"]
    execution_timeout = "3600s"
  }

  project          = "my-project-name"
  require_approval = false

  run {
    location = "projects/my-project-name/locations/us-west1"
  }

  annotations = {
    my_first_annotation = "example-annotation-1"

    my_second_annotation = "example-annotation-2"
  }

  labels = {
    my_first_label = "example-label-1"

    my_second_label = "example-label-2"
  }
  provider          = google-beta
}

Example Usage - target

Creates a basic Cloud Deploy target

resource "google_clouddeploy_target" "primary" {
  location = "us-west1"
  name     = "target"

  deploy_parameters = {
    deployParameterKey = "deployParameterValue"
  }

  description = "basic description"

  gke {
    cluster = "projects/my-project-name/locations/us-west1/clusters/example-cluster-name"
  }

  project          = "my-project-name"
  require_approval = false

  annotations = {
    my_first_annotation = "example-annotation-1"

    my_second_annotation = "example-annotation-2"
  }

  labels = {
    my_first_label = "example-label-1"

    my_second_label = "example-label-2"
  }
}

Argument Reference

The following arguments are supported:


Note: This field is non-authoritative, and will only manage the annotations present in your configuration. Please refer to the field effective_annotations for all of the annotations present on the resource.

Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

The anthos_cluster block supports:

The execution_configs block supports:

The gke block supports:

The multi_target block supports:

The run block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Target can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Target using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{location}}/targets/{{name}}"
  to = google_clouddeploy_target.default
}

When using the terraform import command, Target can be imported using one of the formats above. For example:

$ terraform import google_clouddeploy_target.default projects/{{project}}/locations/{{location}}/targets/{{name}}
$ terraform import google_clouddeploy_target.default {{project}}/{{location}}/{{name}}
$ terraform import google_clouddeploy_target.default {{location}}/{{name}}