Skip to content

Commit 322ef90

Browse files
Add Code Repository Index resource (#12338) (#20474)
[upstream:04174a883cf719344a49b5d8ddce33074f29dcf2] Signed-off-by: Modular Magician <[email protected]>
1 parent 4707c7c commit 322ef90

File tree

6 files changed

+159
-1
lines changed

6 files changed

+159
-1
lines changed

.changelog/12338.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
`google_gemini_code_repository_index`
3+
```

.teamcity/components/inputs/services_beta.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,11 @@ var ServicesListBeta = mapOf(
416416
"displayName" to "Firestore",
417417
"path" to "./google-beta/services/firestore"
418418
),
419+
"gemini" to mapOf(
420+
"name" to "gemini",
421+
"displayName" to "Gemini",
422+
"path" to "./google-beta/services/gemini"
423+
),
419424
"gkebackup" to mapOf(
420425
"name" to "gkebackup",
421426
"displayName" to "Gkebackup",

.teamcity/components/inputs/services_ga.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,11 @@ var ServicesListGa = mapOf(
411411
"displayName" to "Firestore",
412412
"path" to "./google/services/firestore"
413413
),
414+
"gemini" to mapOf(
415+
"name" to "gemini",
416+
"displayName" to "Gemini",
417+
"path" to "./google/services/gemini"
418+
),
414419
"gkebackup" to mapOf(
415420
"name" to "gkebackup",
416421
"displayName" to "Gkebackup",

google/acctest/bootstrap_test_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ func NewServiceNetworkSettings(options ...func(*ServiceNetworkSettings)) *Servic
503503
// must be deleted first. After the service instances are deleted, some service producers delay the deletion
504504
// utnil a waiting period has passed. For example, after four days that you delete a SQL instance,
505505
// the service networking connection can be deleted.
506-
// That is the reason to use the shared service networking connection for thest resources.
506+
// That is the reason to use the shared service networking connection for test resources.
507507
// https://cloud.google.com/vpc/docs/configure-private-services-access#removing-connection
508508
//
509509
// testId specifies the test for which a shared network and a gobal address are used/initialized.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Copyright (c) HashiCorp, Inc.
2+
// SPDX-License-Identifier: MPL-2.0
3+
package gemini_test
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
# ----------------------------------------------------------------------------
3+
#
4+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
5+
#
6+
# ----------------------------------------------------------------------------
7+
#
8+
# This file is automatically generated by Magic Modules and manual
9+
# changes will be clobbered when the file is regenerated.
10+
#
11+
# Please read more about how to change this file in
12+
# .github/CONTRIBUTING.md.
13+
#
14+
# ----------------------------------------------------------------------------
15+
subcategory: "Gemini for Google Cloud"
16+
description: |-
17+
The resource for managing Code Repository Index for Gemini Code Assist.
18+
---
19+
20+
# google_gemini_code_repository_index
21+
22+
The resource for managing Code Repository Index for Gemini Code Assist.
23+
24+
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
25+
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
26+
27+
28+
## Example Usage - Gemini Code Repository Index Basic
29+
30+
31+
```hcl
32+
resource "google_gemini_code_repository_index" "example" {
33+
provider = google-beta
34+
location = "us-central1"
35+
code_repository_index_id = ""
36+
kms_key = "projects/projectExample/locations/locationExample/keyRings/keyRingExample/cryptoKeys/cryptoKeyExample"
37+
}
38+
```
39+
40+
## Argument Reference
41+
42+
The following arguments are supported:
43+
44+
45+
* `location` -
46+
(Required)
47+
The location of the Code Repository Index, for example `us-central1`.
48+
49+
* `code_repository_index_id` -
50+
(Required)
51+
Required. Id of the Code Repository Index.
52+
53+
54+
- - -
55+
56+
57+
* `labels` -
58+
(Optional)
59+
Optional. Labels as key value pairs.
60+
**Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
61+
Please refer to the field `effective_labels` for all of the labels present on the resource.
62+
63+
* `kms_key` -
64+
(Optional)
65+
Optional. Immutable. Customer-managed encryption key name, in the format
66+
projects/*/locations/*/keyRings/*/cryptoKeys/*.
67+
68+
* `project` - (Optional) The ID of the project in which the resource belongs.
69+
If it is not provided, the provider project is used.
70+
71+
72+
## Attributes Reference
73+
74+
In addition to the arguments listed above, the following computed attributes are exported:
75+
76+
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index_id}}`
77+
78+
* `update_time` -
79+
Output only. Update time stamp.
80+
81+
* `state` -
82+
Output only. Code Repository Index instance State.
83+
Possible values:
84+
STATE_UNSPECIFIED
85+
CREATING
86+
ACTIVE
87+
DELETING
88+
SUSPENDED
89+
90+
* `name` -
91+
Immutable. Identifier. Name of Code Repository Index.
92+
93+
* `create_time` -
94+
Output only. Create time stamp.
95+
96+
* `terraform_labels` -
97+
The combination of labels configured directly on the resource
98+
and default labels configured on the provider.
99+
100+
* `effective_labels` -
101+
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
102+
103+
104+
## Timeouts
105+
106+
This resource provides the following
107+
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
108+
109+
- `create` - Default is 90 minutes.
110+
- `update` - Default is 90 minutes.
111+
- `delete` - Default is 90 minutes.
112+
113+
## Import
114+
115+
116+
CodeRepositoryIndex can be imported using any of these accepted formats:
117+
118+
* `projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index_id}}`
119+
* `{{project}}/{{location}}/{{code_repository_index_id}}`
120+
* `{{location}}/{{code_repository_index_id}}`
121+
122+
123+
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:
124+
125+
```tf
126+
import {
127+
id = "projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index_id}}"
128+
to = google_gemini_code_repository_index.default
129+
}
130+
```
131+
132+
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:
133+
134+
```
135+
$ terraform import google_gemini_code_repository_index.default projects/{{project}}/locations/{{location}}/codeRepositoryIndexes/{{code_repository_index_id}}
136+
$ terraform import google_gemini_code_repository_index.default {{project}}/{{location}}/{{code_repository_index_id}}
137+
$ terraform import google_gemini_code_repository_index.default {{location}}/{{code_repository_index_id}}
138+
```
139+
140+
## User Project Overrides
141+
142+
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).

0 commit comments

Comments
 (0)