Skip to content

Commit

Permalink
change api version to beta only
Browse files Browse the repository at this point in the history
  • Loading branch information
abheda-crest committed Dec 30, 2024
1 parent ccf5cf3 commit 790ee5d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
13 changes: 13 additions & 0 deletions mmv1/products/parametermanager/Parameter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
name: 'Parameter'
description: |
A Parameter resource is a logical parameter.
min_version: 'beta'
references:
guides:
api: 'https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters'
Expand All @@ -33,21 +34,25 @@ timeouts:
examples:
- name: 'parameter_config_basic'
primary_resource_id: 'parameter-basic'
min_version: 'beta'
vars:
parameter_id: 'parameter'
- name: 'parameter_with_format'
primary_resource_id: 'parameter-with-format'
min_version: 'beta'
vars:
parameter_id: 'parameter'
- name: 'parameter_with_labels'
primary_resource_id: 'parameter-with-labels'
min_version: 'beta'
vars:
parameter_id: 'parameter'
parameters:
- name: 'parameterId'
type: String
description: |
This must be unique within the project.
min_version: 'beta'
url_param_only: true
required: true
immutable: true
Expand All @@ -57,21 +62,25 @@ properties:
description: |
The resource name of the Parameter. Format:
`projects/{{project}}/locations/global/parameters/{{parameter_id}}`
min_version: 'beta'
output: true
- name: 'createTime'
type: String
description: |
The time at which the Parameter was created.
min_version: 'beta'
output: true
- name: 'updateTime'
type: String
description: |
The time at which the Parameter was updated.
min_version: 'beta'
output: true
- name: 'policyMember'
type: NestedObject
description: |
Policy member strings of a Google Cloud resource.
min_version: 'beta'
output: true
properties:
- name: 'iamPolicyUidPrincipal'
Expand All @@ -81,6 +90,7 @@ properties:
If a resource is deleted and recreated with the same name, the binding will not be applicable to the
new resource. Format:
`principal://parametermanager.googleapis.com/projects/{{project}}/uid/locations/global/parameters/{{uid}}`
min_version: 'beta'
output: true
- name: 'iamPolicyNamePrincipal'
type: String
Expand All @@ -89,6 +99,7 @@ properties:
resource is deleted and recreated with the same name, the binding will be applicable to the
new resource. Format:
`principal://parametermanager.googleapis.com/projects/{{project}}/name/locations/global/parameters/{{parameter_id}}`
min_version: 'beta'
output: true
- name: 'labels'
type: KeyValueLabels
Expand All @@ -105,10 +116,12 @@ properties:
An object containing a list of "key": value pairs. Example:
{ "name": "wrench", "mass": "1.3kg", "count": "3" }.
min_version: 'beta'
- name: 'format'
type: Enum
description: |
The format type of the parameter resource. Default value is UNFORMATTED.
min_version: 'beta'
default_from_api: true
immutable: true
enum_values:
Expand Down
2 changes: 0 additions & 2 deletions mmv1/products/parametermanager/product.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
name: 'ParameterManager'
display_name: 'Parameter Manager'
versions:
- name: 'ga'
base_url: 'https://parametermanager.googleapis.com/v1/'
- name: 'beta'
base_url: 'https://parametermanager.googleapis.com/v1/'
scopes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
resource "google_parameter_manager_parameter" "{{$.PrimaryResourceId}}" {
provider = google-beta
parameter_id = "{{index $.Vars "parameter_id"}}"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "google_parameter_manager_parameter" "{{$.PrimaryResourceId}}" {
provider = google-beta
parameter_id = "{{index $.Vars "parameter_id"}}"
format = "JSON"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "google_parameter_manager_parameter" "{{$.PrimaryResourceId}}" {
provider = google-beta
parameter_id = "{{index $.Vars "parameter_id"}}"

labels = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package parametermanager_test
{{- if ne $.TargetVersionName "ga" }}

import (
"testing"
Expand All @@ -16,7 +17,7 @@ func TestAccParameterManagerParameter_import(t *testing.T) {

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
CheckDestroy: testAccCheckParameterManagerParameterDestroyProducer(t),
Steps: []resource.TestStep{
{
Expand All @@ -35,6 +36,7 @@ func TestAccParameterManagerParameter_import(t *testing.T) {
func testAccParameterManagerParameter_import(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_parameter_manager_parameter" "parameter-import" {
provider = google-beta
parameter_id = "tf_test_parameter%{random_suffix}"
format = "YAML"

Expand All @@ -58,7 +60,7 @@ func TestAccParameterManagerParameter_labelsUpdate(t *testing.T) {

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
CheckDestroy: testAccCheckParameterManagerParameterDestroyProducer(t),
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -104,6 +106,7 @@ func TestAccParameterManagerParameter_labelsUpdate(t *testing.T) {
func testAccParameterManagerParameter_withoutLabels(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_parameter_manager_parameter" "parameter-with-labels" {
provider = google-beta
parameter_id = "tf_test_parameter%{random_suffix}"
format = "JSON"
}
Expand All @@ -113,6 +116,7 @@ resource "google_parameter_manager_parameter" "parameter-with-labels" {
func testAccParameterManagerParameter_labelsUpdate(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_parameter_manager_parameter" "parameter-with-labels" {
provider = google-beta
parameter_id = "tf_test_parameter%{random_suffix}"
format = "JSON"

Expand All @@ -130,6 +134,7 @@ resource "google_parameter_manager_parameter" "parameter-with-labels" {
func testAccParameterManagerParameter_labelsUpdateOther(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_parameter_manager_parameter" "parameter-with-labels" {
provider = google-beta
parameter_id = "tf_test_parameter%{random_suffix}"
format = "JSON"

Expand All @@ -143,3 +148,5 @@ resource "google_parameter_manager_parameter" "parameter-with-labels" {
}
`, context)
}

{{ end }}

0 comments on commit 790ee5d

Please sign in to comment.