Skip to content

Commit

Permalink
Add Code Repository Index resource (#12338) (#20474)
Browse files Browse the repository at this point in the history
[upstream:04174a883cf719344a49b5d8ddce33074f29dcf2]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Nov 25, 2024
1 parent 4707c7c commit 322ef90
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/12338.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_gemini_code_repository_index`
```
5 changes: 5 additions & 0 deletions .teamcity/components/inputs/services_beta.kt
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,11 @@ var ServicesListBeta = mapOf(
"displayName" to "Firestore",
"path" to "./google-beta/services/firestore"
),
"gemini" to mapOf(
"name" to "gemini",
"displayName" to "Gemini",
"path" to "./google-beta/services/gemini"
),
"gkebackup" to mapOf(
"name" to "gkebackup",
"displayName" to "Gkebackup",
Expand Down
5 changes: 5 additions & 0 deletions .teamcity/components/inputs/services_ga.kt
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ var ServicesListGa = mapOf(
"displayName" to "Firestore",
"path" to "./google/services/firestore"
),
"gemini" to mapOf(
"name" to "gemini",
"displayName" to "Gemini",
"path" to "./google/services/gemini"
),
"gkebackup" to mapOf(
"name" to "gkebackup",
"displayName" to "Gkebackup",
Expand Down
2 changes: 1 addition & 1 deletion google/acctest/bootstrap_test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ func NewServiceNetworkSettings(options ...func(*ServiceNetworkSettings)) *Servic
// must be deleted first. After the service instances are deleted, some service producers delay the deletion
// utnil a waiting period has passed. For example, after four days that you delete a SQL instance,
// the service networking connection can be deleted.
// That is the reason to use the shared service networking connection for thest resources.
// That is the reason to use the shared service networking connection for test resources.
// https://cloud.google.com/vpc/docs/configure-private-services-access#removing-connection
//
// testId specifies the test for which a shared network and a gobal address are used/initialized.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package gemini_test
142 changes: 142 additions & 0 deletions website/docs/r/gemini_code_repository_index.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
# ----------------------------------------------------------------------------
#
# *** 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: "Gemini for Google Cloud"
description: |-
The resource for managing Code Repository Index for Gemini Code Assist.
---

# google_gemini_code_repository_index

The resource for managing Code Repository Index for Gemini Code Assist.

~> **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.


## Example Usage - Gemini Code Repository Index Basic


```hcl
resource "google_gemini_code_repository_index" "example" {
provider = google-beta
location = "us-central1"
code_repository_index_id = ""
kms_key = "projects/projectExample/locations/locationExample/keyRings/keyRingExample/cryptoKeys/cryptoKeyExample"
}
```

## Argument Reference

The following arguments are supported:


* `location` -
(Required)
The location of the Code Repository Index, for example `us-central1`.

* `code_repository_index_id` -
(Required)
Required. Id of the Code Repository Index.


- - -


* `labels` -
(Optional)
Optional. Labels as key value pairs.
**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.

* `kms_key` -
(Optional)
Optional. Immutable. Customer-managed encryption key name, in the format
projects/*/locations/*/keyRings/*/cryptoKeys/*.

* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.


## 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}}/codeRepositoryIndexes/{{code_repository_index_id}}`

* `update_time` -
Output only. Update time stamp.

* `state` -
Output only. Code Repository Index instance State.
Possible values:
STATE_UNSPECIFIED
CREATING
ACTIVE
DELETING
SUSPENDED

* `name` -
Immutable. Identifier. Name of Code Repository Index.

* `create_time` -
Output only. Create time stamp.

* `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 90 minutes.
- `update` - Default is 90 minutes.
- `delete` - Default is 90 minutes.

## Import


CodeRepositoryIndex can be imported using any of these accepted formats:

* `projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index_id}}`
* `{{project}}/{{location}}/{{code_repository_index_id}}`
* `{{location}}/{{code_repository_index_id}}`


In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import CodeRepositoryIndex using one of the formats above. For example:

```tf
import {
id = "projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index_id}}"
to = google_gemini_code_repository_index.default
}
```

When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), CodeRepositoryIndex can be imported using one of the formats above. For example:

```
$ terraform import google_gemini_code_repository_index.default projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index_id}}
$ terraform import google_gemini_code_repository_index.default {{project}}/{{location}}/{{code_repository_index_id}}
$ terraform import google_gemini_code_repository_index.default {{location}}/{{code_repository_index_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).

0 comments on commit 322ef90

Please sign in to comment.