|
| 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 Version resource that stores the actual value of the parameter. |
| 18 | +--- |
| 19 | + |
| 20 | +# google_parameter_manager_parameter_version |
| 21 | + |
| 22 | +A Parameter Version resource that stores the actual value of the 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 ParameterVersion, see: |
| 28 | + |
| 29 | +* [API documentation](https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters.versions) |
| 30 | + |
| 31 | +~> **Warning:** All arguments including the following potentially sensitive |
| 32 | +values will be stored in the raw state as plain text: `payload.parameter_data`. |
| 33 | +[Read more about sensitive data in state](https://www.terraform.io/language/state/sensitive-data). |
| 34 | + |
| 35 | +<div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| 36 | + <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%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_version_basic&open_in_editor=main.tf" target="_blank"> |
| 37 | + <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| 38 | + </a> |
| 39 | +</div> |
| 40 | +## Example Usage - Parameter Version Basic |
| 41 | + |
| 42 | + |
| 43 | +```hcl |
| 44 | +resource "google_parameter_manager_parameter" "parameter-basic" { |
| 45 | + provider = google-beta |
| 46 | + parameter_id = "parameter" |
| 47 | +} |
| 48 | +
|
| 49 | +resource "google_parameter_manager_parameter_version" "parameter-version-basic" { |
| 50 | + provider = google-beta |
| 51 | + parameter = google_parameter_manager_parameter.parameter-basic.id |
| 52 | + parameter_version_id = "parameter_version" |
| 53 | + parameter_data = "app-parameter-version-data" |
| 54 | +} |
| 55 | +``` |
| 56 | +<div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| 57 | + <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%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_version_with_json_format&open_in_editor=main.tf" target="_blank"> |
| 58 | + <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| 59 | + </a> |
| 60 | +</div> |
| 61 | +## Example Usage - Parameter Version With Json Format |
| 62 | + |
| 63 | + |
| 64 | +```hcl |
| 65 | +resource "google_parameter_manager_parameter" "parameter-basic" { |
| 66 | + provider = google-beta |
| 67 | + parameter_id = "parameter" |
| 68 | + format = "JSON" |
| 69 | +} |
| 70 | +
|
| 71 | +resource "google_parameter_manager_parameter_version" "parameter-version-with-json-format" { |
| 72 | + provider = google-beta |
| 73 | + parameter = google_parameter_manager_parameter.parameter-basic.id |
| 74 | + parameter_version_id = "parameter_version" |
| 75 | + parameter_data = jsonencode({ |
| 76 | + "key1": "val1", |
| 77 | + "key2": "val2" |
| 78 | + }) |
| 79 | +} |
| 80 | +``` |
| 81 | +<div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| 82 | + <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%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_version_with_yaml_format&open_in_editor=main.tf" target="_blank"> |
| 83 | + <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| 84 | + </a> |
| 85 | +</div> |
| 86 | +## Example Usage - Parameter Version With Yaml Format |
| 87 | + |
| 88 | + |
| 89 | +```hcl |
| 90 | +resource "google_parameter_manager_parameter" "parameter-basic" { |
| 91 | + provider = google-beta |
| 92 | + parameter_id = "parameter" |
| 93 | + format = "YAML" |
| 94 | +} |
| 95 | +
|
| 96 | +resource "google_parameter_manager_parameter_version" "parameter-version-with-yaml-format" { |
| 97 | + provider = google-beta |
| 98 | + parameter = google_parameter_manager_parameter.parameter-basic.id |
| 99 | + parameter_version_id = "parameter_version" |
| 100 | + parameter_data = yamlencode({ |
| 101 | + "key1": "val1", |
| 102 | + "key2": "val2" |
| 103 | + }) |
| 104 | +} |
| 105 | +``` |
| 106 | + |
| 107 | +## Argument Reference |
| 108 | + |
| 109 | +The following arguments are supported: |
| 110 | + |
| 111 | + |
| 112 | +* `parameter_data` - |
| 113 | + (Required) |
| 114 | + The Parameter data. |
| 115 | + **Note**: This property is sensitive and will not be displayed in the plan. |
| 116 | + |
| 117 | +* `parameter` - |
| 118 | + (Required) |
| 119 | + Parameter Manager Parameter resource. |
| 120 | + |
| 121 | +* `parameter_version_id` - |
| 122 | + (Required) |
| 123 | + Version ID of the Parameter Version Resource. This must be unique within the Parameter. |
| 124 | + |
| 125 | + |
| 126 | +- - - |
| 127 | + |
| 128 | + |
| 129 | +* `disabled` - |
| 130 | + (Optional) |
| 131 | + The current state of Parameter Version. This field is only applicable for updating Parameter Version. |
| 132 | + |
| 133 | + |
| 134 | +## Attributes Reference |
| 135 | + |
| 136 | +In addition to the arguments listed above, the following computed attributes are exported: |
| 137 | + |
| 138 | +* `id` - an identifier for the resource with format `{{parameter}}/versions/{{parameter_version_id}}` |
| 139 | + |
| 140 | +* `name` - |
| 141 | + The resource name of the Parameter Version. Format: |
| 142 | + `projects/{{project}}/locations/global/parameters/{{parameter_id}}/versions/{{parameter_version_id}}` |
| 143 | + |
| 144 | +* `create_time` - |
| 145 | + The time at which the Parameter Version was created. |
| 146 | + |
| 147 | +* `update_time` - |
| 148 | + The time at which the Parameter Version was updated. |
| 149 | + |
| 150 | + |
| 151 | +## Timeouts |
| 152 | + |
| 153 | +This resource provides the following |
| 154 | +[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| 155 | + |
| 156 | +- `create` - Default is 20 minutes. |
| 157 | +- `update` - Default is 20 minutes. |
| 158 | +- `delete` - Default is 20 minutes. |
| 159 | + |
| 160 | +## Import |
| 161 | + |
| 162 | + |
| 163 | +ParameterVersion can be imported using any of these accepted formats: |
| 164 | + |
| 165 | +* `projects/{{project}}/locations/global/parameters/{{parameter_id}}/versions/{{parameter_version_id}}` |
| 166 | + |
| 167 | + |
| 168 | +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import ParameterVersion using one of the formats above. For example: |
| 169 | + |
| 170 | +```tf |
| 171 | +import { |
| 172 | + id = "projects/{{project}}/locations/global/parameters/{{parameter_id}}/versions/{{parameter_version_id}}" |
| 173 | + to = google_parameter_manager_parameter_version.default |
| 174 | +} |
| 175 | +``` |
| 176 | + |
| 177 | +When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), ParameterVersion can be imported using one of the formats above. For example: |
| 178 | + |
| 179 | +``` |
| 180 | +$ terraform import google_parameter_manager_parameter_version.default projects/{{project}}/locations/global/parameters/{{parameter_id}}/versions/{{parameter_version_id}} |
| 181 | +``` |
0 commit comments