blob: 706d4d7581c1a9f99f72cd57dac3e656e5487fc1 [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Dataform"
description: |-
A resource represents a Dataform Git repository
---
# google\_dataform\_repository
A resource represents a Dataform Git repository
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
To get more information about Repository, see:
* [API documentation](https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories)
* How-to Guides
* [Official Documentation](https://cloud.google.com/dataform/docs/)
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=dataform_repository&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Dataform Repository
```hcl
resource "google_sourcerepo_repository" "git_repository" {
provider = google-beta
name = "my/repository"
}
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_respository" {
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 = google_sourcerepo_repository.git_repository.url
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_"
}
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=dataform_repository_ssh&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Dataform Repository Ssh
```hcl
resource "google_sourcerepo_repository" "git_repository" {
provider = google-beta
name = "my/repository"
}
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_respository" {
provider = google-beta
name = "dataform_repository"
git_remote_settings {
url = google_sourcerepo_repository.git_repository.url
default_branch = "main"
ssh_authentication_config {
user_private_key_secret_version = google_secret_manager_secret_version.secret_version.id
host_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU"
}
}
workspace_compilation_overrides {
default_database = "database"
schema_suffix = "_suffix"
table_prefix = "prefix_"
}
service_account = "1234567890-compute@developer.gserviceaccount.com"
}
```
## Argument Reference
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](#nested_git_remote_settings).
* `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](#nested_workspace_compilation_overrides).
* `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.
<a name="nested_git_remote_settings"></a>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](#nested_ssh_authentication_config).
* `token_status` -
(Output)
Indicates the status of the Git access token. https://cloud.google.com/dataform/reference/rest/v1beta1/projects.locations.repositories#TokenStatus
<a name="nested_ssh_authentication_config"></a>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.
<a name="nested_workspace_compilation_overrides"></a>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.
## Attributes Reference
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.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
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](https://developer.hashicorp.com/terraform/language/import) to import Repository using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{region}}/repositories/{{name}}"
to = google_dataform_repository.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).