...

Text file src/github.com/GoogleCloudPlatform/k8s-config-connector/config/servicemappings/resourcemanager.yaml

Documentation: github.com/GoogleCloudPlatform/k8s-config-connector/config/servicemappings

     1# Copyright 2022 Google LLC
     2#
     3# Licensed under the Apache License, Version 2.0 (the "License");
     4# you may not use this file except in compliance with the License.
     5# You may obtain a copy of the License at
     6#
     7#      http://www.apache.org/licenses/LICENSE-2.0
     8#
     9# Unless required by applicable law or agreed to in writing, software
    10# distributed under the License is distributed on an "AS IS" BASIS,
    11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12# See the License for the specific language governing permissions and
    13# limitations under the License.
    14
    15apiVersion: core.cnrm.cloud.google.com/v1alpha1
    16kind: ServiceMapping
    17metadata:
    18  name: resourcemanager.cnrm.cloud.google.com
    19  namespace: cnrm-system
    20spec:
    21  name: ResourceManager
    22  version: v1beta1
    23  serviceHostName: "cloudresourcemanager.googleapis.com"
    24  resources:
    25    - name: google_folder
    26      kind: Folder
    27      serverGeneratedIDField: name
    28      idTemplateCanBeUsedToMatchResourceName: false
    29      resourceAvailableInAssetInventory: true
    30      resourceID:
    31        targetField: name
    32        valueTemplate: "folders/{{value}}"
    33      iamConfig:
    34        policyName: google_folder_iam_policy
    35        policyMemberName: google_folder_iam_member
    36        auditConfigName: google_folder_iam_audit_config
    37        referenceField:
    38          name: folder
    39          type: id
    40        supportsConditions: true
    41      resourceReferences:
    42        - key: folderRef
    43          tfField: parent_folder_id
    44          description: |-
    45            The folder that this resource belongs to. Changing this forces the
    46            resource to be migrated to the newly specified folder. Only one of
    47            folderRef or organizationRef may be specified.
    48          gvk:
    49            kind: Folder
    50            version: v1beta1
    51            group: resourcemanager.cnrm.cloud.google.com
    52          targetField: folder_id
    53        - key: organizationRef
    54          tfField: parent_org_id
    55          description: |-
    56            The organization that this resource belongs to. Changing this
    57            forces the resource to be migrated to the newly specified
    58            organization. Only one of folderRef or organizationRef may be
    59            specified.
    60          gvk:
    61            group: resourcemanager.cnrm.cloud.google.com
    62            version: v1beta1
    63            kind: Organization
    64      containers:
    65        - type: folder
    66          tfField: parent_folder_id
    67        - type: organization
    68          tfField: parent_org_id
    69      hierarchicalReferences:
    70        - type: folder
    71          key: folderRef
    72        - type: organization
    73          key: organizationRef
    74    - name: google_org_policy
    75      kind: ResourceManagerPolicy
    76      # Due to this being a custom KCC-only resource, the ID template is
    77      # in a non-standard format to more easily allow for TF resource
    78      # multiplexing.
    79      idTemplate: "{{project?}}#{{folder?}}#{{org_id?}}#{{constraint}}"
    80      #  This TF resource has a custom crafted import ID that has an arbitrary format that is not able to be mapped
    81      # cleanly to a URI, due to being a combination of multiple underlying resources.
    82      idTemplateCanBeUsedToMatchResourceName: false
    83      resourceAvailableInAssetInventory: false
    84      resourceReferences:
    85        - tfField: project
    86          key: projectRef
    87          description: |-
    88            The project on which to configure the constraint. Only one of
    89            projectRef, folderRef, or organizationRef may be specified.
    90          gvk:
    91            group: resourcemanager.cnrm.cloud.google.com
    92            version: v1beta1
    93            kind: Project
    94          parent: true
    95        - tfField: folder
    96          key: folderRef
    97          description: |-
    98            The folder on which to configure the constraint. Only one of
    99            projectRef, folderRef, or organizationRef may be specified.
   100          gvk:
   101            group: resourcemanager.cnrm.cloud.google.com
   102            version: v1beta1
   103            kind: Folder
   104          targetField: name
   105          parent: true
   106        - tfField: org_id
   107          key: organizationRef
   108          description: |-
   109            The organization on which to configure the constraint. Only one of
   110            projectRef, folderRef, or organizationRef may be specified.
   111          gvk:
   112            group: resourcemanager.cnrm.cloud.google.com
   113            version: v1beta1
   114            kind: Organization
   115          parent: true
   116    - name: google_project
   117      kind: Project
   118      serverGeneratedIDField: number
   119      idTemplate: "projects/{{project_id}}"
   120      idTemplateCanBeUsedToMatchResourceName: true
   121      resourceAvailableInAssetInventory: true
   122      metadataMapping:
   123        name: project_id
   124        labels: labels
   125      resourceID:
   126        targetField: project_id
   127      ignoredFields:
   128        - skip_delete
   129      directives:
   130        - auto_create_network
   131      iamConfig:
   132        policyName: google_project_iam_policy
   133        policyMemberName: google_project_iam_member
   134        auditConfigName: google_project_iam_audit_config
   135        referenceField:
   136          name: project
   137          type: id
   138        supportsConditions: true
   139      resourceReferences:
   140        - key: folderRef
   141          tfField: folder_id
   142          description: |-
   143            The folder that this resource belongs to. Changing this forces the
   144            resource to be migrated to the newly specified folder. Only one of
   145            folderRef or organizationRef may be specified.
   146          gvk:
   147            kind: Folder
   148            version: v1beta1
   149            group: resourcemanager.cnrm.cloud.google.com
   150          targetField: folder_id
   151        - key: organizationRef
   152          tfField: org_id
   153          description: |-
   154            The organization that this resource belongs to. Changing this
   155            forces the resource to be migrated to the newly specified
   156            organization. Only one of folderRef or organizationRef may be
   157            specified.
   158          gvk:
   159            group: resourcemanager.cnrm.cloud.google.com
   160            version: v1beta1
   161            kind: Organization
   162        - key: billingAccountRef
   163          tfField: billing_account
   164          gvk:
   165            kind: BillingAccount
   166            version: v1beta1
   167            group: billing.cnrm.cloud.google.com
   168          targetField: name
   169      containers:
   170        - type: folder
   171          tfField: folder_id
   172        - type: organization
   173          tfField: org_id
   174      hierarchicalReferences:
   175        - type: folder
   176          key: folderRef
   177        - type: organization
   178          key: organizationRef
   179    - name: google_resource_manager_lien
   180      kind: ResourceManagerLien
   181      serverGeneratedIDField: name
   182      resourceID:
   183        targetField: name
   184      idTemplate: "{{parent}}/{{name}}"
   185      # import ID too broad
   186      idTemplateCanBeUsedToMatchResourceName: false
   187      resourceAvailableInAssetInventory: false
   188      resourceReferences:
   189        - tfField: parent
   190          types:
   191            - key: projectRef
   192              parent: true
   193              valueTemplate: projects/{{value}}
   194              targetField: "number"
   195              gvk:
   196                kind: Project
   197                version: v1beta1
   198                group: resourcemanager.cnrm.cloud.google.com

View as plain text