0
0
GCPcloud~10 mins

Deployment Manager as native IaC in GCP - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Deployment Manager as native IaC
Write YAML/Template config
Run deployment command
Deployment Manager parses config
Creates/Updates GCP resources
Deployment state stored
User verifies deployment status
Deployment Manager takes your config files, reads them, creates or updates resources in GCP, and keeps track of the deployment state.
Execution Sample
GCP
resources:
  - name: my-vm
    type: compute.v1.instance
    properties:
      zone: us-central1-a
      machineType: zones/us-central1-a/machineTypes/n1-standard-1
      disks:
        - deviceName: boot
          type: PERSISTENT
          boot: true
          autoDelete: true
          initializeParams:
            sourceImage: projects/debian-cloud/global/images/family/debian-10
This YAML defines a VM instance resource to be created in GCP.
Process Table
StepActionInput/ConfigResult/State Change
1Read YAML configresources: my-vm VM definitionParsed resource definition stored
2Validate configCheck resource types and propertiesValidation successful
3Send create requestCreate VM instance in zone us-central1-aAPI call sent to GCP
4GCP creates VMVM creation in progressVM instance created and running
5Store deployment stateRecord resource and statusDeployment state saved
6User checks statusgcloud deployment-manager deployments describeShows VM created and active
7ExitAll resources created successfullyDeployment complete
💡 All resources created and deployment state saved; deployment is complete.
Status Tracker
VariableStartAfter Step 1After Step 3After Step 5Final
deployment_stateemptyparsed config loadedcreate request sentresources createddeployment complete
resource_statusnonedefinedpending creationcreatedactive
Key Moments - 3 Insights
Why does Deployment Manager need a config file before creating resources?
The config file tells Deployment Manager what resources to create and their settings. Without it, Deployment Manager doesn't know what to build. See execution_table step 1.
What happens if the config has an invalid resource type?
Deployment Manager will fail validation and stop before creating resources. This is shown in execution_table step 2 where validation must succeed.
How does Deployment Manager keep track of created resources?
It stores deployment state after resource creation (step 5), so it knows what exists and can update or delete later.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the deployment_state after step 3?
Adeployment complete
Bresources created
Ccreate request sent
Dparsed config loaded
💡 Hint
Check variable_tracker row 'deployment_state' column 'After Step 3'
At which step does Deployment Manager validate the config?
AStep 2
BStep 1
CStep 4
DStep 5
💡 Hint
See execution_table step with action 'Validate config'
If the VM creation fails, which step would not complete successfully?
AStep 3
BStep 4
CStep 5
DStep 6
💡 Hint
Step 4 is where GCP creates the VM; failure happens here
Concept Snapshot
Deployment Manager uses YAML or templates to define GCP resources.
Run deployment commands to apply configs.
It validates configs, creates resources, and tracks state.
You can update or delete resources via updated configs.
Deployment state helps manage resource lifecycle.
Full Transcript
Deployment Manager is a tool in Google Cloud that lets you define your infrastructure using configuration files, usually in YAML. You write what resources you want, like virtual machines, and their settings. When you run the deployment command, Deployment Manager reads your config, checks it for errors, and then tells Google Cloud to create those resources. It keeps track of what it created so you can update or delete them later. This process helps automate and manage your cloud infrastructure easily and reliably.