LinuxCommandLibrary

pulumi-schema

Describe Pulumi provider schemas

TLDR

Check a package schema

$ pulumi schema check [path/to/file]
copy

Check a package schema without failing if the reference to a type is missing
$ pulumi schema check --allow-dangling-references [path/to/file]
copy

Display help
$ pulumi schema check [[-h|--help]]
copy

SYNOPSIS

pulumi schema <command> [options]

Common commands:
pulumi schema build [options]
pulumi schema check [options]
pulumi schema gen-nodejs [options]
pulumi schema print [options]
pulumi schema validate [options]

PARAMETERS

--help, -h
    Show help for the schema command or its subcommands.

--emoji
    Enable emojis in the output.

--logflow
    Enable resource property flow logging (debug).

--logtostderr
    Log to stderr instead of to files.

--tracing
    Enable tracing to the Zipkin collector at the given address. The default is disabled.

--verbose
    Enable verbose logging (e.g., --verbose=3, or --v=3).

Note: Many pulumi schema subcommands have their own specific parameters not listed here. Use pulumi schema <subcommand&I> --help for details.

DESCRIPTION

pulumi-schema is a sub-command of the Pulumi CLI that provides utilities for working with Pulumi package schemas. A Pulumi schema is a machine-readable definition that describes the resources, functions, and types exposed by a Pulumi provider. These schemas are crucial for enabling cross-language support, IDE features (like autocompletion and type checking), and policy enforcement.

The pulumi-schema command allows developers to perform various operations related to these schemas, including: building a schema from a Pulumi program, checking a schema for correctness, comparing schema versions, and most importantly, generating language-specific SDKs (Software Development Kits) for popular languages like TypeScript/JavaScript, Python, Go, .NET, and Java. It also supports printing, linting, and validating schema definitions, making it an essential tool for provider developers and users interested in deep introspection of their infrastructure as code definitions.

CAVEATS

Some pulumi schema operations, particularly pulumi schema build, require a Pulumi program or project context to function correctly. The generated language SDKs depend on the stability of the underlying schema; changes to schemas can potentially introduce breaking changes in generated code if not managed properly. Ensure you are using a compatible Pulumi CLI version with your provider and schema versions.

WHAT IS A PULUMI SCHEMA?

A Pulumi schema is a JSON-formatted file (typically named schema.json) that formally describes the interface of a Pulumi provider or package. It defines the types of resources, input and output properties, functions, and enums that the provider exposes. This standardized definition allows Pulumi to automatically generate type-safe SDKs in various programming languages, provide rich IDE experiences (intellisense, type checking), and enable powerful policy as code capabilities without requiring manual mapping or boilerplate code for each language.

COMMON USE CASES

The pulumi schema command is primarily used by:
Provider Developers: To build, validate, and lint their provider's schema, ensuring it's correct and complete before distribution.
Language SDK Generation: To generate the language-specific SDKs (e.g., TypeScript, Python, Go) from a provider's schema, making the provider consumable in different programming languages.
Tooling Developers: To programmatically understand the capabilities of a Pulumi provider for building custom tools or integrations.

HISTORY

Pulumi was first released in 2018, aiming to bring familiar programming languages to infrastructure as code. The concept of a strongly typed, machine-readable schema for providers was fundamental to Pulumi's multi-language support from its early days. The pulumi schema command and its various subcommands evolved as Pulumi matured, adding support for new languages (like Java, Go, .NET) and refining the schema definition (like adding more type system capabilities) to improve the developer experience and enable more robust tooling.

SEE ALSO

Copied to clipboard