cd deploymentmanager-samples/examples/v2/step_by_step_guide/step2_create_a_configuration
그런 다음 two-vms.yaml을 엽니다.
nanotwo-vms.yaml# use your preferred text editor
resources 섹션에는 리소스 두 개(the-first-vm 및 the-second-vm)가 있습니다. 각 리소스에는 name, type, properties 필드가 있습니다.
name: 리소스에 정의하는 이름입니다.
type: 만들려는 리소스의 유형을 지정합니다. 예를 들어 VM은 compute.v1.instance입니다. 마찬가지로 Cloud SQL 인스턴스의 유형은 sql.v1beta4.instance입니다.
properties: 리소스의 속성을 지정합니다. 리소스를 만들 때 필요한 속성은 리소스 API에 필요한 속성과 동일합니다. 예를 들어 Compute Engine VM 인스턴스를 만들 때는 머신 유형, 이미지, 네트워크 인터페이스, 부팅 디스크 사양을 제공해야 합니다.
구성 파일 설정
two-vms.yaml에서 MY_PROJECT를 프로젝트 ID로 바꿉니다.
# Copyright 2016 Google Inc. All rights reserved.## 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.resources:-name:the-first-vmtype:compute.v1.instanceproperties:zone:us-central1-fmachineType:https://www.googleapis.com/compute/v1/projects/MY_PROJECT/zones/us-central1-f/machineTypes/f1-microdisks:-deviceName:boottype:PERSISTENTboot:trueautoDelete:trueinitializeParams:sourceImage:https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/family/debian-11networkInterfaces:-network:https://www.googleapis.com/compute/v1/projects/MY_PROJECT/global/networks/defaultaccessConfigs:-name:External NATtype:ONE_TO_ONE_NAT-name:the-second-vmtype:compute.v1.instanceproperties:zone:us-central1-fmachineType:https://www.googleapis.com/compute/v1/projects/MY_PROJECT/zones/us-central1-f/machineTypes/g1-smalldisks:-deviceName:boottype:PERSISTENTboot:trueautoDelete:trueinitializeParams:sourceImage:https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/family/debian-11networkInterfaces:-network:https://www.googleapis.com/compute/v1/projects/MY_PROJECT/global/networks/defaultaccessConfigs:-name:External NATtype:ONE_TO_ONE_NAT
변경사항을 저장합니다.
이 기본 구성 파일만으로 첫 번째 배포를 만들 수 있습니다.
만들려는 리소스를 선언했으므로(이 경우 머신 유형이 서로 다른 VM 인스턴스 두 개) Deployment Manager가 리소스를 만듭니다.
[[["이해하기 쉬움","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-03-31(UTC)"],[[["A configuration defines the structure of a deployment, and it is required to create one."],["This configuration example creates a deployment with two Compute Engine virtual machine (VM) instances, demonstrating how to define resources."],["Each resource within the configuration has a `name`, `type`, and `properties` field, specifying what is created and how."],["The configuration file `two-vms.yaml` details the creation of two distinct VM instances with varying machine types, demonstrating how to specify different types of VMs."],["Deployment Manager uses the defined configuration to create the specified resources, abstracting away the low level creation."]]],[]]