diff --git a/.changelog/12642.txt b/.changelog/12642.txt new file mode 100644 index 00000000000..fe298dde19c --- /dev/null +++ b/.changelog/12642.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +`google_parameter_manager_regional_parameter_version` +``` \ No newline at end of file diff --git a/google/services/parametermanagerregional/resource_parameter_manager_regional_parameter_version_test.go b/google/services/parametermanagerregional/resource_parameter_manager_regional_parameter_version_test.go new file mode 100644 index 00000000000..70f4ca3baaf --- /dev/null +++ b/google/services/parametermanagerregional/resource_parameter_manager_regional_parameter_version_test.go @@ -0,0 +1,3 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 +package parametermanagerregional_test diff --git a/google/services/parametermanagerregional/test-fixtures/parameter_data_json_format.json b/google/services/parametermanagerregional/test-fixtures/parameter_data_json_format.json new file mode 100644 index 00000000000..13121b6d8c3 --- /dev/null +++ b/google/services/parametermanagerregional/test-fixtures/parameter_data_json_format.json @@ -0,0 +1,4 @@ +{ + "key1": "value1", + "key2": "value2" +} diff --git a/google/services/parametermanagerregional/test-fixtures/parameter_data_yaml_format.yaml b/google/services/parametermanagerregional/test-fixtures/parameter_data_yaml_format.yaml new file mode 100644 index 00000000000..6c2ec76dc54 --- /dev/null +++ b/google/services/parametermanagerregional/test-fixtures/parameter_data_yaml_format.yaml @@ -0,0 +1,2 @@ +key1: "value1" +key2: "value2" diff --git a/website/docs/r/parameter_manager_regional_parameter_version.html.markdown b/website/docs/r/parameter_manager_regional_parameter_version.html.markdown new file mode 100644 index 00000000000..6eac9e147c4 --- /dev/null +++ b/website/docs/r/parameter_manager_regional_parameter_version.html.markdown @@ -0,0 +1,181 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** 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: "Parameter Manager" +description: |- + A Regional Parameter Version resource that stores the actual value of the regional parameter. +--- + +# google_parameter_manager_regional_parameter_version + +A Regional Parameter Version resource that stores the actual value of the regional parameter. + +~> **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. + +To get more information about RegionalParameterVersion, see: + +* [API documentation](https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters.versions) + +~> **Warning:** All arguments including the following potentially sensitive +values will be stored in the raw state as plain text: `payload.parameter_data`. +[Read more about sensitive data in state](https://www.terraform.io/language/state/sensitive-data). + +
+ + Open in Cloud Shell + +
+## Example Usage - Regional Parameter Version Basic + + +```hcl +resource "google_parameter_manager_regional_parameter" "regional-parameter-basic" { + provider = google-beta + parameter_id = "regional_parameter" + location = "us-central1" +} + +resource "google_parameter_manager_regional_parameter_version" "regional-parameter-version-basic" { + provider = google-beta + parameter = google_parameter_manager_regional_parameter.regional-parameter-basic.id + parameter_version_id = "regional_parameter_version" + parameter_data = "regional-parameter-version-data" +} +``` +
+ + Open in Cloud Shell + +
+## Example Usage - Regional Parameter Version With Json Format + + +```hcl +resource "google_parameter_manager_regional_parameter" "regional-parameter-basic" { + provider = google-beta + parameter_id = "regional_parameter" + format = "JSON" + location = "us-central1" +} + +resource "google_parameter_manager_regional_parameter_version" "regional-parameter-version-with-json-format" { + provider = google-beta + parameter = google_parameter_manager_regional_parameter.regional-parameter-basic.id + parameter_version_id = "regional_parameter_version" + parameter_data = file("parameter_data_json_format.yaml") +} +``` +
+ + Open in Cloud Shell + +
+## Example Usage - Regional Parameter Version With Yaml Format + + +```hcl +resource "google_parameter_manager_regional_parameter" "regional-parameter-basic" { + provider = google-beta + parameter_id = "regional_parameter" + format = "YAML" + location = "us-central1" +} + +resource "google_parameter_manager_regional_parameter_version" "regional-parameter-version-with-yaml-format" { + provider = google-beta + parameter = google_parameter_manager_regional_parameter.regional-parameter-basic.id + parameter_version_id = "regional_parameter_version" + parameter_data = file("parameter_data_yaml_format.yaml") +} +``` + +## Argument Reference + +The following arguments are supported: + + +* `parameter_data` - + (Required) + The Regional Parameter data. + **Note**: This property is sensitive and will not be displayed in the plan. + +* `parameter` - + (Required) + Parameter Manager Regional Parameter resource. + +* `parameter_version_id` - + (Required) + Version ID of the Regional Parameter Version Resource. This must be unique within the Regional Parameter. + + +- - - + + +* `disabled` - + (Optional) + The current state of Regional Parameter Version. This field is only applicable for updating Regional Parameter Version. + + +## Attributes Reference + +In addition to the arguments listed above, the following computed attributes are exported: + +* `id` - an identifier for the resource with format `{{parameter}}/versions/{{parameter_version_id}}` + +* `name` - + The resource name of the Regional Parameter Version. Format: + `projects/{{project}}/locations/{{location}}/parameters/{{parameter_id}}/versions/{{parameter_version_id}}` + +* `create_time` - + The time at which the Regional Parameter Version was created. + +* `update_time` - + The time at which the Regional Parameter Version was updated. + +* `location` - + Location of Parameter Manager Regional parameter resource. + + +## Timeouts + +This resource provides the following +[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: + +- `create` - Default is 20 minutes. +- `update` - Default is 20 minutes. +- `delete` - Default is 20 minutes. + +## Import + + +RegionalParameterVersion can be imported using any of these accepted formats: + +* `projects/{{project}}/locations/{{location}}/parameters/{{parameter_id}}/versions/{{parameter_version_id}}` + + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import RegionalParameterVersion using one of the formats above. For example: + +```tf +import { + id = "projects/{{project}}/locations/{{location}}/parameters/{{parameter_id}}/versions/{{parameter_version_id}}" + to = google_parameter_manager_regional_parameter_version.default +} +``` + +When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), RegionalParameterVersion can be imported using one of the formats above. For example: + +``` +$ terraform import google_parameter_manager_regional_parameter_version.default projects/{{project}}/locations/{{location}}/parameters/{{parameter_id}}/versions/{{parameter_version_id}} +```