Pulumi.yaml


Overview

The `Pulumi.yaml` file serves as the primary project configuration manifest for a Pulumi infrastructure-as-code (IaC) project. Pulumi uses this YAML file to define key metadata about the project, including its name, runtime environment, and an optional project description.

In this particular file, the project is named **"polygon"**, uses the **Node.js** runtime, and has a brief description labeled **"coin stack"**. This configuration enables Pulumi to understand how to execute the project code and provides essential context when deploying or managing infrastructure.


Detailed Explanation

This file does **not** contain classes, functions, or methods, as it is a declarative configuration file. Instead, it declares project-level settings used by the Pulumi CLI and runtime.

Key Fields

Field

Type

Description

Example

`name`

string

The unique name of the Pulumi project. This identifies the project within the Pulumi ecosystem and local workspace.

`polygon`

`runtime`

string

Specifies the runtime environment for the Pulumi program. It indicates which language Pulumi should use to execute the infrastructure code.

`nodejs`

`description`

string

A brief textual description of the project’s purpose or functionality. This is optional but helps with documentation and project clarity.

`coin stack`


Usage Example

This file is automatically used when running Pulumi commands such as `pulumi up`, `pulumi preview`, or [pulumi destroy](/projects/291/68799) in the project directory. Pulumi reads the configuration to determine:

Example project setup:

name: polygon
runtime: nodejs
description: coin stack

To initialize this project, you would run:

pulumi stack init dev
npm install
pulumi up

Pulumi uses `Pulumi.yaml` to understand that it should run Node.js scripts found in the project for infrastructure deployment.


Important Implementation Details


Interaction with Other System Components


Visual Diagram

Since `Pulumi.yaml` is a configuration file without classes or functions, the diagram below represents the **workflow** of how this configuration file integrates with the Pulumi system and project components.

flowchart TD
    A[Pulumi.yaml] --> B[Pulumi CLI]
    B --> C[Runtime Loader]
    C --> D[Node.js Runtime]
    D --> E[Infrastructure Code (JS/TS)]
    E --> F[Cloud Provider APIs]
    B --> G[Stack & State Management]
    G --> H[State Backend (S3, Local, etc.)]

    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#bbf,stroke:#333,stroke-width:2px
    style C fill:#ccf,stroke:#333,stroke-width:2px
    style D fill:#cfc,stroke:#333,stroke-width:2px
    style E fill:#fcf,stroke:#333,stroke-width:2px
    style F fill:#fcc,stroke:#333,stroke-width:2px
    style G fill:#cff,stroke:#333,stroke-width:2px
    style H fill:#ffc,stroke:#333,stroke-width:2px

Summary

This file forms the foundational metadata layer that supports the broader infrastructure-as-code workflows in a Pulumi Node.js project.