# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. apiVersion: core.cnrm.cloud.google.com/v1alpha1 kind: ServiceMapping metadata: name: spanner.cnrm.cloud.google.com namespace: cnrm-system spec: name: Spanner version: v1beta1 serviceHostName: "spanner.googleapis.com" resources: - name: google_spanner_database kind: SpannerDatabase metadataMapping: name: name resourceID: targetField: name resourceReferences: - tfField: instance description: |- The instance to create the database on. key: instanceRef parent: true gvk: kind: SpannerInstance version: v1beta1 group: spanner.cnrm.cloud.google.com - tfField: encryption_config.kms_key_name description: |- Fully qualified name of the KMS key to use to encrypt this database. This key must exist in the same location as the Spanner Database. key: kmsKeyRef gvk: kind: KMSCryptoKey version: v1beta1 group: kms.cnrm.cloud.google.com targetField: self_link iamConfig: policyName: google_spanner_database_iam_policy policyMemberName: google_spanner_database_iam_member referenceField: name: database type: name idTemplate: "projects/{{project}}/instances/{{instance}}/databases/{{name}}" idTemplateCanBeUsedToMatchResourceName: true resourceAvailableInAssetInventory: true ignoredFields: - deletion_protection mutableButUnreadableFields: - ddl containers: - type: project tfField: project - name: google_spanner_instance kind: SpannerInstance metadataMapping: name: name labels: labels resourceID: targetField: name idTemplate: "projects/{{project}}/instances/{{name}}" idTemplateCanBeUsedToMatchResourceName: true resourceAvailableInAssetInventory: true iamConfig: policyName: google_spanner_instance_iam_policy policyMemberName: google_spanner_instance_iam_member referenceField: name: instance type: name directives: - force_destroy containers: - type: project tfField: project