1. Docs
  2. Pulumi IaC
  3. Languages & SDKs
  4. YAML
  5. Component Reference

Pulumi YAML Component reference

Pulumi components can be defined in many languages, and the Pulumi YAML dialect offers an additional language for authoring Pulumi components.

The Pulumi YAML provider supports components written in YAML or JSON. Each YAML component plugin consists of a top level components section, which consists of a map of component names to a component definition.

components:
  myComponent:
    inputs: {}
    resources: {}
    variables: {}
    outputs: {}
Copy

Each component works similar to how a YAML program works. See also the YAML Reference documentation for more information

Component definition

Each component can have the following top level sections:

PropertyTypeRequiredExpressionDescription
inputsconfig optionsNoNoInputs specifies the inputs to the components.
resourcesmap[string]ResourceNoNoResources declares the Pulumi resources that the component will consist of.
variablesmap[string]ExpressionNoYesVariables specifies intermediate values, the values of variables are expressions that can be re-used.
outputsmap[string]ExpressionNoYesOutputs specifies the Pulumi stack outputs of the component.

In many locations within this schema, values may be expressions which compute a value based on the inputs, variables, or outputs of resources. These expressions can be provided in two ways:

  • If an object is provided as a value, and has a key that has the prefix fn::, the object is treated as an expression, and the expression will be resolved to a new value that will be used in place of the object.
  • Any string value is interpreted as an interpolation, with ${...} being replaced by evaluating the expression in the ....

The supported expression forms for each of these can be found in the YAML program reference

Inputs

inputs is a map of config property keys to structured declarations (see here).

The value of inputs is an object whose keys are logical names by which the config input will be referenced in expressions within the program, and whose values are elements of the schema below. Each item in this object represents an independent input.

PropertyTypeRequiredExpressionDescription
typestringNoYesType is the (required) data type for the parameter. It can be one of: string, integer, boolean or array.
defaultanyNoNoDefault is a value of the appropriate type for the component to use if no value is specified.
itemsconfig optionsNoNoRequired if type is array. Specifies the type of the array members

Resources

The value of resources is an object whose keys are logical resource names by which the resource will be referenced in expressions within the program, and whose values are elements of the schema below. Each item in this object represents a resource which will be managed by the Pulumi Component.

PropertyTypeRequiredExpressionsDescription
typestringYesNoType is the Pulumi type token for this resource.
defaultProviderboolNoNoDefaultProvider specifies if a provider should be used for resources without an explicit one set. Set only on provider resources.
propertiesmap[string]ExpressionNoYesProperties contains the primary resource-specific keys and values to initialize the resource state.
optionsResource OptionsNoNoOptions contains all resource options supported by Pulumi.
getResource GetterNoYesA getter function for the resource. Supplying get is mutually exclusive to properties.

Outputs

The value of outputs is an object whose keys are the logical names of the outputs that are available from outside the Pulumi Component and whose values are potentially computed expressions that resolve to the values of the desired outputs.

outputs:
  outputName: ${resource.id}
Copy

Was this page helpful?

PulumiUP May 6, 2025. Register Now.