From 54029c3cbd1b662807b2fa70910142f3ded636b4 Mon Sep 17 00:00:00 2001 From: Samir <85890442+sa-progress@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:23:05 +0530 Subject: [PATCH 1/2] Automatically generated by magic modules for service: bigtableadmin_v2 and resource: Projects__instances__clusters__backup. This commit includes the following changes: - Singular Resource - Plural Resource - Documentation updates - Terraform configuration - Integration tests Signed-off-by: Samir <85890442+sa-progress@users.noreply.github.com> --- ...leadmin_project_instance_cluster_backup.md | 92 ++++++++++++++++++ ...eadmin_project_instance_cluster_backups.md | 64 +++++++++++++ ...ctinstanceclusterbackup_encryption_info.rb | 41 ++++++++ ...ackup_encryption_info_encryption_status.rb | 40 ++++++++ ...leadmin_project_instance_cluster_backup.rb | 73 ++++++++++++++ ...eadmin_project_instance_cluster_backups.rb | 95 +++++++++++++++++++ ...leadmin_project_instance_cluster_backup.rb | 50 ++++++++++ ...eadmin_project_instance_cluster_backups.rb | 37 ++++++++ 8 files changed, 492 insertions(+) create mode 100644 docs/resources/google_bigtableadmin_project_instance_cluster_backup.md create mode 100644 docs/resources/google_bigtableadmin_project_instance_cluster_backups.md create mode 100644 libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info.rb create mode 100644 libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status.rb create mode 100644 libraries/google_bigtableadmin_project_instance_cluster_backup.rb create mode 100644 libraries/google_bigtableadmin_project_instance_cluster_backups.rb create mode 100644 test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backup.rb create mode 100644 test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backups.rb diff --git a/docs/resources/google_bigtableadmin_project_instance_cluster_backup.md b/docs/resources/google_bigtableadmin_project_instance_cluster_backup.md new file mode 100644 index 00000000..fe1ffe7d --- /dev/null +++ b/docs/resources/google_bigtableadmin_project_instance_cluster_backup.md @@ -0,0 +1,92 @@ ++++ + +title = "google_bigtableadmin_project_instance_cluster_backup Resource" +platform = "gcp" +draft = false +gh_repo = "inspec-gcp" + + +[menu.inspec] + +title = "google_bigtableadmin_project_instance_cluster_backup" +identifier = "inspec/resources/gcp/google_bigtableadmin_project_instance_cluster_backup Resource" +parent = "inspec/resources/gcp" ++++ + +Use the `google_bigtableadmin_project_instance_cluster_backup` InSpec audit resource to test the properties of a test a Google ProjectInstanceClusterBackup. + +## Installation +{{% inspec_gcp_install %}} + +## Syntax +A `google_bigtableadmin_project_instance_cluster_backup` is used to test a Google ProjectInstanceClusterBackup resource + +## Examples +``` +describe google_bigtableadmin_project_instance_cluster_backup(name: ' value_name') do + it { should exist } + its('name') { should cmp 'value_name' } + its('source_table') { should cmp 'value_sourcetable' } + its('source_backup') { should cmp 'value_sourcebackup' } + its('expire_time') { should cmp 'value_expiretime' } + its('start_time') { should cmp 'value_starttime' } + its('end_time') { should cmp 'value_endtime' } + its('size_bytes') { should cmp 'value_sizebytes' } + its('state') { should cmp 'value_state' } + +end + +describe google_bigtableadmin_project_instance_cluster_backup(name: "does_not_exit") do + it { should_not exist } +end +``` + +## Parameters +Properties that can be accessed from the `google_bigtableadmin_project_instance_cluster_backup` resource: + +## Properties +Properties that can be accessed from the `google_bigtableadmin_project_instance_cluster_backup` resource: + + + * `name`: A globally unique identifier for the backup which cannot be changed. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}/ backups/_a-zA-Z0-9*` The final segment of the name must be between 1 and 50 characters in length. The backup is stored in the cluster identified by the prefix of the backup name of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. + + * `source_table`: Required. Immutable. Name of the table from which this backup was created. This needs to be in the same instance as the backup. Values are of the form `projects/{project}/instances/{instance}/tables/{source_table}`. + + * `source_backup`: Output only. Name of the backup from which this backup was copied. If a backup is not created by copying a backup, this field will be empty. Values are of the form: projects//instances//clusters//backups/ + + * `expire_time`: Required. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 90 days from the time the request is received. Once the `expire_time` has passed, Cloud Bigtable will delete the backup and free the resources used by the backup. + + * `start_time`: Output only. `start_time` is the time that the backup was started (i.e. approximately the time the CreateBackup request is received). The row data in this backup will be no older than this timestamp. + + * `end_time`: Output only. `end_time` is the time that the backup was finished. The row data in the backup will be no newer than this timestamp. + + * `size_bytes`: Output only. Size of the backup in bytes. + + * `state`: Output only. The current state of the backup. + Possible values: + * STATE_UNSPECIFIED + * CREATING + * READY + + * `encryption_info`: Encryption information for a given resource. If this resource is protected with customer managed encryption, the in-use Cloud Key Management Service (Cloud KMS) key version is specified along with its status. + + * `encryption_type`: Output only. The type of encryption used to protect this resource. + Possible values: + * ENCRYPTION_TYPE_UNSPECIFIED + * GOOGLE_DEFAULT_ENCRYPTION + * CUSTOMER_MANAGED_ENCRYPTION + + * `encryption_status`: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). + + * `code`: The status code, which should be an enum value of google.rpc.Code. + + * `message`: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + + * `details`: A list of messages that carry the error details. There is a common set of message types for APIs to use. + + * `kms_key_version`: Output only. The version of the Cloud KMS key specified in the parent cluster that is in use for the data underlying this table. + + +## GCP Permissions + +Ensure the [https://bigtableadmin.googleapis.com/](https://console.cloud.google.com/apis/library/bigtableadmin.googleapis.com/) is enabled for the current project. diff --git a/docs/resources/google_bigtableadmin_project_instance_cluster_backups.md b/docs/resources/google_bigtableadmin_project_instance_cluster_backups.md new file mode 100644 index 00000000..4ddd42cb --- /dev/null +++ b/docs/resources/google_bigtableadmin_project_instance_cluster_backups.md @@ -0,0 +1,64 @@ ++++ + +title = "google_bigtableadmin_project_instance_cluster_backups Resource" +platform = "gcp" +draft = false +gh_repo = "inspec-gcp" + + +[menu.inspec] + +title = "google_bigtableadmin_project_instance_cluster_backups" +identifier = "inspec/resources/gcp/google_bigtableadmin_project_instance_cluster_backups Resource" +parent = "inspec/resources/gcp" ++++ + +Use the `google_bigtableadmin_project_instance_cluster_backups` InSpec audit resource to test the properties of a test a Google ProjectInstanceClusterBackup. + +## Installation +{{% inspec_gcp_install %}} + +## Syntax +A `google_bigtableadmin_project_instance_cluster_backups` is used to test a Google ProjectInstanceClusterBackup resource + +## Examples +``` + describe google_bigtableadmin_project_instance_cluster_backups(parent: ' value_parent') do + it { should exist } + end +``` + +## Parameters +Properties that can be accessed from the `google_bigtableadmin_project_instance_cluster_backups` resource: + +See [google_bigtableadmin_project_instance_cluster_backup.md](google_bigtableadmin_project_instance_cluster_backup.md) for more detailed information +* `names`: an array of `google_bigtableadmin_project_instance_cluster_backup` name +* `source_tables`: an array of `google_bigtableadmin_project_instance_cluster_backup` source_table +* `source_backups`: an array of `google_bigtableadmin_project_instance_cluster_backup` source_backup +* `expire_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` expire_time +* `start_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` start_time +* `end_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` end_time +* `size_bytes`: an array of `google_bigtableadmin_project_instance_cluster_backup` size_bytes +* `states`: an array of `google_bigtableadmin_project_instance_cluster_backup` state +* `encryption_infos`: an array of `google_bigtableadmin_project_instance_cluster_backup` encryption_info +## Properties +Properties that can be accessed from the `google_bigtableadmin_project_instance_cluster_backups` resource: + +See [google_bigtableadmin_project_instance_cluster_backup.md](google_bigtableadmin_project_instance_cluster_backup.md) for more detailed information +* `names`: an array of `google_bigtableadmin_project_instance_cluster_backup` name +* `source_tables`: an array of `google_bigtableadmin_project_instance_cluster_backup` source_table +* `source_backups`: an array of `google_bigtableadmin_project_instance_cluster_backup` source_backup +* `expire_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` expire_time +* `start_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` start_time +* `end_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` end_time +* `size_bytes`: an array of `google_bigtableadmin_project_instance_cluster_backup` size_bytes +* `states`: an array of `google_bigtableadmin_project_instance_cluster_backup` state +* `encryption_infos`: an array of `google_bigtableadmin_project_instance_cluster_backup` encryption_info + +## Filter Criteria +This resource supports all of the above properties as filter criteria, which can be used +with `where` as a block or a method. + +## GCP Permissions + +Ensure the [https://bigtableadmin.googleapis.com/](https://console.cloud.google.com/apis/library/bigtableadmin.googleapis.com/) is enabled for the current project. diff --git a/libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info.rb b/libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info.rb new file mode 100644 index 00000000..bca9f216 --- /dev/null +++ b/libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: false + +# ---------------------------------------------------------------------------- +# +# *** 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. +# +# ---------------------------------------------------------------------------- +require 'google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status' +module GoogleInSpec + module Bigtableadmin + module Property + class ProjectInstanceClusterBackupEncryptionInfo + attr_reader :encryption_type + + attr_reader :encryption_status + + attr_reader :kms_key_version + + def initialize(args = nil, parent_identifier = nil) + return if args.nil? + @parent_identifier = parent_identifier + @encryption_type = args['encryptionType'] + @encryption_status = GoogleInSpec::Bigtableadmin::Property::ProjectInstanceClusterBackupEncryptionInfoEncryptionStatus.new(args['encryptionStatus'], to_s) + @kms_key_version = args['kmsKeyVersion'] + end + + def to_s + "#{@parent_identifier} ProjectInstanceClusterBackupEncryptionInfo" + end + end + end + end +end diff --git a/libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status.rb b/libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status.rb new file mode 100644 index 00000000..100935e4 --- /dev/null +++ b/libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: false + +# ---------------------------------------------------------------------------- +# +# *** 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. +# +# ---------------------------------------------------------------------------- +module GoogleInSpec + module Bigtableadmin + module Property + class ProjectInstanceClusterBackupEncryptionInfoEncryptionStatus + attr_reader :code + + attr_reader :message + + attr_reader :details + + def initialize(args = nil, parent_identifier = nil) + return if args.nil? + @parent_identifier = parent_identifier + @code = args['code'] + @message = args['message'] + @details = args['details'] + end + + def to_s + "#{@parent_identifier} ProjectInstanceClusterBackupEncryptionInfoEncryptionStatus" + end + end + end + end +end diff --git a/libraries/google_bigtableadmin_project_instance_cluster_backup.rb b/libraries/google_bigtableadmin_project_instance_cluster_backup.rb new file mode 100644 index 00000000..945788c5 --- /dev/null +++ b/libraries/google_bigtableadmin_project_instance_cluster_backup.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: false + +# ---------------------------------------------------------------------------- +# +# *** 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. +# +# ---------------------------------------------------------------------------- +require 'gcp_backend' +require 'google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info' +require 'google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status' + +# A provider to manage bigtableadmin resources. +class BigtableadminProjectInstanceClusterBackup < GcpResourceBase + name 'google_bigtableadmin_project_instance_cluster_backup' + desc 'ProjectInstanceClusterBackup' + supports platform: 'gcp' + + attr_reader :params + attr_reader :name + attr_reader :source_table + attr_reader :source_backup + attr_reader :expire_time + attr_reader :start_time + attr_reader :end_time + attr_reader :size_bytes + attr_reader :state + attr_reader :encryption_info + + def initialize(params) + super(params.merge({ use_http_transport: true })) + @params = params + @fetched = @connection.fetch(product_url(params[:beta]), resource_base_url, params, 'Get') + parse unless @fetched.nil? + end + + def parse + @name = @fetched['name'] + @source_table = @fetched['sourceTable'] + @source_backup = @fetched['sourceBackup'] + @expire_time = @fetched['expireTime'] + @start_time = @fetched['startTime'] + @end_time = @fetched['endTime'] + @size_bytes = @fetched['sizeBytes'] + @state = @fetched['state'] + @encryption_info = GoogleInSpec::Bigtableadmin::Property::ProjectInstanceClusterBackupEncryptionInfo.new(@fetched['encryptionInfo'], to_s) + end + + def exists? + !@fetched.nil? + end + + def to_s + "ProjectInstanceClusterBackup #{@params[:]}" + end + + private + + def product_url(_ = nil) + 'https://bigtableadmin.googleapis.com//v2/' + end + + def resource_base_url + '{{+name}}' + end +end diff --git a/libraries/google_bigtableadmin_project_instance_cluster_backups.rb b/libraries/google_bigtableadmin_project_instance_cluster_backups.rb new file mode 100644 index 00000000..221f0730 --- /dev/null +++ b/libraries/google_bigtableadmin_project_instance_cluster_backups.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: false + +# ---------------------------------------------------------------------------- +# +# *** 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. +# +# ---------------------------------------------------------------------------- +require 'gcp_backend' +class BigtableadminProjectInstanceClusterBackups < GcpResourceBase + name 'google_bigtableadmin_project_instance_cluster_backups' + desc 'ProjectInstanceClusterBackup plural resource' + supports platform: 'gcp' + + attr_reader :table + + filter_table_config = FilterTable.create + + filter_table_config.add(:names, field: :name) + filter_table_config.add(:source_tables, field: :source_table) + filter_table_config.add(:source_backups, field: :source_backup) + filter_table_config.add(:expire_times, field: :expire_time) + filter_table_config.add(:start_times, field: :start_time) + filter_table_config.add(:end_times, field: :end_time) + filter_table_config.add(:size_bytes, field: :size_bytes) + filter_table_config.add(:states, field: :state) + filter_table_config.add(:encryption_infos, field: :encryption_info) + + filter_table_config.connect(self, :table) + + def initialize(params = {}) + super(params.merge({ use_http_transport: true })) + @params = params + @table = fetch_wrapped_resource('projectInstanceClusterBackups') + end + + def fetch_wrapped_resource(wrap_path) + # fetch_resource returns an array of responses (to handle pagination) + result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get') + return if result.nil? + + # Conversion of string -> object hash to symbol -> object hash that InSpec needs + converted = [] + result.each do |response| + next if response.nil? || !response.key?(wrap_path) + response[wrap_path].each do |hash| + hash_with_symbols = {} + hash.each_key do |key| + name, value = transform(key, hash) + hash_with_symbols[name] = value + end + converted.push(hash_with_symbols) + end + end + + converted + end + + def transform(key, value) + return transformers[key].call(value) if transformers.key?(key) + + [key.to_sym, value] + end + + def transformers + { + 'name' => ->(obj) { [:name, obj['name']] }, + 'sourceTable' => ->(obj) { [:source_table, obj['sourceTable']] }, + 'sourceBackup' => ->(obj) { [:source_backup, obj['sourceBackup']] }, + 'expireTime' => ->(obj) { [:expire_time, obj['expireTime']] }, + 'startTime' => ->(obj) { [:start_time, obj['startTime']] }, + 'endTime' => ->(obj) { [:end_time, obj['endTime']] }, + 'sizeBytes' => ->(obj) { [:size_bytes, obj['sizeBytes']] }, + 'state' => ->(obj) { [:state, obj['state']] }, + 'encryptionInfo' => ->(obj) { [:encryption_info, GoogleInSpec::Bigtableadmin::Property::ProjectInstanceClusterBackupEncryptionInfo.new(obj['encryptionInfo'], to_s)] }, + } + end + + private + + def product_url(_ = nil) + 'https://bigtableadmin.googleapis.com//v2/' + end + + def resource_base_url + '{{+parent}}/backups' + end +end diff --git a/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backup.rb b/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backup.rb new file mode 100644 index 00000000..bbd077ed --- /dev/null +++ b/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backup.rb @@ -0,0 +1,50 @@ +# ---------------------------------------------------------------------------- +# +# *** 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_bigtableadmin_project_instance_cluster_backup resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + + project_instance_cluster_backup = input('project_instance_cluster_backup', value: { + "name": "value_name", + "parent": "value_parent", + "source_table": "value_sourcetable", + "source_backup": "value_sourcebackup", + "expire_time": "value_expiretime", + "start_time": "value_starttime", + "end_time": "value_endtime", + "size_bytes": "value_sizebytes", + "state": "value_state" +}, description: 'project_instance_cluster_backup description') +control 'google_bigtableadmin_project_instance_cluster_backup-1.0' do + impact 1.0 + title 'google_bigtableadmin_project_instance_cluster_backup resource test' + + describe google_bigtableadmin_project_instance_cluster_backup(name: project_instance_cluster_backup['name']) do + it { should exist } + its('name') { should cmp project_instance_cluster_backup['name'] } + its('source_table') { should cmp project_instance_cluster_backup['source_table'] } + its('source_backup') { should cmp project_instance_cluster_backup['source_backup'] } + its('expire_time') { should cmp project_instance_cluster_backup['expire_time'] } + its('start_time') { should cmp project_instance_cluster_backup['start_time'] } + its('end_time') { should cmp project_instance_cluster_backup['end_time'] } + its('size_bytes') { should cmp project_instance_cluster_backup['size_bytes'] } + its('state') { should cmp project_instance_cluster_backup['state'] } + + end + + describe google_bigtableadmin_project_instance_cluster_backup(name: "does_not_exit") do + it { should_not exist } + end +end diff --git a/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backups.rb b/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backups.rb new file mode 100644 index 00000000..91cd4a02 --- /dev/null +++ b/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backups.rb @@ -0,0 +1,37 @@ +# ---------------------------------------------------------------------------- +# +# *** 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_bigtableadmin_project_instance_cluster_backups resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + + project_instance_cluster_backup = input('project_instance_cluster_backup', value: { + "name": "value_name", + "parent": "value_parent", + "source_table": "value_sourcetable", + "source_backup": "value_sourcebackup", + "expire_time": "value_expiretime", + "start_time": "value_starttime", + "end_time": "value_endtime", + "size_bytes": "value_sizebytes", + "state": "value_state" +}, description: 'project_instance_cluster_backup description') +control 'google_bigtableadmin_project_instance_cluster_backups-1.0' do + impact 1.0 + title 'google_bigtableadmin_project_instance_cluster_backups resource test' + + describe google_bigtableadmin_project_instance_cluster_backups(parent: project_instance_cluster_backup['parent']) do + it { should exist } + end +end From 690ce088714d0e3ecb84a095d3e303bdd646550d Mon Sep 17 00:00:00 2001 From: balasubramanian-s Date: Tue, 24 Sep 2024 13:00:10 +0530 Subject: [PATCH 2/2] updated resource name and testcases Signed-off-by: balasubramanian-s --- ...=> google_bigtableadmin_cluster_backup.md} | 19 +++-- .../google_bigtableadmin_cluster_backups.md | 72 +++++++++++++++++++ ...eadmin_project_instance_cluster_backups.md | 64 ----------------- ...fo.rb => clusterbackup_encryption_info.rb} | 8 +-- ...ckup_encryption_info_encryption_status.rb} | 4 +- ...=> google_bigtableadmin_cluster_backup.rb} | 18 ++--- ...> google_bigtableadmin_cluster_backups.rb} | 14 ++-- .../google_bigtableadmin_cluster_backup.rb | 48 +++++++++++++ .../google_bigtableadmin_cluster_backups.rb | 43 +++++++++++ ...leadmin_project_instance_cluster_backup.rb | 50 ------------- ...eadmin_project_instance_cluster_backups.rb | 37 ---------- 11 files changed, 194 insertions(+), 183 deletions(-) rename docs/resources/{google_bigtableadmin_project_instance_cluster_backup.md => google_bigtableadmin_cluster_backup.md} (81%) create mode 100644 docs/resources/google_bigtableadmin_cluster_backups.md delete mode 100644 docs/resources/google_bigtableadmin_project_instance_cluster_backups.md rename libraries/google/bigtableadmin/property/{projectinstanceclusterbackup_encryption_info.rb => clusterbackup_encryption_info.rb} (77%) rename libraries/google/bigtableadmin/property/{projectinstanceclusterbackup_encryption_info_encryption_status.rb => clusterbackup_encryption_info_encryption_status.rb} (86%) rename libraries/{google_bigtableadmin_project_instance_cluster_backup.rb => google_bigtableadmin_cluster_backup.rb} (73%) rename libraries/{google_bigtableadmin_project_instance_cluster_backups.rb => google_bigtableadmin_cluster_backups.rb} (87%) create mode 100644 test/integration/verify/controls/google_bigtableadmin_cluster_backup.rb create mode 100644 test/integration/verify/controls/google_bigtableadmin_cluster_backups.rb delete mode 100644 test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backup.rb delete mode 100644 test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backups.rb diff --git a/docs/resources/google_bigtableadmin_project_instance_cluster_backup.md b/docs/resources/google_bigtableadmin_cluster_backup.md similarity index 81% rename from docs/resources/google_bigtableadmin_project_instance_cluster_backup.md rename to docs/resources/google_bigtableadmin_cluster_backup.md index fe1ffe7d..2d208f40 100644 --- a/docs/resources/google_bigtableadmin_project_instance_cluster_backup.md +++ b/docs/resources/google_bigtableadmin_cluster_backup.md @@ -1,6 +1,6 @@ +++ -title = "google_bigtableadmin_project_instance_cluster_backup Resource" +title = "google_bigtableadmin_cluster_backup Resource" platform = "gcp" draft = false gh_repo = "inspec-gcp" @@ -8,22 +8,22 @@ gh_repo = "inspec-gcp" [menu.inspec] -title = "google_bigtableadmin_project_instance_cluster_backup" -identifier = "inspec/resources/gcp/google_bigtableadmin_project_instance_cluster_backup Resource" +title = "google_bigtableadmin_cluster_backup" +identifier = "inspec/resources/gcp/google_bigtableadmin_cluster_backup Resource" parent = "inspec/resources/gcp" +++ -Use the `google_bigtableadmin_project_instance_cluster_backup` InSpec audit resource to test the properties of a test a Google ProjectInstanceClusterBackup. +Use the `google_bigtableadmin_cluster_backup` InSpec audit resource to test the properties of a test a Google ClusterBackup. ## Installation {{% inspec_gcp_install %}} ## Syntax -A `google_bigtableadmin_project_instance_cluster_backup` is used to test a Google ProjectInstanceClusterBackup resource +A `google_bigtableadmin_cluster_backup` is used to test a Google ClusterBackup resource ## Examples ``` -describe google_bigtableadmin_project_instance_cluster_backup(name: ' value_name') do +describe google_bigtableadmin_cluster_backup(name: ' value_name') do it { should exist } its('name') { should cmp 'value_name' } its('source_table') { should cmp 'value_sourcetable' } @@ -33,19 +33,18 @@ describe google_bigtableadmin_project_instance_cluster_backup(name: ' value_name its('end_time') { should cmp 'value_endtime' } its('size_bytes') { should cmp 'value_sizebytes' } its('state') { should cmp 'value_state' } - end -describe google_bigtableadmin_project_instance_cluster_backup(name: "does_not_exit") do +describe google_bigtableadmin_cluster_backup(name: "does_not_exit") do it { should_not exist } end ``` ## Parameters -Properties that can be accessed from the `google_bigtableadmin_project_instance_cluster_backup` resource: +Properties that can be accessed from the `google_bigtableadmin_cluster_backup` resource: ## Properties -Properties that can be accessed from the `google_bigtableadmin_project_instance_cluster_backup` resource: +Properties that can be accessed from the `google_bigtableadmin_cluster_backup` resource: * `name`: A globally unique identifier for the backup which cannot be changed. Values are of the form `projects/{project}/instances/{instance}/clusters/{cluster}/ backups/_a-zA-Z0-9*` The final segment of the name must be between 1 and 50 characters in length. The backup is stored in the cluster identified by the prefix of the backup name of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. diff --git a/docs/resources/google_bigtableadmin_cluster_backups.md b/docs/resources/google_bigtableadmin_cluster_backups.md new file mode 100644 index 00000000..ebbef202 --- /dev/null +++ b/docs/resources/google_bigtableadmin_cluster_backups.md @@ -0,0 +1,72 @@ ++++ + +title = "google_bigtableadmin_cluster_backups Resource" +platform = "gcp" +draft = false +gh_repo = "inspec-gcp" + + +[menu.inspec] + +title = "google_bigtableadmin_cluster_backups" +identifier = "inspec/resources/gcp/google_bigtableadmin_cluster_backups Resource" +parent = "inspec/resources/gcp" ++++ + +Use the `google_bigtableadmin_cluster_backups` InSpec audit resource to test the properties of a test a Google ClusterBackup. + +## Installation +{{% inspec_gcp_install %}} + +## Syntax +A `google_bigtableadmin_cluster_backups` is used to test a Google ClusterBackup resource + +## Examples +``` + describe google_bigtableadmin_cluster_backups(parent: 'value_parent') do + it { should exist } + its('name') { should include 'value_name' } + its('source_table') { should include 'value_sourcetable' } + its('source_backup') { should include 'value_sourcebackup' } + its('expire_time') { should include 'value_expiretime' } + its('start_time') { should include 'value_starttime' } + its('end_time') { should include 'value_endtime' } + its('size_bytes') { should include 'value_sizebytes' } + its('state') { should include 'value_state' } + end +``` + +## Parameters +Properties that can be accessed from the `google_bigtableadmin_cluster_backups` resource: + +See [google_bigtableadmin_cluster_backup.md](google_bigtableadmin_cluster_backup.md) for more detailed information +* `names`: an array of `google_bigtableadmin_cluster_backup` name +* `source_tables`: an array of `google_bigtableadmin_cluster_backup` source_table +* `source_backups`: an array of `google_bigtableadmin_cluster_backup` source_backup +* `expire_times`: an array of `google_bigtableadmin_cluster_backup` expire_time +* `start_times`: an array of `google_bigtableadmin_cluster_backup` start_time +* `end_times`: an array of `google_bigtableadmin_cluster_backup` end_time +* `size_bytes`: an array of `google_bigtableadmin_cluster_backup` size_bytes +* `states`: an array of `google_bigtableadmin_cluster_backup` state +* `encryption_infos`: an array of `google_bigtableadmin_cluster_backup` encryption_info +## Properties +Properties that can be accessed from the `google_bigtableadmin_cluster_backups` resource: + +See [google_bigtableadmin_cluster_backup.md](google_bigtableadmin_cluster_backup.md) for more detailed information +* `names`: an array of `google_bigtableadmin_cluster_backup` name +* `source_tables`: an array of `google_bigtableadmin_cluster_backup` source_table +* `source_backups`: an array of `google_bigtableadmin_cluster_backup` source_backup +* `expire_times`: an array of `google_bigtableadmin_cluster_backup` expire_time +* `start_times`: an array of `google_bigtableadmin_cluster_backup` start_time +* `end_times`: an array of `google_bigtableadmin_cluster_backup` end_time +* `size_bytes`: an array of `google_bigtableadmin_cluster_backup` size_bytes +* `states`: an array of `google_bigtableadmin_cluster_backup` state +* `encryption_infos`: an array of `google_bigtableadmin_cluster_backup` encryption_info + +## Filter Criteria +This resource supports all of the above properties as filter criteria, which can be used +with `where` as a block or a method. + +## GCP Permissions + +Ensure the [https://bigtableadmin.googleapis.com/](https://console.cloud.google.com/apis/library/bigtableadmin.googleapis.com/) is enabled for the current project. diff --git a/docs/resources/google_bigtableadmin_project_instance_cluster_backups.md b/docs/resources/google_bigtableadmin_project_instance_cluster_backups.md deleted file mode 100644 index 4ddd42cb..00000000 --- a/docs/resources/google_bigtableadmin_project_instance_cluster_backups.md +++ /dev/null @@ -1,64 +0,0 @@ -+++ - -title = "google_bigtableadmin_project_instance_cluster_backups Resource" -platform = "gcp" -draft = false -gh_repo = "inspec-gcp" - - -[menu.inspec] - -title = "google_bigtableadmin_project_instance_cluster_backups" -identifier = "inspec/resources/gcp/google_bigtableadmin_project_instance_cluster_backups Resource" -parent = "inspec/resources/gcp" -+++ - -Use the `google_bigtableadmin_project_instance_cluster_backups` InSpec audit resource to test the properties of a test a Google ProjectInstanceClusterBackup. - -## Installation -{{% inspec_gcp_install %}} - -## Syntax -A `google_bigtableadmin_project_instance_cluster_backups` is used to test a Google ProjectInstanceClusterBackup resource - -## Examples -``` - describe google_bigtableadmin_project_instance_cluster_backups(parent: ' value_parent') do - it { should exist } - end -``` - -## Parameters -Properties that can be accessed from the `google_bigtableadmin_project_instance_cluster_backups` resource: - -See [google_bigtableadmin_project_instance_cluster_backup.md](google_bigtableadmin_project_instance_cluster_backup.md) for more detailed information -* `names`: an array of `google_bigtableadmin_project_instance_cluster_backup` name -* `source_tables`: an array of `google_bigtableadmin_project_instance_cluster_backup` source_table -* `source_backups`: an array of `google_bigtableadmin_project_instance_cluster_backup` source_backup -* `expire_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` expire_time -* `start_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` start_time -* `end_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` end_time -* `size_bytes`: an array of `google_bigtableadmin_project_instance_cluster_backup` size_bytes -* `states`: an array of `google_bigtableadmin_project_instance_cluster_backup` state -* `encryption_infos`: an array of `google_bigtableadmin_project_instance_cluster_backup` encryption_info -## Properties -Properties that can be accessed from the `google_bigtableadmin_project_instance_cluster_backups` resource: - -See [google_bigtableadmin_project_instance_cluster_backup.md](google_bigtableadmin_project_instance_cluster_backup.md) for more detailed information -* `names`: an array of `google_bigtableadmin_project_instance_cluster_backup` name -* `source_tables`: an array of `google_bigtableadmin_project_instance_cluster_backup` source_table -* `source_backups`: an array of `google_bigtableadmin_project_instance_cluster_backup` source_backup -* `expire_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` expire_time -* `start_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` start_time -* `end_times`: an array of `google_bigtableadmin_project_instance_cluster_backup` end_time -* `size_bytes`: an array of `google_bigtableadmin_project_instance_cluster_backup` size_bytes -* `states`: an array of `google_bigtableadmin_project_instance_cluster_backup` state -* `encryption_infos`: an array of `google_bigtableadmin_project_instance_cluster_backup` encryption_info - -## Filter Criteria -This resource supports all of the above properties as filter criteria, which can be used -with `where` as a block or a method. - -## GCP Permissions - -Ensure the [https://bigtableadmin.googleapis.com/](https://console.cloud.google.com/apis/library/bigtableadmin.googleapis.com/) is enabled for the current project. diff --git a/libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info.rb b/libraries/google/bigtableadmin/property/clusterbackup_encryption_info.rb similarity index 77% rename from libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info.rb rename to libraries/google/bigtableadmin/property/clusterbackup_encryption_info.rb index bca9f216..e8f42fa3 100644 --- a/libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info.rb +++ b/libraries/google/bigtableadmin/property/clusterbackup_encryption_info.rb @@ -13,11 +13,11 @@ # CONTRIBUTING.md located at the root of this package. # # ---------------------------------------------------------------------------- -require 'google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status' +require 'google/bigtableadmin/property/clusterbackup_encryption_info_encryption_status' module GoogleInSpec module Bigtableadmin module Property - class ProjectInstanceClusterBackupEncryptionInfo + class ClusterBackupEncryptionInfo attr_reader :encryption_type attr_reader :encryption_status @@ -28,12 +28,12 @@ def initialize(args = nil, parent_identifier = nil) return if args.nil? @parent_identifier = parent_identifier @encryption_type = args['encryptionType'] - @encryption_status = GoogleInSpec::Bigtableadmin::Property::ProjectInstanceClusterBackupEncryptionInfoEncryptionStatus.new(args['encryptionStatus'], to_s) + @encryption_status = GoogleInSpec::Bigtableadmin::Property::ClusterBackupEncryptionInfoEncryptionStatus.new(args['encryptionStatus'], to_s) @kms_key_version = args['kmsKeyVersion'] end def to_s - "#{@parent_identifier} ProjectInstanceClusterBackupEncryptionInfo" + "#{@parent_identifier} ClusterBackupEncryptionInfo" end end end diff --git a/libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status.rb b/libraries/google/bigtableadmin/property/clusterbackup_encryption_info_encryption_status.rb similarity index 86% rename from libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status.rb rename to libraries/google/bigtableadmin/property/clusterbackup_encryption_info_encryption_status.rb index 100935e4..f5dee67b 100644 --- a/libraries/google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status.rb +++ b/libraries/google/bigtableadmin/property/clusterbackup_encryption_info_encryption_status.rb @@ -16,7 +16,7 @@ module GoogleInSpec module Bigtableadmin module Property - class ProjectInstanceClusterBackupEncryptionInfoEncryptionStatus + class ClusterBackupEncryptionInfoEncryptionStatus attr_reader :code attr_reader :message @@ -32,7 +32,7 @@ def initialize(args = nil, parent_identifier = nil) end def to_s - "#{@parent_identifier} ProjectInstanceClusterBackupEncryptionInfoEncryptionStatus" + "#{@parent_identifier} ClusterBackupEncryptionInfoEncryptionStatus" end end end diff --git a/libraries/google_bigtableadmin_project_instance_cluster_backup.rb b/libraries/google_bigtableadmin_cluster_backup.rb similarity index 73% rename from libraries/google_bigtableadmin_project_instance_cluster_backup.rb rename to libraries/google_bigtableadmin_cluster_backup.rb index 945788c5..fff4c921 100644 --- a/libraries/google_bigtableadmin_project_instance_cluster_backup.rb +++ b/libraries/google_bigtableadmin_cluster_backup.rb @@ -14,13 +14,13 @@ # # ---------------------------------------------------------------------------- require 'gcp_backend' -require 'google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info' -require 'google/bigtableadmin/property/projectinstanceclusterbackup_encryption_info_encryption_status' +require 'google/bigtableadmin/property/clusterbackup_encryption_info' +require 'google/bigtableadmin/property/clusterbackup_encryption_info_encryption_status' # A provider to manage bigtableadmin resources. -class BigtableadminProjectInstanceClusterBackup < GcpResourceBase - name 'google_bigtableadmin_project_instance_cluster_backup' - desc 'ProjectInstanceClusterBackup' +class BigtableadminClusterBackup < GcpResourceBase + name 'google_bigtableadmin_cluster_backup' + desc 'ClusterBackup' supports platform: 'gcp' attr_reader :params @@ -50,7 +50,7 @@ def parse @end_time = @fetched['endTime'] @size_bytes = @fetched['sizeBytes'] @state = @fetched['state'] - @encryption_info = GoogleInSpec::Bigtableadmin::Property::ProjectInstanceClusterBackupEncryptionInfo.new(@fetched['encryptionInfo'], to_s) + @encryption_info = GoogleInSpec::Bigtableadmin::Property::ClusterBackupEncryptionInfo.new(@fetched['encryptionInfo'], to_s) end def exists? @@ -58,16 +58,16 @@ def exists? end def to_s - "ProjectInstanceClusterBackup #{@params[:]}" + "ClusterBackup #{@params[:name]}" end private def product_url(_ = nil) - 'https://bigtableadmin.googleapis.com//v2/' + 'https://bigtableadmin.googleapis.com/v2/' end def resource_base_url - '{{+name}}' + '{{name}}' end end diff --git a/libraries/google_bigtableadmin_project_instance_cluster_backups.rb b/libraries/google_bigtableadmin_cluster_backups.rb similarity index 87% rename from libraries/google_bigtableadmin_project_instance_cluster_backups.rb rename to libraries/google_bigtableadmin_cluster_backups.rb index 221f0730..d4d794d3 100644 --- a/libraries/google_bigtableadmin_project_instance_cluster_backups.rb +++ b/libraries/google_bigtableadmin_cluster_backups.rb @@ -14,9 +14,9 @@ # # ---------------------------------------------------------------------------- require 'gcp_backend' -class BigtableadminProjectInstanceClusterBackups < GcpResourceBase - name 'google_bigtableadmin_project_instance_cluster_backups' - desc 'ProjectInstanceClusterBackup plural resource' +class BigtableadminClusterBackups < GcpResourceBase + name 'google_bigtableadmin_cluster_backups' + desc 'ClusterBackup plural resource' supports platform: 'gcp' attr_reader :table @@ -38,7 +38,7 @@ class BigtableadminProjectInstanceClusterBackups < GcpResourceBase def initialize(params = {}) super(params.merge({ use_http_transport: true })) @params = params - @table = fetch_wrapped_resource('projectInstanceClusterBackups') + @table = fetch_wrapped_resource('backups') end def fetch_wrapped_resource(wrap_path) @@ -79,17 +79,17 @@ def transformers 'endTime' => ->(obj) { [:end_time, obj['endTime']] }, 'sizeBytes' => ->(obj) { [:size_bytes, obj['sizeBytes']] }, 'state' => ->(obj) { [:state, obj['state']] }, - 'encryptionInfo' => ->(obj) { [:encryption_info, GoogleInSpec::Bigtableadmin::Property::ProjectInstanceClusterBackupEncryptionInfo.new(obj['encryptionInfo'], to_s)] }, + 'encryptionInfo' => ->(obj) { [:encryption_info, GoogleInSpec::Bigtableadmin::Property::ClusterBackupEncryptionInfo.new(obj['encryptionInfo'], to_s)] }, } end private def product_url(_ = nil) - 'https://bigtableadmin.googleapis.com//v2/' + 'https://bigtableadmin.googleapis.com/v2/' end def resource_base_url - '{{+parent}}/backups' + '{{parent}}/backups' end end diff --git a/test/integration/verify/controls/google_bigtableadmin_cluster_backup.rb b/test/integration/verify/controls/google_bigtableadmin_cluster_backup.rb new file mode 100644 index 00000000..75e5321b --- /dev/null +++ b/test/integration/verify/controls/google_bigtableadmin_cluster_backup.rb @@ -0,0 +1,48 @@ +# ---------------------------------------------------------------------------- +# +# *** 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_bigtableadmin_cluster_backup resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + + cluster_backup = input('cluster_backup', value: { + "name": "projects/ppradhan/instances/inspec-test/clusters/inspec-test-c1/backups/inspec-day1-backup", + "parent": "projects/ppradhan/instances/inspec-test/clusters/inspec-test-c1", + "source_table": "projects/ppradhan/instances/inspec-test/tables/inspec", + "source_backup": "value_sourcebackup", + "expire_time": "2024-09-25T07:08:29.584Z", + "start_time": "2024-09-24T07:08:31.252667Z", + "end_time": "2024-09-24T07:08:31.627350Z", + "size_bytes": "value_sizebytes", + "state": "READY" +}, description: 'cluster_backup description') +control 'google_bigtableadmin_cluster_backup-1.0' do + impact 1.0 + title 'google_bigtableadmin_cluster_backup resource test' + + describe google_bigtableadmin_cluster_backup(name: cluster_backup['name']) do + it { should exist } + its('name') { should cmp cluster_backup['name'] } + its('source_table') { should cmp cluster_backup['source_table'] } + its('expire_time') { should cmp cluster_backup['expire_time'] } + its('start_time') { should cmp cluster_backup['start_time'] } + its('end_time') { should cmp cluster_backup['end_time'] } + its('state') { should cmp cluster_backup['state'] } + + end + + describe google_bigtableadmin_cluster_backup(name: "does_not_exit") do + it { should_not exist } + end +end diff --git a/test/integration/verify/controls/google_bigtableadmin_cluster_backups.rb b/test/integration/verify/controls/google_bigtableadmin_cluster_backups.rb new file mode 100644 index 00000000..21b9e3f2 --- /dev/null +++ b/test/integration/verify/controls/google_bigtableadmin_cluster_backups.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_bigtableadmin_cluster_backups resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + + cluster_backup = input('cluster_backup', value: { + "name": "projects/ppradhan/instances/inspec-test/clusters/inspec-test-c1/backups/inspec-day1-backup", + "parent": "projects/ppradhan/instances/inspec-test/clusters/inspec-test-c1", + "source_table": "projects/ppradhan/instances/inspec-test/tables/inspec", + "source_backup": "value_sourcebackup", + "expire_time": "2024-09-25T07:08:29.584Z", + "start_time": "2024-09-24T07:08:31.252667Z", + "end_time": "2024-09-24T07:08:31.627350Z", + "size_bytes": "value_sizebytes", + "state": "READY" +}, description: 'cluster_backup description') +control 'google_bigtableadmin_cluster_backups-1.0' do + impact 1.0 + title 'google_bigtableadmin_cluster_backups resource test' + + describe google_bigtableadmin_cluster_backups(parent: cluster_backup['parent']) do + it { should exist } + its('names') { should include cluster_backup['name'] } + its('source_tables') { should include cluster_backup['source_table'] } + its('expire_times') { should include cluster_backup['expire_time'] } + its('start_times') { should include cluster_backup['start_time'] } + its('end_times') { should include cluster_backup['end_time'] } + its('states') { should include cluster_backup['state'] } + end +end diff --git a/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backup.rb b/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backup.rb deleted file mode 100644 index bbd077ed..00000000 --- a/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backup.rb +++ /dev/null @@ -1,50 +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_bigtableadmin_project_instance_cluster_backup resource.' - -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') - - project_instance_cluster_backup = input('project_instance_cluster_backup', value: { - "name": "value_name", - "parent": "value_parent", - "source_table": "value_sourcetable", - "source_backup": "value_sourcebackup", - "expire_time": "value_expiretime", - "start_time": "value_starttime", - "end_time": "value_endtime", - "size_bytes": "value_sizebytes", - "state": "value_state" -}, description: 'project_instance_cluster_backup description') -control 'google_bigtableadmin_project_instance_cluster_backup-1.0' do - impact 1.0 - title 'google_bigtableadmin_project_instance_cluster_backup resource test' - - describe google_bigtableadmin_project_instance_cluster_backup(name: project_instance_cluster_backup['name']) do - it { should exist } - its('name') { should cmp project_instance_cluster_backup['name'] } - its('source_table') { should cmp project_instance_cluster_backup['source_table'] } - its('source_backup') { should cmp project_instance_cluster_backup['source_backup'] } - its('expire_time') { should cmp project_instance_cluster_backup['expire_time'] } - its('start_time') { should cmp project_instance_cluster_backup['start_time'] } - its('end_time') { should cmp project_instance_cluster_backup['end_time'] } - its('size_bytes') { should cmp project_instance_cluster_backup['size_bytes'] } - its('state') { should cmp project_instance_cluster_backup['state'] } - - end - - describe google_bigtableadmin_project_instance_cluster_backup(name: "does_not_exit") do - it { should_not exist } - end -end diff --git a/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backups.rb b/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backups.rb deleted file mode 100644 index 91cd4a02..00000000 --- a/test/integration/verify/controls/google_bigtableadmin_project_instance_cluster_backups.rb +++ /dev/null @@ -1,37 +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_bigtableadmin_project_instance_cluster_backups resource.' - -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') - - project_instance_cluster_backup = input('project_instance_cluster_backup', value: { - "name": "value_name", - "parent": "value_parent", - "source_table": "value_sourcetable", - "source_backup": "value_sourcebackup", - "expire_time": "value_expiretime", - "start_time": "value_starttime", - "end_time": "value_endtime", - "size_bytes": "value_sizebytes", - "state": "value_state" -}, description: 'project_instance_cluster_backup description') -control 'google_bigtableadmin_project_instance_cluster_backups-1.0' do - impact 1.0 - title 'google_bigtableadmin_project_instance_cluster_backups resource test' - - describe google_bigtableadmin_project_instance_cluster_backups(parent: project_instance_cluster_backup['parent']) do - it { should exist } - end -end