Skip to content

Commit e2e8ae6

Browse files
Add support for parameter manager parameter resource google_parameter_manager_parameter (#12630) (#20886)
[upstream:ef139e7f42d948fdbd9db0db64ceba6b1a8480b0] Signed-off-by: Modular Magician <[email protected]>
1 parent ec92e34 commit e2e8ae6

File tree

6 files changed

+220
-1
lines changed

6 files changed

+220
-1
lines changed

.changelog/12630.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_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+
"parametermanager" to mapOf(
595+
"name" to "parametermanager",
596+
"displayName" to "Parametermanager",
597+
"path" to "./google-beta/services/parametermanager"
598+
),
594599
"parametermanagerregional" to mapOf(
595600
"name" to "parametermanagerregional",
596601
"displayName" to "Parametermanagerregional",

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

website/docs/r/parameter_manager_regional_parameter.html.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ The following arguments are supported:
116116

117117
* `format` -
118118
(Optional)
119-
The format type of the regional parameter. Default value is UNFORMATTED.
119+
The format type of the regional parameter.
120+
Default value is `UNFORMATTED`.
120121
Possible values are: `UNFORMATTED`, `YAML`, `JSON`.
121122

122123
* `project` - (Optional) The ID of the project in which the resource belongs.

0 commit comments

Comments
 (0)