From fef7cff811e132ffe990d351a2d8d884cba8c7cb Mon Sep 17 00:00:00 2001 From: Daniele <50317336+DendoD96@users.noreply.github.com> Date: Wed, 17 Apr 2024 20:17:46 +0200 Subject: [PATCH] Add `protocol` field for `filestore Instance` product (#10324) --- mmv1/products/filestore/Instance.yaml | 20 +++++++++++++++++++ .../filestore_instance_protocol.tf.erb | 18 +++++++++++++++++ .../data/example_filestore_instance.json | 3 ++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 mmv1/templates/terraform/examples/filestore_instance_protocol.tf.erb diff --git a/mmv1/products/filestore/Instance.yaml b/mmv1/products/filestore/Instance.yaml index 061c167afc9d..dd11322d2927 100644 --- a/mmv1/products/filestore/Instance.yaml +++ b/mmv1/products/filestore/Instance.yaml @@ -41,6 +41,12 @@ examples: primary_resource_id: 'instance' vars: instance_name: 'test-instance' + - !ruby/object:Provider::Terraform::Examples + name: 'filestore_instance_protocol' + primary_resource_id: 'instance' + min_version: beta + vars: + instance_name: 'test-instance' - !ruby/object:Provider::Terraform::Examples name: 'filestore_instance_enterprise' primary_resource_id: 'instance' @@ -97,6 +103,20 @@ properties: Possible values include: STANDARD, PREMIUM, BASIC_HDD, BASIC_SSD, HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE required: true immutable: true + - !ruby/object:Api::Type::Enum + name: 'protocol' + description: | + Either NFSv3, for using NFS version 3 as file sharing protocol, + or NFSv4.1, for using NFS version 4.1 as file sharing protocol. + NFSv4.1 can be used with HIGH_SCALE_SSD, ZONAL, REGIONAL and ENTERPRISE. + The default is NFSv3. + default_value: :NFS_V3 + min_version: 'beta' + immutable: true + values: + - :NFS_V3 + - :NFS_V4_1 + custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb' - !ruby/object:Api::Type::KeyValueLabels name: 'labels' description: | diff --git a/mmv1/templates/terraform/examples/filestore_instance_protocol.tf.erb b/mmv1/templates/terraform/examples/filestore_instance_protocol.tf.erb new file mode 100644 index 000000000000..c7cb489a814f --- /dev/null +++ b/mmv1/templates/terraform/examples/filestore_instance_protocol.tf.erb @@ -0,0 +1,18 @@ +resource "google_filestore_instance" "<%= ctx[:primary_resource_id] %>" { + provider = google-beta + name = "<%= ctx[:vars]["instance_name"] %>" + location = "us-central1" + tier = "ENTERPRISE" + protocol = "NFS_V4_1" + + file_shares { + capacity_gb = 1024 + name = "share1" + } + + networks { + network = "default" + modes = ["MODE_IPV4"] + } + +} diff --git a/mmv1/third_party/tgc/tests/data/example_filestore_instance.json b/mmv1/third_party/tgc/tests/data/example_filestore_instance.json index 576160f04183..c7b29f655583 100644 --- a/mmv1/third_party/tgc/tests/data/example_filestore_instance.json +++ b/mmv1/third_party/tgc/tests/data/example_filestore_instance.json @@ -24,8 +24,9 @@ "network": "default" } ], + "protocol": "NFS_V3", "tier": "BASIC_SSD" } } } -] +] \ No newline at end of file