DM 변환을 사용하여 Terraform 또는 Kubernetes 리소스 모델(KRM)로 전환
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Deployment Manager Convert(DM Convert)는 Deployment Manager 구성 및 템플릿을 Google에서 지원하는 다른 선언적 구성 형식으로 변환하는 데 사용할 수 있는 도구입니다. Google은 현재 Terraform 및 Kubernetes 리소스 모델(KRM)을 지원합니다.
Terraform 또는 KRM으로 변환하는 이유
Terraform과 KRM은 Google Cloud 서비스와 인프라를 관리하는 데 널리 사용되는 옵션입니다. 이들은 보안 비밀 관리 및 지속적 조정(KRM의 경우)과 같은 최신 기능을 지원하는 활성 업데이트 생태계를 제공합니다.
다음과 같은 경우에 DM Convert는 작업의 Terraform에 해당하는 변환을 지원합니다.
리소스를 동등한 Terraform 리소스로 삽입하는 API에 대한 작업 호출을 대체합니다. 예를 들어 action: gcp-types/storage-v1:storage.buckets.insert는 google_storage_bucket으로 변환됩니다.
가능한 경우 항상 Terraform data 유형에 대한 리소스를 가져오는 API로 작업 호출을 변환합니다. 예를 들어 actions: gcp-types/compute-v1:compute.subnetworks.get은 google_compute_subnetwork로 변환됩니다.
getIamPolicy와 함께 사용되는지 여부에 따라 setIamPolicy 명령어를 *_iam_policy(권한) 또는 *_iam_member(비권한) 리소스로 변환합니다.
Deployment Manager 내에서 작업 사용을 선언적 대안으로 마이그레이션하는 방법에 대한 자세한 내용은 작업 사용 대체를 참조하세요.
Terraform으로 변환하기 위한 워크플로
DM Convert를 사용하여 Deployment Manager 구성을 Terraform으로 변환하려면 다음 단계를 따르세요.
기본적으로 DM Convert 도구는 도구를 유지보수 및 개선하기 위해 익명의 사용 데이터를 Google로 전송합니다. DM Convert 도구가 실행되면 요청된 작업, 작업 성공, 변환 시점에 대한 데이터가 수집됩니다. 이 데이터는 익명으로 처리되며 개인 식별 정보, 민감한 정보 또는 고객 콘텐츠는 제외됩니다.
사용 데이터에는 다음이 포함될 수 있습니다.
변환 명령어 입력 매개변수: 출력 형식(KRM 또는 Terraform) 및 다른 플래그가 지정되었는지 여부에 대한 부울 표현을 포함하여 도구를 실행할 때 변환 명령어의 매개변수 값을 기록합니다(해당 플래그의 특정 값은 수집하지 않음).
변환 결과: 문제가 발생할 경우 변환 상태(SUCCESS 또는 FAILURE)와 오류 코드 및 오류 메시지를 포함한 변환 결과를 기록합니다.
변환 시간: 변환 시작 및 종료 시간이 기록됩니다.
Google에서 이 데이터를 사용하는 방식
Google은 다음과 같은 목적으로 사용 데이터를 수집하고 처리합니다.
가장 많이 사용되는 기능과 설정을 포함하여 도구가 사용되는 방식을 파악합니다.
도구 사용 실패를 진단하고 기술 지원을 원하는 사용자에게 안내를 제공합니다.
문제를 해결하고 잠재적으로 특성 범위를 늘려 도구를 개선합니다.
데이터 수집 선택 해제
Google은 사용자가 변환을 실행할 때 기본적으로 사용 데이터를 수집하지만 이 데이터 수집을 중지할 수 있습니다.
특정 변환에 대한 데이터 수집을 중지하려면 변환 명령어에 --opt_out_data_collection=true 플래그를 지정하면 됩니다. 앞으로 이 데이터 수집을 계속 해제하려면 변환을 실행할 때마다 플래그를 지정해야 합니다.
특정 변환에 데이터 수집을 사용 설정하려면 변환 명령어에 --opt_out_data_collection=false 플래그를 지정하거나 명령어에서 플래그를 생략하면 됩니다.
[[["이해하기 쉬움","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-03(UTC)"],[[["\u003cp\u003eDM Convert is a tool that converts Deployment Manager configurations and templates to Terraform or Kubernetes Resource Model (KRM) formats.\u003c/p\u003e\n"],["\u003cp\u003eConverting to Terraform or KRM offers actively-updated ecosystems with support for modern features, including integration with Google services and infrastructure.\u003c/p\u003e\n"],["\u003cp\u003eDM Convert translates Deployment Manager concepts like references, dependencies, and IAM Bindings into corresponding KRM or Terraform structures, but it doesn't support actions or custom type providers without declarative equivalents.\u003c/p\u003e\n"],["\u003cp\u003eTo convert to Terraform, users must identify the configuration, reconcile active deployments, run DM Convert, verify the generated output, and delete the Deployment Manager deployment.\u003c/p\u003e\n"],["\u003cp\u003eThe DM Convert tool collects anonymous usage data by default to improve its functionality, but users can opt out by using the \u003ccode\u003e--opt_out_data_collection=true\u003c/code\u003e flag.\u003c/p\u003e\n"]]],[],null,["# Using DM Convert to transition to Terraform or Kubernetes Resource Model (KRM)\n\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nDeployment Manager Convert (DM Convert) is a tool you can use to convert\nyour Deployment Manager\n[configurations](/deployment-manager/docs/configuration) and\n[templates](/deployment-manager/docs/configuration/templates/create-basic-template)\nto other declarative configuration formats that Google supports. Google\ncurrently supports [Terraform](/docs/terraform) and [Kubernetes Resource Model (KRM)](https://github.com/kubernetes/design-proposals-archive/blob/main/architecture/resource-management.md).\n\nWhy convert to Terraform or KRM?\n--------------------------------\n\nTerraform and KRM are popular options for managing Google Cloud services\nand infrastructure. They offer actively-updated ecosystems, with support for\nmodern features such as Secrets management and continuous reconciliation (for\nKRM).\n\nGoogle works with [HashiCorp](https://www.hashicorp.com/) to\ndevelop the [Terraform provider for Google Cloud](https://registry.terraform.io/providers/hashicorp/google/latest/docs).\nIn 2020, Google also launched [Config Connector](/config-connector/docs/overview) to help\ncustomers use Kubernetes to manage Google Cloud [resource types](/config-connector/docs/reference/overview).\n\n### Terraform\n\n[Terraform](https://www.terraform.io/) is an open-source tool for\nprovisioning infrastructure. You can use Terraform to write declarative\nconfigurations to manage your Google Cloud services and resources using\nthe [Terraform provider for Google Cloud](https://registry.terraform.io/providers/hashicorp/google/latest/docs).\nFor more information, refer to [Terraform on Google Cloud](/docs/terraform).\n\n### Kubernetes Resource Model (KRM)\n\n[KRM](https://github.com/kubernetes/design-proposals-archive/blob/main/architecture/resource-management.md)\nis a paradigm for building APIs and resource definitions for declarative\nconfiguration management. It represents Google Cloud resources as\n[Custom Resource Definitions (CRDs)](/config-connector/docs/reference/overview)\nand can be actuated using [Config Controller](/anthos-config-management/docs/concepts/config-controller-overview).\n\nSupported types and type providers\n----------------------------------\n\nDM Convert converts Deployment Manager configuration YAML files and Jinja or\nPython template files to KRM or Terraform configuration files.\n\nTo check the current status of DM Convert's support for type providers and\nresource types, you can use the `--list-supported-types` flag.\n\nUnderstanding how DM Convert translates concepts across formats\n---------------------------------------------------------------\n\nThe following table shows how DM Convert translates concepts from\nDeployment Manager into KRM and Terraform:\n\nSupport for Actions in DM Convert (for Terraform)\n-------------------------------------------------\n\nActions is a Preview feature for Deployment Manager that extends the set of\navailable API methods.\n[Actions is unsupported](/deployment-manager/docs/migrations/actions), and DM\nConvert doesn't convert Actions that don't have declarative equivalents in\nTerraform, such as:\n\n- Patch, delete, and list APIs\n\n- APIs defined in custom type providers\n\n- Custom APIs, such as `sqladmin-v1beta4:sql.instances.restart`\n\nDM Convert does support conversion to Terraform equivalents for Actions in the\nfollowing cases:\n\n- It replaces Action calls to APIs that insert a resource with equivalent\n Terraform resources. For example,\n `action: gcp-types/storage-v1:storage.buckets.insert` converts to\n [`google_storage_bucket`](http://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket).\n\n- It converts Action calls to APIs that get a resource to Terraform `data` types\n whenever possible. For example,\n `actions: gcp-types/compute-v1:compute.subnetworks.get` converts to\n [`google_compute_subnetwork`](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/compute_subnetwork).\n\n- It converts `setIamPolicy` commands to either `*_iam_policy` (authoritative)\n or `*_iam_member` (non-authoritative) resources, depending on whether or not\n they're used with `getIamPolicy`.\n\nFor information on migrating usage of Actions to declarative alternatives within\nDeployment Manager, visit\n[Replacing usage of Actions](/deployment-manager/docs/migrations/actions).\n\nWorkflow for converting to Terraform\n------------------------------------\n\nTo use DM Convert to convert your Deployment Manager configurations to Terraform:\n\n1. Identify the Deployment Manager configuration you want to convert to Terraform.\n2. To make sure your resources are up-to-date, reconcile any active deployments of the configuration.\n3. To convert your configuration to Terraform, [run the DM Convert tool](/deployment-manager/docs/dm-convert/convert) locally.\n4. Verify that the generated Terraform configuration reflects the current state of your resources.\n5. Delete the Deployment Manager deployment. To preserve your resources when you delete the deployment, set `delete-policy` to `abandon`.\n\nWe recommend that you follow [Terraform best practices](/docs/terraform/best-practices-for-terraform#root-modules), such as:\n\n- Storing your [Terraform state in a Cloud Storage bucket](/docs/terraform/resource-management/store-state)\n- [Using Cloud Build to manage actuation](/architecture/managing-infrastructure-as-code).\n\nFor a detailed walkthrough of this workflow, refer to [Converting your Deployment Manager configurations with DM Convert](/deployment-manager/docs/dm-convert/convert).\n\nData collection in DM Convert\n-----------------------------\n\n### What we collect, by default\n\nBy default, the DM Convert tool sends anonymous usage data to Google to help us\nmaintain and improve the tool. When the DM Convert tool executes, data about the\nrequested operation, the success of the operation, and the timing of the\nconversion is collected. This data is anonymous, and excludes any personally\nidentifiable information, sensitive data, or customer content.\n\nThe usage data might contain:\n\n- **Conversion command input parameters:** We record the parameter values of\n your conversion command when running the tool, including the output format\n (KRM or Terraform) and boolean representations of whether other flags are\n specified (we don't collect the specific values of those flags).\n\n- **Conversion result:** We record the results of the conversion, including the\n conversion status (`SUCCESS` or `FAILURE`) as well as the error code and error\n message, if an issue occurs.\n\n- **Conversion time:** We record the start and end times of the conversion.\n\n### How we use this data\n\nGoogle collects and processes the usage data to:\n\n- Understand how the tool is used, including which features and settings are\n most popular.\n\n- Diagnose unsuccessful usage of the tool, and provide guidance to users seeking\n technical assistance.\n\n- Improve the tool by resolving issues and potentially increasing feature\n coverage.\n\n### Opting out of data collection\n\nGoogle collects usage data by default when you execute a conversion, but this\ndata collection can be disabled.\n\nTo disable the data collection for a specific conversion, you can specify the\nflag `--opt_out_data_collection=true` in your conversion command. To\ncontinue to opt out of this data collection going forward, you must specify the\nflag every time that you run a conversion.\n\nTo enable the data collection for a specific conversion, you can specify the\nflag `--opt_out_data_collection=false` in your conversion command, or omit the\nflag from your command."]]