diff --git a/docs/resources/google_dataproc_metastore_federation.md b/docs/resources/google_dataproc_metastore_federation.md index eaed24df..31a6b3e8 100644 --- a/docs/resources/google_dataproc_metastore_federation.md +++ b/docs/resources/google_dataproc_metastore_federation.md @@ -23,7 +23,7 @@ A `google_dataproc_metastore_federation` is used to test a Google Federation res ## Examples ``` -describe google_dataproc_metastore_federation(name: ' value_name') do +describe google_dataproc_metastore_federation(name: 'value_name') do it { should exist } its('name') { should cmp 'value_name' } its('create_time') { should cmp 'value_createtime' } @@ -33,7 +33,6 @@ describe google_dataproc_metastore_federation(name: ' value_name') do its('state') { should cmp 'value_state' } its('state_message') { should cmp 'value_statemessage' } its('uid') { should cmp 'value_uid' } - end describe google_dataproc_metastore_federation(name: "does_not_exit") do @@ -56,7 +55,7 @@ Properties that can be accessed from the `google_dataproc_metastore_federation` * `labels`: User-defined labels for the metastore federation. - * `additional_properties`: + * `additional_properties`: * `version`: Immutable. The Apache Hive metastore version of the federation. All backend metastore versions must be compatible with the federation version. diff --git a/docs/resources/google_dataproc_metastore_federations.md b/docs/resources/google_dataproc_metastore_federations.md index d252c641..128ef92d 100644 --- a/docs/resources/google_dataproc_metastore_federations.md +++ b/docs/resources/google_dataproc_metastore_federations.md @@ -23,8 +23,16 @@ A `google_dataproc_metastore_federations` is used to test a Google Federation re ## Examples ``` - describe google_dataproc_metastore_federations(parent: ' value_parent') do + describe google_dataproc_metastore_federations(parent: 'value_parent') do it { should exist } + its('names') { should include 'value_name' } + its('create_times') { should include 'value_createtime' } + its('update_times') { should include 'value_updatetime' } + its('versions') { should include 'value_version' } + its('endpoint_uris') { should include 'value_endpointuri' } + its('states') { should include 'value_state' } + its('state_messages') { should include 'value_statemessage' } + its('uids') { should include 'value_uid' } end ``` diff --git a/libraries/google_dataproc_metastore_federation.rb b/libraries/google_dataproc_metastore_federation.rb index 9584128f..1daf6b85 100644 --- a/libraries/google_dataproc_metastore_federation.rb +++ b/libraries/google_dataproc_metastore_federation.rb @@ -66,7 +66,7 @@ def to_s private def product_url(_ = nil) - 'https://metastore.googleapis.com/v1beta/' + 'https://metastore.googleapis.com/v1/' end def resource_base_url diff --git a/libraries/google_dataproc_metastore_federations.rb b/libraries/google_dataproc_metastore_federations.rb index 4224dcf6..51a2c2d2 100644 --- a/libraries/google_dataproc_metastore_federations.rb +++ b/libraries/google_dataproc_metastore_federations.rb @@ -88,7 +88,7 @@ def transformers private def product_url(_ = nil) - 'https://metastore.googleapis.com/v1beta/' + 'https://metastore.googleapis.com/v1/' end def resource_base_url diff --git a/test/integration/build/gcp-mm.tf b/test/integration/build/gcp-mm.tf index c1005a91..0321df10 100644 --- a/test/integration/build/gcp-mm.tf +++ b/test/integration/build/gcp-mm.tf @@ -260,6 +260,9 @@ variable "bigtable_instance_cluster" { variable "dataproc_metastore_service" { type = any } +variable "dataproc_metastore_federation" { + type = any +} resource "google_compute_ssl_policy" "custom-ssl-policy" { name = var.ssl_policy["name"] @@ -1724,7 +1727,7 @@ resource "google_secret_manager_secret" "test-secret" { secret_id = var.secrets_manager_v1["secret_id"] replication { - auto {} + # auto {} } } @@ -2175,23 +2178,28 @@ resource "google_bigtable_instance" "inspec-test" { my-label = var.bigtable_instance_cluster.name } } -resource "google_dataproc_metastore_service" "default" { - project = var.gcp_project_id - service_id = var.dataproc_metastore_service.name - location = var.dataproc_metastore_service.location - port = var.dataproc_metastore_service.port - tier = var.dataproc_metastore_service.tier - maintenance_window { - hour_of_day = 2 - day_of_week = "SUNDAY" - } +resource "google_dataproc_metastore_service" "inspec-test" { + project = var.gcp_project_id + service_id = var.dataproc_metastore_service.name + location = var.dataproc_metastore_service.location + tier = var.dataproc_metastore_service.tier + hive_metastore_config { - version = var.dataproc_metastore_service.hive_config_version + version = var.dataproc_metastore_service.version + # endpoint_protocol = "GRPC" } - - labels = { - env = "inspec" +} +resource "google_dataproc_metastore_federation" "inspec-federation" { + project = var.gcp_project_id + location = var.dataproc_metastore_federation.location + federation_id = var.dataproc_metastore_federation.federation_id + version = var.dataproc_metastore_federation.version + + backend_metastores { + rank = "1" + name = google_dataproc_metastore_service.inspec-test.id + metastore_type = var.dataproc_metastore_service.metastore_type } } diff --git a/test/integration/configuration/mm-attributes.yml b/test/integration/configuration/mm-attributes.yml index 385f942c..93464c22 100644 --- a/test/integration/configuration/mm-attributes.yml +++ b/test/integration/configuration/mm-attributes.yml @@ -724,6 +724,10 @@ bigtable_instance_cluster: dataproc_metastore_service: name: "metastore-srv" location: "us-central1" - port: 9080 tier: "DEVELOPER" - hive_config_version: "2.3.6" + version: "3.1.2" + metastore_type: "DATAPROC_METASTORE" + +dataproc_metastore_federation: + federation_id: "inspec-federation" + location: "us-central1" diff --git a/test/integration/verify/controls/google_dataproc_metastore_federation.rb b/test/integration/verify/controls/google_dataproc_metastore_federation.rb new file mode 100644 index 00000000..b85dc02c --- /dev/null +++ b/test/integration/verify/controls/google_dataproc_metastore_federation.rb @@ -0,0 +1,49 @@ +# ---------------------------------------------------------------------------- +# +# *** 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 README.md and +# CONTRIBUTING.md located at the root of this package. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_dataproc_metastore_federation resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') +federation = input('federation', value: { + "name": "projects/ppradhan/locations/us-central1/federations/inspec-federation", + "parent": "projects/ppradhan/locations/us-central1", + "create_time": "2024-07-23T11:59:46.629125267Z", + "update_time": "2024-07-23T12:01:30.424230443Z", + "version": "3.1.2", + "endpoint_uri": "https://standalone-federation-inspec-federation-4082ad6a-ct6cldpepa-uc.a.run.app:443", + "state": "ACTIVE", + "state_message": "value_statemessage", + "uid": "d9600d29-81c5-47f1-8db6-4ffe194841fe" +}, description: 'federation description') +control 'google_dataproc_metastore_federation-1.0' do + impact 1.0 + title 'google_dataproc_metastore_federation resource test' + + describe google_dataproc_metastore_federation(name: federation['name']) do + it { should exist } + its('name') { should cmp federation['name'] } + its('create_time') { should cmp federation['create_time'] } + its('update_time') { should cmp federation['update_time'] } + its('version') { should cmp federation['version'] } + its('endpoint_uri') { should cmp federation['endpoint_uri'] } + its('state') { should cmp federation['state'] } + its('state_message') { should cmp federation['state_message'] } + its('uid') { should cmp federation['uid'] } + + end + + describe google_dataproc_metastore_federation(name: "does_not_exit") do + it { should_not exist } + end +end diff --git a/test/integration/verify/controls/google_dataproc_metastore_federations.rb b/test/integration/verify/controls/google_dataproc_metastore_federations.rb new file mode 100644 index 00000000..b66583a0 --- /dev/null +++ b/test/integration/verify/controls/google_dataproc_metastore_federations.rb @@ -0,0 +1,43 @@ +# ---------------------------------------------------------------------------- +# +# *** 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 README.md and +# CONTRIBUTING.md located at the root of this package. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_dataproc_metastore_federations resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') +federation = input('federation', value: { + "name": "projects/ppradhan/locations/us-central1/federations/inspec-federation", + "parent": "projects/ppradhan/locations/us-central1", + "create_time": "2024-07-23T11:59:46.629125267Z", + "update_time": "2024-07-23T12:01:30.424230443Z", + "version": "3.1.2", + "endpoint_uri": "https://standalone-federation-inspec-federation-4082ad6a-ct6cldpepa-uc.a.run.app:443", + "state": "ACTIVE", + "state_message": "value_statemessage", + "uid": "d9600d29-81c5-47f1-8db6-4ffe194841fe" +}, description: 'federation description') +control 'google_dataproc_metastore_federations-1.0' do + impact 1.0 + title 'google_dataproc_metastore_federations resource test' + + describe google_dataproc_metastore_federations(parent: federation['parent']) do + it { should exist } + its('names') { should include federation['name'] } + its('create_times') { should include federation['create_time'] } + its('update_times') { should include federation['update_time'] } + its('versions') { should include federation['version'] } + its('endpoint_uris') { should include federation['endpoint_uri'] } + its('states') { should include federation['state'] } + its('uids') { should include federation['uid'] } + end +end diff --git a/test/integration/verify/controls/google_dataproc_metastore_project_location_federation.rb b/test/integration/verify/controls/google_dataproc_metastore_project_location_federation.rb deleted file mode 100644 index 273fb54c..00000000 --- a/test/integration/verify/controls/google_dataproc_metastore_project_location_federation.rb +++ /dev/null @@ -1,49 +0,0 @@ -# ---------------------------------------------------------------------------- -# -# *** 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 README.md and -# CONTRIBUTING.md located at the root of this package. -# -# ---------------------------------------------------------------------------- - -title 'Test GCP google_dataproc_metastore_federation resource.' - -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') -project_location_federation = input('project_location_federation', value: { - "name": "value_name", - "parent": "value_parent", - "create_time": "value_createtime", - "update_time": "value_updatetime", - "version": "value_version", - "endpoint_uri": "value_endpointuri", - "state": "value_state", - "state_message": "value_statemessage", - "uid": "value_uid" -}, description: 'project_location_federation description') -control 'google_dataproc_metastore_federation-1.0' do - impact 1.0 - title 'google_dataproc_metastore_federation resource test' - - describe google_dataproc_metastore_federation(name: project_location_federation['name']) do - it { should exist } - its('name') { should cmp project_location_federation['name'] } - its('create_time') { should cmp project_location_federation['create_time'] } - its('update_time') { should cmp project_location_federation['update_time'] } - its('version') { should cmp project_location_federation['version'] } - its('endpoint_uri') { should cmp project_location_federation['endpoint_uri'] } - its('state') { should cmp project_location_federation['state'] } - its('state_message') { should cmp project_location_federation['state_message'] } - its('uid') { should cmp project_location_federation['uid'] } - - end - - describe google_dataproc_metastore_federation(name: "does_not_exit") do - it { should_not exist } - end -end diff --git a/test/integration/verify/controls/google_dataproc_metastore_project_location_federations.rb b/test/integration/verify/controls/google_dataproc_metastore_project_location_federations.rb deleted file mode 100644 index b732ec6a..00000000 --- a/test/integration/verify/controls/google_dataproc_metastore_project_location_federations.rb +++ /dev/null @@ -1,36 +0,0 @@ -# ---------------------------------------------------------------------------- -# -# *** 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 README.md and -# CONTRIBUTING.md located at the root of this package. -# -# ---------------------------------------------------------------------------- - -title 'Test GCP google_dataproc_metastore_federations resource.' - -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') -project_location_federation = input('project_location_federation', value: { - "name": "value_name", - "parent": "value_parent", - "create_time": "value_createtime", - "update_time": "value_updatetime", - "version": "value_version", - "endpoint_uri": "value_endpointuri", - "state": "value_state", - "state_message": "value_statemessage", - "uid": "value_uid" -}, description: 'project_location_federation description') -control 'google_dataproc_metastore_federations-1.0' do - impact 1.0 - title 'google_dataproc_metastore_federations resource test' - - describe google_dataproc_metastore_federations(parent: project_location_federation['parent']) do - it { should exist } - end -end