stack block. Each resource maps to a Pulumi resource class and becomes a provider API call when the stack is deployed.
Named resource
name on the left is the binding name — a local identifier used to reference this resource’s outputs elsewhere in the stack. It appears as the Pulumi resource logical name in generated code.
Unnamed resource
A resource without a binding is valid but its outputs cannot be referenced:Type path
The type after= is a dot-separated type path that maps to a Pulumi provider class:
| XCL | Python |
|---|---|
aws.ec2.Vpc | aws.ec2.Vpc(...) with import pulumi_aws as aws |
aws.eks.Cluster | aws.eks.Cluster(...) |
helm.Release | helm.Release(...) with import pulumi_helm as helm |
kubernetes.core.v1.ConfigMap | kubernetes.core.v1.ConfigMap(...) |
requirements.txt entry is generated for each unique provider.
Resource properties
Properties are listed askey = value pairs inside the block:
- Other resources by binding name:
subnet.vpc_id = vpc.id - Input fields:
cidr_block = input.vpc_cidr - Locals fields:
acl = locals.bucket_acl - Literals: strings, numbers, booleans,
null, lists, objects - F-strings:
f"my-{input.name}-bucket" - Cross-stack references:
vpc_id = @networking.vpc_id
match or if/else (ternary) expressions directly — move those to a locals block.
For clause
Creates one resource per element of a collection:for clause variable(s) are in scope only within the resource block’s properties.
Referencing a for-resource produces a list. In generated Python, any access to a for-resource’s output becomes a list comprehension:
Count modifier
Creates N copies of a resource, indexed by the for-clause variable:* N expression is evaluated once at compile time if N is a literal, or remains dynamic if it references an input. It combines with the for clause.
Generated Python:
When clause — conditional resources
A resource with awhen clause is created only if the condition is truthy:
when condition must be Resolved — it can reference input.* or locals.* values, but not resource outputs (which are Pending<T>):

