이 페이지에서는 config-connector export 명령어와 이를 사용해서 Google Cloud 리소스를 구성 커넥터 YAML 파일로 내보내고 이후에 이를 구성 커넥터로 가져오는 방법을 설명합니다.
config-connector export를 사용하여 기존 Google Cloud 리소스를 내보낼 수 있습니다. 리소스의 전체 이름을 config-connector export로 전달하면 config-connector가 구성 커넥터로 가져올 수 있는 YAML 매니페스트를 생성합니다.
구성 커넥터로 가져오려는 Google Cloud 리소스와 이미 이름이 같은 리소스가 존재하는 경우 구성 커넥터는 리소스를 제어하고 제공된 YAML로 관리합니다. 제공된 YAML에 변경할 수 없는 필드에 대한 변경사항이 있거나 구성에 다른 문제가 없는 한 구성 커넥터는 이 상황에서 오류를 생성하지 않습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003econfig-connector export\u003c/code\u003e command allows users to export existing Google Cloud resources into Config Connector YAML files, enabling them to be managed within Config Connector.\u003c/p\u003e\n"],["\u003cp\u003eWhen exporting, providing the full resource name to \u003ccode\u003econfig-connector export\u003c/code\u003e generates a YAML manifest that can be imported into Config Connector.\u003c/p\u003e\n"],["\u003cp\u003eIf a resource already exists with the same name, Config Connector will take control of the resource with the provided YAML, unless there are conflicts with immutable fields.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003econfig-connector print-resources\u003c/code\u003e command can be used to display a list of resources supported by the \u003ccode\u003econfig-connector\u003c/code\u003e tool, along with their respective resource name formats.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003econfig-connector export\u003c/code\u003e command supports command line options including output location, oauth2-token, iam-format type, filter for deleted IAM members, and verbose logging.\u003c/p\u003e\n"]]],[],null,["# Export and import resources to Config Connector\n===============================================\n\n*** ** * ** ***\n\nThis page describes the `config-connector export` command and how to use it to\nexport Google Cloud resources into YAML files,\nwhich you can subsequently import into Config Connector. If you already have access to the resource's YAML file,\nfollow the steps in [Managing and deleting resources](/config-connector/docs/how-to/managing-deleting-resources)\nto acquire the resource instead.\n\nLimitations\n-----------\n\nNot all resources support the `export` command. To get a list of supported\nresources, run `config-connector print-resources`.\n| **Tip:** If a resource is not supported by `export`, but is supported by `bulk-export`, you can try [filtering an Asset Inventory export with `bulk-export`](/config-connector/docs/how-to/import-export/bulk-export#discovering_resources_to_import).\n\nBefore you begin\n----------------\n\n1. [Install the `config-connector` CLI tool](/config-connector/docs/how-to/import-export/overview).\n2. To simplify commands, set your default namespace by running the following command: \n\n ```\n kubectl config set-context --current --namespace NAMESPACE_NAME\n ```\n Replace \u003cvar translate=\"no\"\u003eNAMESPACE_NAME\u003c/var\u003e with your namespace name.\n3. Get the [full resource name](/iam/docs/full-resource-names) for the resource that you want to export. If you don't know the resource's full name, you might be able to find it with one of the following methods:\n - [Use Cloud Asset Inventory to search for a resource](/asset-inventory/docs/search-resources).\n - Use the `describe` or `list` command for the resource, for example `gcloud pubsub topics describe sample-topic --format \"value(name)\"`.\n - Check the resource's product documentation for a guide on getting the resource ID, for example [Getting a Cloud Key Management Service resource ID](/kms/docs/getting-resource-ids).\n\nExport a resource\n-----------------\n\nYou can use the `config-connector` CLI tool to export an existing resource into a YAML file.\n\nTo export a resource into a YAML file, run the following command: \n\n config-connector export \u003cvar translate=\"no\"\u003eRESOURCE_ID\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eRESOURCE_ID\u003c/var\u003e with the full name of the resource that you want to export.\n\nThe command outputs the resource in YAML format that can be used by Config Connector.\nThe output should resemble the following example: \n\n apiVersion: pubsub.cnrm.cloud.google.com/v1beta1\n kind: PubSubTopic\n metadata:\n annotations:\n cnrm.cloud.google.com/project-id: my-example-project\n name: sample-topic\n\nImport a resource into Config Connector\n---------------------------------------\n\nAfter you have the YAML file for the resource that you want Config Connector\nto acquire, complete the following steps:\n\n1. Pass your resource into Config Connector by running the following command:\n\n config-connector export \u003cvar translate=\"no\"\u003eRESOURCE_ID\u003c/var\u003e | kubectl apply -f - --namespace \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e with the namespace that Config Connector\n manages resources from.\n2. Confirm that Config Connector is managing the resource by running the\n following command:\n\n kubectl describe \u003cvar translate=\"no\"\u003eRESOURCE_TYPE\u003c/var\u003e \u003cvar translate=\"no\"\u003eRESOURCE_NAME\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eRESOURCE_TYPE\u003c/var\u003e: the resource type, for example `pubsubtopic`.\n - \u003cvar translate=\"no\"\u003eRESOURCE_NAME\u003c/var\u003e: the resource name. This doesn't have to be the full resource name.\n\nAfter Config Connector acquires the resource, you can manage that resource\nby following the steps in [Managing and deleting resources](/config-connector/docs/how-to/managing-deleting-resources).\n\n`config-connector` CLI tool optional fields\n-------------------------------------------\n\nWhen running the `config-connector export` command, you can pass the\nfollowing optional fields: \n\n config-connector export RESOURCE_NAME \\\n --output FILENAME \\\n --oauth2-token TOKEN \\\n --iam-format [policy | policymember | none] \\\n --filter-deleted-iam-members [true | false] \\\n --verbose\n\n- `--output`: An optional output path that disables standard output. When a file, the result contains all the command output; when a directory, the directory contains a new file for each resource in the output.\n- `--oauth2-token`: An [OAUTH2 token](/sdk/gcloud/reference/auth/application-default/print-access-token) as the Google Cloud identity. By default, `config-connector` uses the [Google Cloud CLI default credentials](/sdk/docs/authorizing).\n- `--iam-format`: Specifies the kind of IAM resources output with your export. Options are [`policy`](/config-connector/docs/reference/resource-docs/iam/iampolicy) (default), [`policymember`](/config-connector/docs/reference/resource-docs/iam/iampolicymember), or `none`.\n- `--filter-deleted-iam-members`: Specifies whether to filter out deleted IAM principals. Options are `true` or `false`. The default value is `false`.\n- `--verbose`: Enables verbose logging.\n\nWhat's next\n-----------\n\n- Read about how Config Connector [acquires existing Google Cloud resources](/config-connector/docs/how-to/managing-deleting-resources#acquiring_an_existing_resource).\n- [Learn about the resources that Config Connector supports](/config-connector/docs/reference/overview)."]]