Cloud Deployment Manager will reach end of support on March 31, 2026. If you currently use Deployment Manager, please migrate to Infrastructure Manager or an alternative deployment technology by March 31, 2026 to ensure your services continue without interruption.
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가 리소스를 만듭니다.