A resource represents a Dataform Git repository
To get more information about Repository, see:
resource "google_secret_manager_secret" "secret" {
provider = google-beta
secret_id = "my-secret"
replication {
auto {}
}
}
resource "google_secret_manager_secret_version" "secret_version" {
provider = google-beta
secret = google_secret_manager_secret.secret.id
secret_data = "secret-data"
}
resource "google_dataform_repository" "dataform_repository" {
provider = google-beta
name = "dataform_repository"
display_name = "dataform_repository"
npmrc_environment_variables_secret_version = google_secret_manager_secret_version.secret_version.id
labels = {
label_foo1 = "label-bar1"
}
git_remote_settings {
url = "https://github.com/OWNER/REPOSITORY.git"
default_branch = "main"
authentication_token_secret_version = google_secret_manager_secret_version.secret_version.id
}
workspace_compilation_overrides {
default_database = "database"
schema_suffix = "_suffix"
table_prefix = "prefix_"
}
}
The following arguments are supported:
name
-
(Required)
The repository's name.git_remote_settings
-
(Optional)
Optional. If set, configures this repository to be linked to a Git remote.
Structure is documented below.
workspace_compilation_overrides
-
(Optional)
If set, fields of workspaceCompilationOverrides override the default compilation settings that are specified in dataform.json when creating workspace-scoped compilation results.
Structure is documented below.
service_account
-
(Optional)
The service account to run workflow invocations under.
npmrc_environment_variables_secret_version
-
(Optional)
Optional. The name of the Secret Manager secret version to be used to interpolate variables into the .npmrc file for package installation operations. Must be in the format projects//secrets//versions/*. The file itself must be in a JSON format.
display_name
-
(Optional)
Optional. The repository's user-friendly name.
labels
-
(Optional)
Optional. Repository user labels.
An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
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.
region
-
(Optional)
A reference to the region
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
The git_remote_settings
block supports:
url
-
(Required)
The Git remote's URL.
default_branch
-
(Required)
The Git remote's default branch name.
authentication_token_secret_version
-
(Optional)
The name of the Secret Manager secret version to use as an authentication token for Git operations. This secret is for assigning with HTTPS only(for SSH use ssh_authentication_config
). Must be in the format projects//secrets//versions/*.
ssh_authentication_config
-
(Optional)
Authentication fields for remote uris using SSH protocol.
Structure is documented below.
token_status
-
(Output)
Indicates the status of the Git access token. https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories#TokenStatus
The ssh_authentication_config
block supports:
user_private_key_secret_version
-
(Required)
The name of the Secret Manager secret version to use as a ssh private key for Git operations. Must be in the format projects//secrets//versions/*.
host_public_key
-
(Required)
Content of a public SSH key to verify an identity of a remote Git host.
The workspace_compilation_overrides
block supports:
default_database
-
(Optional)
The default database (Google Cloud project ID).
schema_suffix
-
(Optional)
The suffix that should be appended to all schema (BigQuery dataset ID) names.
table_prefix
-
(Optional)
The prefix that should be prepended to all table names.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/locations/{{region}}/repositories/{{name}}
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.Repository can be imported using any of these accepted formats:
projects/{{project}}/locations/{{region}}/repositories/{{name}}
{{project}}/{{region}}/{{name}}
{{region}}/{{name}}
{{name}}
In Terraform v1.5.0 and later, use an import
block to import Repository using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{region}}/repositories/{{name}}"
to = google_dataform_repository.default
}
When using the terraform import
command, Repository can be imported using one of the formats above. For example:
$ terraform import google_dataform_repository.default projects/{{project}}/locations/{{region}}/repositories/{{name}}
$ terraform import google_dataform_repository.default {{project}}/{{region}}/{{name}}
$ terraform import google_dataform_repository.default {{region}}/{{name}}
$ terraform import google_dataform_repository.default {{name}}
This resource supports User Project Overrides.