Course contentsShow
← Cloud and Infrastructure
Lesson 949 of 2,98918. Google Cloud Deployment ManagerFree lesson

Template Properties and References

Use properties to configure resources and reference attributes between resources.

Template Properties and References

Important Legacy Notice: Google Cloud Deployment Manager reached end of support on March 31, 2026. For all new infrastructure provisioning, direct your work to Google Cloud Infrastructure Manager or Terraform. The following content is provided strictly as legacy reference for maintaining or migrating existing Deployment Manager configurations.

What You'll Learn

You'll learn how properties were used to customize resources and how templates referenced attributes from one resource in another within legacy Google Cloud Deployment Manager deployments.

Properties: Configuring Legacy Resources

In Deployment Manager, properties were the configuration settings that defined how a resource should behave. Each resource type had specific fields (properties) required to provision the infrastructure.

When reviewing legacy templates, you will see properties specified using the properties: section:

resources:
- name: my-instance
  type: compute.v1.instance
  properties:
    zone: us-central1-a
    machineType: zones/us-central1-a/machineTypes/n1-standard-1
    disks:
    - boot: true
      initializeParams:
        sourceImage: projects/debian-cloud/global/images/family/debian-11

Each property (like zone, machineType, disks) dictated exactly how Google Cloud configured that resource.

References: Connecting Resources Together

References allowed developers to use values from one resource when configuring another. This was crucial for establishing dependencies between resources. You will encounter references in legacy configurations using the $(ref.RESOURCE_NAME.ATTRIBUTE) syntax:

resources:
- name: my-network
  type: compute.v1.network
  properties:
    autoCreateSubnetworks: false

- name: my-instance
  type: compute.v1.instance
  properties:
    zone: us-central1-a
    machineType: zones/us-central1-a/machineTypes/n1-standard-1
    networkInterfaces:
    - network: $(ref.my-network.selfLink)

In this historical example, the instance references the network's selfLink attribute, ensuring the network was created first and successfully linked, even before the actual URL was known.

Note: Any gcloud deployment-manager commands you may encounter in legacy documentation or scripts should be treated as reference material for managing or dismantling existing deployments, not as instructions for launching new infrastructure.

Key Takeaway: In legacy Deployment Manager templates, properties configured individual resources with specific settings, while references dynamically linked resources together by accessing attributes from other resources in the deployment. All new infrastructure as code should be built using Terraform or Google Cloud Infrastructure Manager.