Skip to content

Commit 4132d82

Browse files
Add support for parameter manager regional parameter resource google_parameter_manager_regional_parameter (#12631) (#20858)
[upstream:555fb5cec1b94b82742918067cfc408383259b3f] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 4bbc44e commit 4132d82

File tree

5 files changed

+223
-0
lines changed

5 files changed

+223
-0
lines changed

.changelog/12631.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_parameter_manager_regional_parameter`
3+
```

.teamcity/components/inputs/services_beta.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,11 @@ var ServicesListBeta = mapOf(
591591
"displayName" to "Parallelstore",
592592
"path" to "./google/services/parallelstore"
593593
),
594+
"parametermanagerregional" to mapOf(
595+
"name" to "parametermanagerregional",
596+
"displayName" to "Parametermanagerregional",
597+
"path" to "./google-beta/services/parametermanagerregional"
598+
),
594599
"privateca" to mapOf(
595600
"name" to "privateca",
596601
"displayName" to "Privateca",

.teamcity/components/inputs/services_ga.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,11 @@ var ServicesListGa = mapOf(
586586
"displayName" to "Parallelstore",
587587
"path" to "./google/services/parallelstore"
588588
),
589+
"parametermanagerregional" to mapOf(
590+
"name" to "parametermanagerregional",
591+
"displayName" to "Parametermanagerregional",
592+
"path" to "./google/services/parametermanagerregional"
593+
),
589594
"privateca" to mapOf(
590595
"name" to "privateca",
591596
"displayName" to "Privateca",
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 parametermanagerregional_test
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
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: "Parameter Manager"
16+
description: |-
17+
A Regional Parameter is a logical regional parameter.
18+
---
19+
20+
# google_parameter_manager_regional_parameter
21+
22+
A Regional Parameter is a logical regional parameter.
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+
To get more information about RegionalParameter, see:
28+
29+
* [API documentation](https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters)
30+
31+
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
32+
<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=regional_parameter_basic&open_in_editor=main.tf" target="_blank">
33+
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
34+
</a>
35+
</div>
36+
## Example Usage - Regional Parameter Basic
37+
38+
39+
```hcl
40+
resource "google_parameter_manager_regional_parameter" "regional-parameter-basic" {
41+
provider = google-beta
42+
parameter_id = "regional_parameter"
43+
location = "us-central1"
44+
}
45+
```
46+
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
47+
<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=regional_parameter_with_format&open_in_editor=main.tf" target="_blank">
48+
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
49+
</a>
50+
</div>
51+
## Example Usage - Regional Parameter With Format
52+
53+
54+
```hcl
55+
resource "google_parameter_manager_regional_parameter" "regional-parameter-with-format" {
56+
provider = google-beta
57+
parameter_id = "regional_parameter"
58+
location = "us-central1"
59+
format = "JSON"
60+
}
61+
```
62+
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
63+
<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=regional_parameter_with_labels&open_in_editor=main.tf" target="_blank">
64+
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
65+
</a>
66+
</div>
67+
## Example Usage - Regional Parameter With Labels
68+
69+
70+
```hcl
71+
resource "google_parameter_manager_regional_parameter" "regional-parameter-with-labels" {
72+
provider = google-beta
73+
parameter_id = "regional_parameter"
74+
location = "us-central1"
75+
76+
labels = {
77+
key1 = "val1"
78+
key2 = "val2"
79+
key3 = "val3"
80+
key4 = "val4"
81+
key5 = "val5"
82+
}
83+
}
84+
```
85+
86+
## Argument Reference
87+
88+
The following arguments are supported:
89+
90+
91+
* `location` -
92+
(Required)
93+
The location of the regional parameter. eg us-central1
94+
95+
* `parameter_id` -
96+
(Required)
97+
This must be unique within the project.
98+
99+
100+
- - -
101+
102+
103+
* `labels` -
104+
(Optional)
105+
The labels assigned to this regional Parameter.
106+
Label keys must be between 1 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes,
107+
and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}
108+
Label values must be between 0 and 63 characters long, have a UTF-8 encoding of maximum 128 bytes,
109+
and must conform to the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}
110+
No more than 64 labels can be assigned to a given resource.
111+
An object containing a list of "key": value pairs. Example:
112+
{ "name": "wrench", "mass": "1.3kg", "count": "3" }.
113+
114+
**Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
115+
Please refer to the field `effective_labels` for all of the labels present on the resource.
116+
117+
* `format` -
118+
(Optional)
119+
The format type of the regional parameter. Default value is UNFORMATTED.
120+
Possible values are: `UNFORMATTED`, `YAML`, `JSON`.
121+
122+
* `project` - (Optional) The ID of the project in which the resource belongs.
123+
If it is not provided, the provider project is used.
124+
125+
126+
## Attributes Reference
127+
128+
In addition to the arguments listed above, the following computed attributes are exported:
129+
130+
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/parameters/{{parameter_id}}`
131+
132+
* `name` -
133+
The resource name of the regional Parameter. Format:
134+
`projects/{{project}}/locations/{{location}}/parameters/{{parameter_id}}`
135+
136+
* `create_time` -
137+
The time at which the regional Parameter was created.
138+
139+
* `update_time` -
140+
The time at which the regional Parameter was updated.
141+
142+
* `policy_member` -
143+
An object containing a unique resource identity tied to the regional parameter.
144+
Structure is [documented below](#nested_policy_member).
145+
146+
* `terraform_labels` -
147+
The combination of labels configured directly on the resource
148+
and default labels configured on the provider.
149+
150+
* `effective_labels` -
151+
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services.
152+
153+
154+
<a name="nested_policy_member"></a>The `policy_member` block contains:
155+
156+
* `iam_policy_uid_principal` -
157+
(Output)
158+
IAM policy binding member referring to a Google Cloud resource by system-assigned unique identifier. If
159+
a resource is deleted and recreated with the same name, the binding will not be applicable to the new
160+
resource. Format:
161+
`principal://parametermanager.googleapis.com/projects/{{project}}/uid/locations/{{location}}/parameters/{{uid}}`
162+
163+
* `iam_policy_name_principal` -
164+
(Output)
165+
IAM policy binding member referring to a Google Cloud resource by user-assigned name. If a resource is
166+
deleted and recreated with the same name, the binding will be applicable to the new resource. Format:
167+
`principal://parametermanager.googleapis.com/projects/{{project}}/name/locations/{{location}}/parameters/{{parameter_id}}`
168+
169+
## Timeouts
170+
171+
This resource provides the following
172+
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
173+
174+
- `create` - Default is 20 minutes.
175+
- `update` - Default is 20 minutes.
176+
- `delete` - Default is 20 minutes.
177+
178+
## Import
179+
180+
181+
RegionalParameter can be imported using any of these accepted formats:
182+
183+
* `projects/{{project}}/locations/{{location}}/parameters/{{parameter_id}}`
184+
* `{{project}}/{{location}}/{{parameter_id}}`
185+
* `{{location}}/{{parameter_id}}`
186+
187+
188+
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import RegionalParameter using one of the formats above. For example:
189+
190+
```tf
191+
import {
192+
id = "projects/{{project}}/locations/{{location}}/parameters/{{parameter_id}}"
193+
to = google_parameter_manager_regional_parameter.default
194+
}
195+
```
196+
197+
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), RegionalParameter can be imported using one of the formats above. For example:
198+
199+
```
200+
$ terraform import google_parameter_manager_regional_parameter.default projects/{{project}}/locations/{{location}}/parameters/{{parameter_id}}
201+
$ terraform import google_parameter_manager_regional_parameter.default {{project}}/{{location}}/{{parameter_id}}
202+
$ terraform import google_parameter_manager_regional_parameter.default {{location}}/{{parameter_id}}
203+
```
204+
205+
## User Project Overrides
206+
207+
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)