[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eConfig Connector can create resources if they don't exist, or acquire and manage existing Google Cloud resources if they have the same name.\u003c/p\u003e\n"],["\u003cp\u003eAcquisition of existing resources is possible when the manifest values match the existing resource name, or resource ID for resources without a name.\u003c/p\u003e\n"],["\u003cp\u003eCertain resources, which have service-generated IDs, can only be acquired using the \u003ccode\u003eresourceID\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eBy default, deleting a Config Connector resource will also delete the corresponding Google Cloud resource, but this behavior can be changed by setting the \u003ccode\u003edeletion-policy\u003c/code\u003e to \u003ccode\u003eabandon\u003c/code\u003e in the resource's YAML.\u003c/p\u003e\n"],["\u003cp\u003eSome resources, such as \u003ccode\u003eDataflowFlexTemplateJob\u003c/code\u003e, \u003ccode\u003eFirestoreIndex\u003c/code\u003e, and \u003ccode\u003eIAMServiceAccountKey\u003c/code\u003e, cannot be acquired by Config Connector.\u003c/p\u003e\n"]]],[],null,["# Managing and deleting resources\n===============================\n\n*** ** * ** ***\n\nLearn how Config Connector\n[manages an existing resource](#acquiring_an_existing_resource) and handles\n[deleting resources](#keeping_resources_after_deletion).\n\nCreating a resource\n-------------------\n\nWhen you create a resource, Config Connector creates the resource if it doesn't\nexist. If a Google Cloud resource already exists with the same name, then\nConfig Connector acquires the resource and manages it.\n\nTo learn more about creating resources, see\n[Getting started](/config-connector/docs/how-to/getting-started#create_spanner-instanceyaml).\n\nYou can also manage the resources using the `resourceID` field. To learn more,\nsee\n[Managing resources with the `resourceID` field](/config-connector/docs/how-to/managing-resources-with-resource-ids).\n\nAcquiring an existing resource\n------------------------------\n\nThis section describes how you acquire an existing BigQuery resource\nwith Config Connector.\n| **Note:** Some resources can only be acquired by using the `resourceID` field, and some cannot be acquired at all. To learn more, see [Resources with restrictions\n| around acquisition](#resources_with_restrictions_around_acquisition).\n\n#### Before you begin\n\n1. [Enable the BigQuery API](https://console.cloud.google.com/apis/library/bigquery.googleapis.com?q=bigquery).\n2. Confirm you have access to the [`bq`](/bigquery/docs/bq-command-line-tool) command line tool. If you don't have `bq`, use [Cloud Shell](https://console.cloud.google.com/kubernetes/list?cloudshell=true) or install it with the [gcloud CLI](/sdk/install).\n\n#### Acquiring a BigQuery dataset\n\nConfig Connector acquires, or takes control of, resources when the values in the\nmanifest and the resource name\nmatch. If a resource does not have a name (for example, a Project ID), the ID of\nthe resource is used.\n\nBy creating an empty BigQuery dataset and then acquiring the dataset\nwith Config Connector, you learn how Config Connector handles existing\nresources.\n\n1. Create a BigQuery dataset named `bigquerydatasetsample` with `bq`.\n\n bq --location=US mk \\\n --dataset \\\n --default_table_expiration 3600 \\\n --description description \\\n PROJECT_ID:bigquerydatasetsample\n\n2. Copy the following contents into a file named `bq-sample.yaml`.\n\n apiVersion: bigquery.cnrm.cloud.google.com/v1beta1\n kind: BigQueryDataset\n metadata:\n name: bigquerydatasetsample\n spec:\n defaultTableExpirationMs: 3600000\n description: \"BigQuery Dataset Sample\"\n friendlyName: bigquerydataset-sample\n location: US\n\n3. Apply the yaml to your cluster.\n\n ```\n kubectl apply --namespace CC_NAMESPACE -f bq-sample.yaml\n ```\n\n Replace \u003cvar translate=\"no\"\u003eCC_NAMESPACE\u003c/var\u003e with the namespace Config Connector\n manages resources from.\n4. Use `kubectl describe` to see details on the dataset.\n\n ```\n kubectl describe --namespace CC_NAMESPACE bigquerydataset bigquerydatasetsample\n ```\n\n Replace \u003cvar translate=\"no\"\u003eCC_NAMESPACE\u003c/var\u003e with the namespace Config Connector\n manages resources from.\n\n The output from `kubectl describe` includes metadata on the resource's status\n and ownership.\n\n#### Deleting the dataset\n\nBy default, after Config Connector acquires and manages a resource, deleting the\nobject from your cluster will delete the resource. If you prefer to keep the\ndataset, set the resource's\n[`deletion-policy`](#keeping_resources_after_deletion).\n\nFor example, deleting the manifest that acquired `bigquerydataset-sample` will\ndelete the dataset from BigQuery.\n\n1. You can delete the `bigquerydataset-sample` dataset with `kubectl delete`.\n\n ```\n kubectl delete --namespace CC_NAMESPACE -f bq-sample.yaml\n ```\n\n Replace \u003cvar translate=\"no\"\u003eCC_NAMESPACE\u003c/var\u003e with the namespace Config Connector\n manages resources from.\n\n The output of `kubectl` confirms the deletion.\n `bigquerydataset.bigquery.cnrm.cloud.google.com \"bigquerydatasetsample\" deleted`\n2. Use `bq` to confirm the dataset no longer exists.\n\n ```\n bq show PROJECT_ID:bigquerydatasetsample\n ```\n\n The output of the command includes `Not Found`.\n\nResources with restrictions around acquisition\n----------------------------------------------\n\n### Resources with a service-generated resource ID\n\nYou can only acquire Google Cloud resources which have a\n[service-generated resource\nID](/config-connector/docs/how-to/managing-resources-with-resource-ids#types_of_resource_ids)\nby using the `resourceID` field.\n\nThe following Config Connector resources correspond to Google Cloud\nresources which have a service-generated resource ID:\n\n- `AccessContextManagerAccessPolicy`\n- `ApigeeOrganization`\n- `BillingBudgetsBudget`\n- `CloudIdentityGroup`\n- `CloudIdentityMembership`\n- `ComputeFirewallPolicy`\n- `DLPDeidentifyTemplate`\n- `DLPInspectTemplate`\n- `DLPJobTrigger`\n- `DLPStoredInfoType`\n- `Folder`\n- `IAPBrand`\n- `IAPIdentityAwareProxyClient`\n- `IdentityPlatformTenant`\n- `MonitoringAlertPolicy`\n- `MonitoringGroup`\n- `MonitoringNotificationChannel`\n- `MonitoringUptimeCheckConfig`\n- `RecaptchaEnterpriseKey`\n- `ResourceManagerLien`\n- `SQLSSLCert`\n- `SecretManagerSecretVersion`\n- `StorageNotification`\n- `StorageTransferJob`\n- `VertexAIDataset`\n- `VertexAIIndex`\n\n| **Note:** `Folder` is a special case. You can set its `resourceID` to the folder ID of an existing folder to acquire that folder. However, if you leave `resourceID` unspecified, `Folder` acquires the folder with the given `displayName` in the given parent folder/organization. If none can be found, then a new folder is created.\n\nTo learn about how to use the `resourceID` field, see [Managing resources with\nthe resourceID field](/config-connector/docs/how-to/managing-resources-with-resource-ids).\n\n### Resources that cannot be acquired\n\nThe following Config Connector resources do not have support for acquiring\nexisting Google Cloud resources:\n\n- `DataflowFlexTemplateJob`\n- `FirestoreIndex`\n- `IAMServiceAccountKey`\n\nKeeping resources after deletion\n--------------------------------\n\n**Warning:** When deleting a Config Connector resource the associated Google Cloud resource is deleted by default. To keep the Google Cloud resource, add the following to the Config Connector resource YAML before deleting: \n\n ...\n metadata:\n annotations:\n cnrm.cloud.google.com/deletion-policy: abandon\n ...\n\nFor example, the YAML for the BigQuery dataset described earlier\nincluding the `abandon` deletion policy is below: \n\n apiVersion: bigquery.cnrm.cloud.google.com/v1beta1\n kind: BigQueryDataset\n metadata:\n name: bigquerydatasetsample\n annotations:\n cnrm.cloud.google.com/deletion-policy: abandon\n spec:\n defaultTableExpirationMs: 3600000\n description: \"BigQuery Dataset Sample\"\n friendlyName: bigquerydataset-sample\n location: US\n\nWhat's next\n-----------\n\n- Learn about how Config Connector models Google Cloud resources with [Kubernetes constructs](/config-connector/docs/concepts/resources).\n- See the Google Cloud [resources](/config-connector/docs/reference/resources) Config Connector can manage.\n- See additional examples of how to use Config Connector on the [GitHub repository](https://github.com/GoogleCloudPlatform/k8s-config-connector).\n- Learn how Kubernetes handles [declarative configuration](https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/) of objects."]]