A Cloud Deploy CustomTargetType
defines a type of custom target that can be referenced in a
Cloud Deploy Target
in order to facilitate deploying to other systems besides the supported runtimes.
To get more information about CustomTargetType, see:
resource "google_clouddeploy_custom_target_type" "custom-target-type" {
location = "us-central1"
name = "my-custom-target-type"
description = "My custom target type"
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"
}
custom_actions {
render_action = "renderAction"
deploy_action = "deployAction"
}
}
resource "google_clouddeploy_custom_target_type" "custom-target-type" {
location = "us-central1"
name = "my-custom-target-type"
description = "My custom target type"
custom_actions {
render_action = "renderAction"
deploy_action = "deployAction"
include_skaffold_modules {
configs = ["my-config"]
git {
repo = "http://github.com/example/example-repo.git"
path = "configs/skaffold.yaml"
ref = "main"
}
}
}
}
resource "google_clouddeploy_custom_target_type" "custom-target-type" {
location = "us-central1"
name = "my-custom-target-type"
description = "My custom target type"
custom_actions {
render_action = "renderAction"
deploy_action = "deployAction"
include_skaffold_modules {
configs = ["my-config"]
google_cloud_storage {
source = "gs://example-bucket/dir/configs/*"
path = "skaffold.yaml"
}
}
}
}
The following arguments are supported:
name
-
(Required)
Name of the CustomTargetType
.
location
-
(Required)
The location of the source.
description
-
(Optional)
Description of the CustomTargetType
. Max length is 255 characters.
annotations
-
(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.
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.
labels
-
(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.
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.
custom_actions
-
(Optional)
Configures render and deploy for the CustomTargetType
using Skaffold custom actions.
Structure is documented below.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
The custom_actions
block supports:
render_action
-
(Optional)
The Skaffold custom action responsible for render operations. If not provided then Cloud Deploy will perform the render operations via skaffold render
.
deploy_action
-
(Required)
The Skaffold custom action responsible for deploy operations.
include_skaffold_modules
-
(Optional)
List of Skaffold modules Cloud Deploy will include in the Skaffold Config as required before performing diagnose.
Structure is documented below.
The include_skaffold_modules
block supports:
configs
-
(Optional)
The Skaffold Config modules to use from the specified source.
git
-
(Optional)
Remote git repository containing the Skaffold Config modules.
Structure is documented below.
google_cloud_storage
-
(Optional)
Cloud Storage bucket containing Skaffold Config modules.
Structure is documented below.
repo
-
(Required)
Git repository the package should be cloned from.
path
-
(Optional)
Relative path from the repository root to the Skaffold file.
ref
-
(Optional)
Git ref the package should be cloned from.
The google_cloud_storage
block supports:
source
-
(Required)
Cloud Storage source paths to copy recursively. For example, providing gs://my-bucket/dir/configs/*
will result in Skaffold copying all files within the dir/configs
directory in the bucket my-bucket
.
path
-
(Optional)
Relative path from the source to the Skaffold file.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/locations/{{location}}/customTargetTypes/{{name}}
custom_target_type_id
-
Resource id of the CustomTargetType
.
uid
-
Unique identifier of the CustomTargetType
.
create_time
-
Time at which the CustomTargetType
was created.
update_time
-
Time at which the CustomTargetType
was updated.
etag
-
The weak etag of the CustomTargetType
resource. 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.
effective_annotations
-
All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
terraform_labels
-
The combination of labels configured directly on the resource
and default labels configured on the provider.
effective_labels
-
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.CustomTargetType can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/customTargetTypes/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
In Terraform v1.5.0 and later, use an import
block to import CustomTargetType using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/customTargetTypes/{{name}}"
to = google_clouddeploy_custom_target_type.default
}
When using the terraform import
command, CustomTargetType can be imported using one of the formats above. For example:
$ terraform import google_clouddeploy_custom_target_type.default projects/{{project}}/locations/{{location}}/customTargetTypes/{{name}}
$ terraform import google_clouddeploy_custom_target_type.default {{project}}/{{location}}/{{name}}
$ terraform import google_clouddeploy_custom_target_type.default {{location}}/{{name}}
This resource supports User Project Overrides.