2017-08-03 22:00:34 +00:00
|
|
|
---
|
|
|
|
layout: "google"
|
|
|
|
page_title: "Google: google_sourcerepo_repository"
|
|
|
|
sidebar_current: "docs-google-sourcerepo_repository"
|
|
|
|
description: |-
|
|
|
|
Manages repositories within Google Cloud Source Repositories.
|
|
|
|
---
|
|
|
|
|
|
|
|
# google\_sourcerepo\_repository
|
|
|
|
|
|
|
|
For more information, see [the official
|
2018-01-10 19:26:16 +00:00
|
|
|
documentation](https://cloud.google.com/source-repositories/) and
|
2017-08-03 22:00:34 +00:00
|
|
|
[API](https://cloud.google.com/source-repositories/docs/reference/rest/v1/projects.repos)
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
This example is the common case of creating a repository within Google Cloud Source Repositories:
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
resource "google_sourcerepo_repository" "frontend" {
|
|
|
|
name = "frontend"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `name` - (Required) The name of the repository that will be created.
|
|
|
|
|
|
|
|
- - -
|
|
|
|
|
2018-03-12 20:59:47 +00:00
|
|
|
* `project` - (Optional) The ID of the project in which the resource belongs. If it
|
2017-08-03 22:00:34 +00:00
|
|
|
is not provided, the provider project is used.
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
2018-01-10 19:26:16 +00:00
|
|
|
The following attributes are exported:
|
2017-08-03 22:00:34 +00:00
|
|
|
|
|
|
|
* `size` - The size of the repository.
|
2018-01-10 19:26:16 +00:00
|
|
|
* `url` - The url to clone the repository.
|
2019-01-03 00:52:31 +00:00
|
|
|
|
|
|
|
## Import
|
|
|
|
|
|
|
|
Google Cloud Source Repositories can be imported using any of these accepted formats:
|
|
|
|
|
|
|
|
```
|
2019-01-03 21:12:01 +00:00
|
|
|
$ terraform import google_sourcerepo_repository.default projects/{{project}}/repos/{{name}}
|
|
|
|
$ terraform import google_sourcerepo_repository.default {{project}}/{{name}}
|
2019-01-03 00:52:31 +00:00
|
|
|
$ terraform import google_sourcerepo_repository.default {{name}}
|
|
|
|
```
|