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

Using Composite Types in Deployments

Reference and instantiate composite types within deployment configurations.

Using Composite Types in Deployments

Important Notice: Google Cloud Deployment Manager reached end of support on March 31, 2026. This content is provided strictly as a legacy reference for maintaining existing environments. For all new infrastructure provisioning, you should direct your work to Google Cloud Infrastructure Manager or Terraform.

What you'll learn: How to interpret references and instantiations of composite types within legacy Deployment Manager configurations.

When reviewing existing Deployment Manager environments, you will often encounter custom composite types. Think of composite types as custom building blocks that bundled multiple resources into a single entity. Understanding how these were referenced is critical for maintaining or migrating legacy infrastructure.

Referencing a Composite Type

In legacy configurations, a composite type was referenced by its name in the type field of a resource definition, identical to how native Google Cloud resources were declared:

resources:
- name: my-web-tier
  type: my-composite-type.yaml
  properties:
    instanceCount: 3
    machineType: n1-standard-1
    zone: us-central1-a

The type field points to the composite type's configuration file. During historical deployments, Deployment Manager expanded this single resource declaration into all the underlying resources defined in the composite type blueprint.

Passing Properties

Composite types typically required input properties (parameters) to function correctly. These were supplied in the properties section of the YAML block. These values flowed directly through to the underlying template (usually written in Python or Jinja2) where they controlled the specific details of the infrastructure that was created.

Multiple Instances

You will frequently see the same composite type instantiated multiple times within a single legacy configuration, each with different properties:

resources:
- name: dev-environment
  type: environment.yaml
  properties:
    env: dev
    size: small

- name: prod-environment
  type: environment.yaml
  properties:
    env: prod
    size: large

Each block operated independently but followed the exact same template blueprint. If you are auditing existing infrastructure using historical maintenance commands like gcloud deployment-manager deployments describe, keep in mind that the deployment engine expanded these concise declarations into full sets of resources (such as multiple Compute Instances and Persistent Disks) based on the original type definition.

Key Takeaway: In legacy Deployment Manager files, composite types were referenced just like built-in resource types by specifying the type file path and providing the required properties. Recognizing this pattern is essential for understanding, maintaining, or migrating legacy templates to modern infrastructure-as-code tools.