blob: 3c14629e47492b26c04ef5ee02c5e917601411a6 [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: "Secure Source Manager"
description: |-
Repositories store source code.
---
# google_secure_source_manager_repository
Repositories store source code. It supports all Git SCM client commands and has built-in pull requests and issue tracking. Both HTTPS and SSH authentication are supported.
To get more information about Repository, see:
* How-to Guides
* [Official Documentation](https://cloud.google.com/secure-source-manager/docs/overview)
<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_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=secure_source_manager_repository_basic&open_in_editor=main.tf" 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 - Secure Source Manager Repository Basic
```hcl
resource "google_secure_source_manager_instance" "instance" {
location = "us-central1"
instance_id = "my-instance"
}
resource "google_secure_source_manager_repository" "default" {
location = "us-central1"
repository_id = "my-repository"
instance = google_secure_source_manager_instance.instance.name
}
```
<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_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=secure_source_manager_repository_initial_config&open_in_editor=main.tf" 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 - Secure Source Manager Repository Initial Config
```hcl
resource "google_secure_source_manager_instance" "instance" {
location = "us-central1"
instance_id = "my-instance"
}
resource "google_secure_source_manager_repository" "default" {
location = "us-central1"
repository_id = "my-repository"
instance = google_secure_source_manager_instance.instance.name
description = "This is a test repository"
initial_config {
default_branch = "main"
gitignores = ["python"]
license = "mit"
readme = "default"
}
}
```
## Argument Reference
The following arguments are supported:
* `instance` -
(Required)
The name of the instance in which the repository is hosted.
* `location` -
(Required)
The location for the Repository.
* `repository_id` -
(Required)
The ID for the Repository.
- - -
* `description` -
(Optional)
Description of the repository, which cannot exceed 500 characters.
* `initial_config` -
(Optional)
Initial configurations for the repository.
Structure is [documented below](#nested_initial_config).
* `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_initial_config"></a>The `initial_config` block supports:
* `default_branch` -
(Optional)
Default branch name of the repository.
* `gitignores` -
(Optional)
List of gitignore template names user can choose from.
Valid values can be viewed at https://cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories#initialconfig.
* `license` -
(Optional)
License template name user can choose from.
Valid values can be viewed at https://cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories#initialconfig.
* `readme` -
(Optional)
README template name.
Valid values can be viewed at https://cloud.google.com/secure-source-manager/docs/reference/rest/v1/projects.locations.repositories#initialconfig.
## 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/{{location}}/repositories/{{repository_id}}`
* `name` -
The resource name for the Repository.
* `uid` -
Unique identifier of the repository.
* `create_time` -
Time the repository was created in UTC.
* `update_time` -
Time the repository was updated in UTC.
* `uris` -
URIs for the repository.
Structure is [documented below](#nested_uris).
<a name="nested_uris"></a>The `uris` block contains:
* `html` -
(Output)
HTML is the URI for the user to view the repository in a browser.
* `git_https` -
(Output)
git_https is the git HTTPS URI for git operations.
* `api` -
(Output)
API is the URI for API access.
## 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.
- `delete` - Default is 20 minutes.
## Import
Repository can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/repositories/{{repository_id}}`
* `{{project}}/{{location}}/{{repository_id}}`
* `{{location}}/{{repository_id}}`
* `{{repository_id}}`
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/{{location}}/repositories/{{repository_id}}"
to = google_secure_source_manager_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_secure_source_manager_repository.default projects/{{project}}/locations/{{location}}/repositories/{{repository_id}}
$ terraform import google_secure_source_manager_repository.default {{project}}/{{location}}/{{repository_id}}
$ terraform import google_secure_source_manager_repository.default {{location}}/{{repository_id}}
$ terraform import google_secure_source_manager_repository.default {{repository_id}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).