# 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: servicedirectory.cnrm.cloud.google.com namespace: cnrm-system spec: name: ServiceDirectory version: v1beta1 serviceHostName: "servicedirectory.googleapis.com" resources: - name: google_service_directory_endpoint kind: ServiceDirectoryEndpoint idTemplate: "{{service}}/endpoints/{{endpoint_id}}" idTemplateCanBeUsedToMatchResourceName: true resourceAvailableInAssetInventory: false metadataMapping: name: endpoint_id labels: metadata resourceID: targetField: endpoint_id resourceReferences: - tfField: service description: |- The ServiceDirectoryService that this endpoint belongs to. key: serviceRef gvk: kind: ServiceDirectoryService version: v1beta1 group: servicedirectory.cnrm.cloud.google.com targetField: name parent: true - tfField: network key: networkRef gvk: kind: ComputeNetwork version: v1beta1 group: compute.cnrm.cloud.google.com targetField: self_link # TODO(b/235854488): remove external-only field description once project id is allowed for networkRef description: |- Only the `external` field is supported to configure the reference. Immutable. The Google Compute Engine network (VPC) of the endpoint in the format projects//locations/global/networks/*. The project must be specified by project number (project id is rejected). Incorrectly formatted networks are rejected, but no other validation is performed on this field (ex. network or project existence, reachability, or permissions). - tfField: address key: addressRef gvk: kind: ComputeAddress version: v1beta1 group: compute.cnrm.cloud.google.com targetField: address - name: google_service_directory_namespace kind: ServiceDirectoryNamespace idTemplate: "projects/{{project}}/locations/{{location}}/namespaces/{{namespace_id}}" idTemplateCanBeUsedToMatchResourceName: true resourceAvailableInAssetInventory: true metadataMapping: name: namespace_id labels: labels resourceID: targetField: namespace_id iamConfig: policyName: google_service_directory_namespace_iam_policy policyMemberName: google_service_directory_namespace_iam_member referenceField: name: name type: name supportsConditions: false hierarchicalReferences: - type: project key: projectRef resourceReferences: - key: projectRef tfField: project description: |- The project that this resource belongs to. gvk: kind: Project version: v1beta1 group: resourcemanager.cnrm.cloud.google.com - name: google_service_directory_service kind: ServiceDirectoryService idTemplate: "{{namespace}}/services/{{service_id}}" idTemplateCanBeUsedToMatchResourceName: true resourceAvailableInAssetInventory: false metadataMapping: name: service_id labels: metadata resourceID: targetField: service_id resourceReferences: - tfField: namespace description: |- The ServiceDirectoryNamespace that this service belongs to. key: namespaceRef gvk: kind: ServiceDirectoryNamespace version: v1beta1 group: servicedirectory.cnrm.cloud.google.com targetField: name parent: true iamConfig: policyName: google_service_directory_service_iam_policy policyMemberName: google_service_directory_service_iam_member referenceField: name: name type: name supportsConditions: false