Pulumi package schema
Pulumi Packages are described by a package schema, which is used to drive code generation for SDKs in each supported Pulumi language, as well as generation of language-agnostic package documentation. This schema can be manually authored (for component packages) or generated from some other source (such as a cloud provider’s API specifications for a native Pulumi resource provider). Packages can expose resources and functions, define types used by these resources and functions, and provide packaging metadata for language-specific SDKs.
Example
An example of the Pulumi Package Schema is below. This schema describes a package named apigateway, with a single resource RestAPI which is a component, and which has a required input property routes and required (always populated) output properties url of type string and api which references the external type of the AWS API Gateway RestAPI resource. The type of the routes input is a custom type named EventHandlerRoute defined in the schema, which is an object type with path,method and function properties. The schema supports generation of SDKs for csharp, go, nodejs and python, with metadata configuring each of the generated SDKs in the corresponding sections.
{
"name": "apigateway",
"types": {
"apigateway:index:EventHandlerRoute": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"method": {
"type": "string"
},
"function": {
"$ref": "/aws/v7.44.0/schema.json#/resources/aws:lambda%2Ffunction:Function"
}
}
}
},
"resources": {
"apigateway:index:RestAPI": {
"isComponent": true,
"inputProperties": {
"routes": {
"type": "array",
"items": {
"$ref": "#/types/apigateway:index:EventHandlerRoute"
}
}
},
"requiredInputs": [
"routes"
],
"properties": {
"url": {
"type": "string"
},
"api": {
"$ref": "/aws/v7.44.0/schema.json#/resources/aws:apigateway%2FrestApi:RestApi"
}
},
"required": [
"url",
"api"
]
}
},
"language": {
"csharp": {
"packageReferences": {
"Pulumi": "3.*",
"Pulumi.Aws": "7.*"
}
},
"go": {
"generateResourceContainerTypes": true,
"importBasePath": "github.com/acmecorp/pulumi-apigateway/sdk/go/apigateway"
},
"nodejs": {
"dependencies": {
"@pulumi/aws": "^7.44.0"
},
"devDependencies": {
"typescript": "^5.0.0"
}
},
"python": {
"requires": {
"pulumi": ">=3.0.0,<4.0.0",
"pulumi-aws": ">=7.0.0,<8.0.0"
}
}
}
}
Complete schema examples that include a much wider range of schema configuration styles are available in these existing packages:
- AWS - Bridged Provider Package
- Azure Native - Native Pulumi Provider Package
- EKS - Component Package
Pulumi package schema
Generated from pkg/codegen/schema/pulumi.json in pulumi/pulumi
v3.262.0 — the metaschema
pulumi schema check
validates against.
Every type below is one shape a package schema can contain. Names are the JSON keys you
write; a linked type means that property’s value takes the shape of another type on this
page. To check a schema you’ve written against these rules, run
pulumi schema check.
Package
The top-level object of a package schema. Everything else on this page describes something reachable from here.
namestring requiredThe unqualified name of the package (e.g. “aws”, “azure”, “gcp”, “kubernetes”, “random”)displayNamestring optionalThe human-friendly name of the package.versionstring optionalThe version of the package. The version must be valid semver.descriptionstring optionalThe description of the package. Descriptions are interpreted as Markdown.keywordsarray[string] optionalThe list of keywords that are associated with the package, if any.
Reserved keywords can be specified that help with categorizing the package in the Pulumi Registry.
category/<name>andkind/<type>are the only reserved keywords at this time, where<name>is one ofcloud,database,infrastructure,network,utility, orvcs, and<type>is eithernativeorcomponent. If the package is a bridged Terraform provider, don’t include akind/label.homepagestring optionalThe package’s homepage.licensestring optionalThe name of the license used for the package’s contents.attributionstring optionalFreeform text attribution of derived work, if required.repositorystring optionalThe URL at which the package’s sources can be found.logoUrlstring optionalThe URL of the package’s logo, if any.pluginDownloadURLstring optionalThe URL to use when downloading the provider plugin binary.configurationDocsUrlstring optionalThe URL of the provider’s installation and configuration documentation, if any.validateCredentialsOnNewboolean optionalIndicates thatpulumi newmay configure the provider after creating a project in order to validate the user’s credentials.publisherstring optionalThe name of the person or organization that authored and published the package.namespacestring optionalThe namespace of the package. Used to disambiguate the package name. Defaults to ‘pulumi’ when not specified.- Format metadata about this package.
- The package’s configuration variables.
- A map from type token to complexTypeSpec that describes the set of complex types (i.e. object, enum) defined by this package.
- A list of package descriptors that describes the set of dependencies for this package.
- The provider type for this package.
- A map from type token to resourceSpec that describes the set of resources and components defined by this package.
- A map from token to functionSpec that describes the set of functions defined by this package.
- Additional language-specific data about the package.
- An optional object to define parameterization for the package.
allowedPackageNamesarray[string] optionalA list of allowed package names in addition to the name property.
Metadata
Format metadata about this package.
moduleFormatstring optionalA regex that is used by the importer to extract a module name from the module portion of a type token. Packages that use the module format “namespace1/namespace2/…/namespaceN” do not need to specify a format. The regex must define one capturing group that contains the module name, which must be formatted as “namespace1/namespace2/…namespaceN”.supportPackboolean optionalWrite the package to support the pack command.
Config
The package’s configuration variables.
- A map from variable name to propertySpec that describes a package’s configuration variables.
defaultsarray[string] optionalA list of the names of the package’s non-required configuration variables.
PackageDescriptor
Identifies another package this package depends on.
namestring requiredThe unqualified name of the package (e.g. “aws”, “azure”, “gcp”, “kubernetes”, “random”)versionstring optionalThe version of the package. The version must be valid semver if present.pluginDownloadURLstring optionalThe optional URL to use when downloading the provider plugin binary.parameterizationobject optionalAn optional object to define parameterization for the package.
ObjectType
Describes an object type.
descriptionstring optionalThe description of the type, if any.- A map from property name to propertySpec that describes the object’s properties.
typestring optionalThe type of the object. Must be ‘object’ if this is an object type, or the underlying type for an enum.requiredarray[string] optionalA list of the names of an object type’s required properties. These properties must be set for inputs and will always be set for outputs.- Additional language-specific data about the object type.
isOverlayboolean optionalindicates whether the type is an overlay provided by the package. Overlay code is generated by the package rather than using the core Pulumi codegen libraries.overlaySupportedLanguagesarray[string] optionalA list of languages that the overlay supports. This only has an effect if the Resource is an Overlay (isOverlay == true). Supported values are ’nodejs’, ‘python’, ‘go’, ‘csharp’, ‘java’, ‘yaml’.Values:nodejs,python,go,csharp,java,yaml
ComplexType
Describes an object or enum type.
descriptionstring optionalThe description of the type, if any. Interpreted as Markdown.- Additional language-specific data about the type.
isOverlayboolean optionalIndicates that the implementation of the type should not be generated from the schema, and is instead provided out-of-band by the package author.
EnumType — see EnumType
EnumType
Describes an enum type.
typestring requiredThe underlying primitive type of the enum.Values:boolean,integer,number,string- The list of possible values for the enum.
Resource
Describes a resource or component.
Includes every property of ObjectType, plus:
descriptionstring optionalThe description of the resource, if any. Interpreted as Markdown.- A map from property name to propertySpec that describes the resource’s input properties.
requiredInputsarray[string] optionalA list of the names of the resource’s required input properties.- An optional objectTypeSpec that describes additional inputs that may be necessary to get an existing resource. If this is unset, only an ID is necessary.
- An optional objectTypeSpec that describes inputs that may be supplied when listing existing resources of this type. If this is unset, the resource does not declare list support in the schema.
- The list of aliases for the resource.
deprecationMessagestring optionalIndicates whether the resource is deprecated.isComponentboolean optionalIndicates whether the resource is a component.methodsmap[string] optionalA map from method name to function token that describes the resource’s method set.isOverlayboolean optionalIndicates that the implementation of the resource should not be generated from the schema, and is instead provided out-of-band by the package author.
Function
Describes a function.
descriptionstring optionalThe description of the function, if any. Interpreted as Markdown.- The bag of input values for the function, if any.
multiArgumentInputsarray[string] optionalA list of parameter names that determines whether the input bag should be treated as a single argument or as multiple arguments. The list corresponds to the order in which the parameters should be passed to the function.- Specifies the return type of the function definition.
- Specifies the return type of the function definition.
deprecationMessagestring optionalIndicates whether the function is deprecated.- Additional language-specific data about the function.
isOverlayboolean optionalIndicates that the implementation of the function should not be generated from the schema, and is instead provided out-of-band by the package author.overlaySupportedLanguagesarray[string] optionalA list of languages that the overlay supports. This only has an effect if the Resource is an Overlay (isOverlay == true). Supported values are ’nodejs’, ‘python’, ‘go’, ‘csharp’, ‘java’, ‘yaml’.Values:nodejs,python,go,csharp,java,yamlplainboolean optionalA marker field to indicate that this function should only generate plain and output style methods. It defaults to true, that is to emit both plain and output style methods. Setting this to false will emit only output style methods.
Type
A reference to a type. The particular kind of type referenced is determined based on the contents of the “type” property and the presence or absence of the “additionalProperties”, “items”, “oneOf”, and “$ref” properties.
plainboolean optionalIndicates that when used as an input, this type does not accept eventual values.
Primitive Type
A reference to a primitive type. A primitive type must have only the “type” property set.
typestring requiredThe primitive type, if any.Values:boolean,integer,number,string
Array Type
A reference to an array type. The “type” property must be set to “array” and the “items” property must be present. No other properties may be present.
type"array" required- The element type of the array.
Map Type
A reference to a map type. The “type” property must be set to “object” and the “additionalProperties” property may be present. No other properties may be present.
type"object" required- The element type of the map. Defaults to “string” when omitted.
Named Type
A reference to a type in this or another document. The “$ref” property must be present. The “type” property is ignored if it is present. No other properties may be present.
typestring optionalignored; present for compatibility with existing schemas.$refstring requiredThe URI of the referenced type. For example, the built-in Archive, Asset, and Any types are referenced as “pulumi.json#/Archive”, “pulumi.json#/Asset”, and “pulumi.json#/Any”, respectively. A type from this document is referenced as “#/types/pulumi:type:token”. A type from another document is referenced as “path#/types/pulumi:type:token”, where path is of the form: “/provider/vX.Y.Z/schema.json” or “pulumi.json” or “http[s]://example.com/provider/vX.Y.Z/schema.json” A resource from this document is referenced as “#/resources/pulumi:type:token”. A resource from another document is referenced as “path#/resources/pulumi:type:token”, where path is of the form: “/provider/vX.Y.Z/schema.json” or “pulumi.json” or “http[s]://example.com/provider/vX.Y.Z/schema.json”.
Union Type
A reference to a union type. The “oneOf” property must be present. The union may additional specify an underlying primitive type via the “type” property and a discriminator via the “discriminator” property. No other properties may be present.
typestring optionalThe underlying primitive type of the union, if any.Values:boolean,integer,number,string- If present, indicates that values of the type may be one of any of the listed types.
- Informs the consumer of an alternative schema based on the value associated with it.
Property
Describes an object or resource property.
Includes every property of Type, plus:
descriptionstring optionalThe description of the property, if any. Interpreted as Markdown.constboolean | number | string optionalThe constant value for the property, if any. The type of the value must be assignable to the type of the property.defaultboolean | number | string optionalThe default value for the property, if any. The type of the value must be assignable to the type of the property.- Additional information about the property’s default value, if any.
deprecationMessagestring optionalIndicates whether the property is deprecated.- Additional language-specific data about the property.
secretboolean optionalSpecifies whether the property is secret (default false).replaceOnChangesboolean optionalSpecifies whether a change to the property causes its containing resource to be replaced instead of updated (default false).willReplaceOnChangesboolean optionalIndicates that the provider will replace the resource when this property is changed.
EnumValue
One of the values an enum type may take, and the metadata attached to it.
namestring optionalIf present, overrides the name of the enum value that would usually be derived from the value.descriptionstring optionalThe description of the enum value, if any. Interpreted as Markdown.valueboolean | integer | number | string requiredThe enum value itself.deprecationMessagestring optionalIndicates whether the value is deprecated.
Alias
A previous identity of a resource. Aliases let a resource be renamed or moved without the engine treating it as a delete and a create. May be written as a string or as an object.
typestring optionalThe type portion of the alias, if any.
Default
Additional information about the property’s default value, if any.
environmentarray[string] requiredA set of environment variables to probe for a default value.- Additional language-specific data about the default value.
Discriminator
Informs the consumer of an alternative schema based on the value associated with it.
propertyNamestring requiredThe name of the property in the payload that will hold the discriminator value.mappingmap[string] optionalAn optional object to hold mappings between payload values and schema names or references.
ParameterizationSpec
Parameterized packages populate this with concrete parameter values. Pulumi code generators read it to emit SDKs that preserve those values and pass them back to the provider at runtime.
- The provider being specialized, named by package name and version.
parameterstring optionalThe parameter for the provider.
BaseProviderSpec
The provider that a parameterized package specializes.
namestring requiredThe unqualified name of the package (e.g. “aws”, “azure”, “gcp”, “kubernetes”, “random”)versionstring requiredThe version of the package. The version must be valid semver.
Language-specific extensions
A language field maps a supported language to a language-specific object. The shape of
that object is decided by that language’s SDK code generator rather than by the schema
itself, which is how a generator gets to encode what it alone needs — an NPM package name,
a Java base package, a Go import path.
Each generator owns its extension, so each section below is generated from that language’s own repository and carries the release it came from. A language that has no entry for a section does not read one.
PackageLanguage
Language-specific information for a package.
Set under the nodejs key of a
language map. Generated from
pulumi/pulumi v3.262.0.
packageNamestring optionalCustom name for the NPM package.packageDescriptionstring optionalDescription for the NPM package.readmestring optionalContains the text for the package’s README.md files.dependenciesmap[string] optionalNPM dependencies to add to package.json.devDependenciesmap[string] optionalNPM dev-dependencies to add to package.json.peerDependenciesmap[string] optionalNPM peer-dependencies to add to package.json.resolutionsmap[string] optionalNPM resolutions to add to package.json.typescriptVersionstring optionalA specific version of TypeScript to include in package.json.moduleToPackagemap[string] optionalA map containing overrides for module names to package names.compatibilitystring optionalToggle compatibility mode for a specified target.disableUnionOutputTypesboolean optionalDisable support for unions in output types.containsEnumsboolean optionalAn indicator for whether the package contains enums.providerNameToModuleNamemap[string] optionalA map allowing you to map the name of a provider to the name of the module encapsulating the provider.extraTypeScriptFilesarray[string] optionalAdditional files to include in TypeScript compilation. These paths are added to thefilessection of the generatedtsconfig.json. A typical use case for this is compiling hand-authored unit test files that check the generated code.liftSingleValueMethodReturnsboolean optionalDetermines whether to make single-return-value methods return an output object or the single value.respectSchemaVersionboolean optionalRespect the Pkg.Version field in the schema.useTypeOnlyReferencesboolean optionalExperimental flag that permitsimport type *style code to be generated to optimize startup time of programs consuming the provider by minimizing the set of Node modules loaded at startup. Turning this on may currently generate non-compiling code for some providers; but if the code compiles it is safe to use. Also, turning this on requires TypeScript 3.8 or higher to compile the generated code.
Set under the python key of a
language map. Generated from
pulumi/pulumi v3.262.0.
packageNamestring optionalAn override for the name of the generated python package.pythonRequiresstring optionalDetermines the Python versions that the generated provider supports.requiresmap[string] optionalPython package requirements to add to the generated package’s metadata, as a map from distribution name to version specifier.readmestring optionalContains the text for the package’s README.md files.moduleNameOverridesmap[string] optionalOptional overrides for Pulumi module names.compatibilitystring optionalToggle compatibility mode for a specified target.usesIOClassesboolean optional deprecatedThis bool is no longer needed since all providers now use input/output classes.liftSingleValueMethodReturnsboolean optionalDetermines whether to make single-return-value methods return an output object or the single value.respectSchemaVersionboolean optionalRespect the Pkg.Version field for emitted code.pyprojectobject optionalIf enabled, a pyproject.toml file will be generated.inputTypesstring optionalSpecifies what types are used for inputs. Allowed values are the following:
- “classes”: Args classes only
- “classes-and-dicts” (default): TypedDicts side-by-side with Args classes.
Set under the go key of a
language map. Generated from
pulumi/pulumi v3.262.0.
importBasePathstring optionalBase path for package imports.modulePathstring optionalModule path for go.mod.rootPackageNamestring optionalExplicit package name, which may be different to the import path.moduleToPackagemap[string] optionalMap from module -> package name.packageImportAliasesmap[string] optionalMap from package name -> package alias.importPathPatternstring optionalDefines the pattern for how import paths should be constructed from the base import path and used module By default, the pattern is “{baseImportPath}/{module}” but can be overridden to support other patterns. for example you can use “{baseImportPath}/{module}/v2” which will replace {module} with the module name and {baseImportPath} with the base import path to compute the full path.generateResourceContainerTypesboolean optionalGenerate container types (arrays, maps, pointer output types etc.) for each resource. These are typically used to support external references.pulumiSDKVersioninteger optionalThe version of the Pulumi SDK used with this provider, e.g. 3. Used to generate doc links for pulumi builtin types. If omitted, the latest SDK version is used.liftSingleValueMethodReturnsboolean optionalDetermines whether to make single-return-value methods return an output struct or the value.internalModuleNamestring optionalWhen set, the code generator will use this name for the generated internal module instead of “internal” so that functionality within the module can be used by end users.generateExtraInputTypesboolean optionalDetermines whether or not the code generator generates input (and output) types for all plain types, instead of for only types that are used as input/output types.omitExtraInputTypesboolean optionalDetermines whether the code generator generates input (and output) types for all plain types, instead of for only types that are used as input/output types.respectSchemaVersionboolean optionalRespect the Pkg.Version field for emitted code.internalDependenciesarray[string] optionalBlank imports that are emitted in the SDK so thatgo mod tidydoes not remove the associated module dependencies from the SDK’s go.mod.genericsstring optionalSpecifies how to handle generating a variant of the SDK that uses generics. Allowed values are the following:
- “none” (default): do not generate a generics variant of the SDK
- “side-by-side”: generate a side-by-side generics variant of the SDK under the x subdirectory
- “only-generics”: generate a generics variant of the SDK only
Set under the csharp key of a
language map. Generated from
pulumi/pulumi-dotnet v3.113.1.
packageReferencesmap[string] optionalNuGet package references to add to the generated.csproj, as a map from package name to version.namespacesmap[string] optionalOverrides for module names to C# namespaces, as a map from module name to namespace.compatibilitystring optionalToggles compatibility mode for a specified target.dictionaryConstructorsboolean optionalGenerates constructors that take a dictionary of properties in addition to the typed args class.projectReferencesarray[string] optionalPaths to local.csprojfiles to reference from the generated project, instead of resolving those dependencies from NuGet.liftSingleValueMethodReturnsboolean optionalDetermines whether to make single-return-value methods return an output object or the single value.rootNamespacestring optionalThe root namespace used for the package. This defaults toPulumi.respectSchemaVersionboolean optionalAllow the Pkg.Version field to filter down to emitted code.
Set under the java key of a
language map. Generated from
pulumi/pulumi-java v1.36.3.
packagesmap[string] optionalOverrides how Schema packages names translate to Java package names.basePackagestring requiredThe prefix of the Java package to generate.buildFilesstring requiredIf set to “gradle” enables a generation of a basic set of Gradle build files.repositoriesarray[string] optionalIf non-empty, specifies a list of Maven repositories that should be referenced by the generated package. This can be useful for specifying the locations of e.g. local or private dependencies.dependenciesmap[string] optionalSpecifies Maven-style dependencies for the generated code.gradleNexusPublishPluginVersionstring requiredIf non-empty and BuildFiles=“gradle”, enables the use of a given version of io.github.gradle-nexus.publish-plugin in the generated Gradle build files.gradleTeststring requiredIf non-empty and BuildFiles=“gradle”, generates a test section to enablegradle testcommand to run unit tests over the generated code. Supported values: “JUnitPlatform”.
PropertyLanguage
Language-specific information for a property.
Not supported by the TypeScript code generator.
Set under the python key of a
language map. Generated from
pulumi/pulumi v3.262.0.
mapCaseboolean optionalWhether the property name is mapped between the schema’s camelCase and Python’s snake_case. Defaults to true.
Not supported by the Go code generator.
Set under the csharp key of a
language map. Generated from
pulumi/pulumi-dotnet v3.113.1.
namestring optionalAn override for the generated C# property name.
Set under the java key of a
language map. Generated from
pulumi/pulumi-java v1.36.3.
namestring optionalAn override for the generated Java property name.
ResourceLanguage
Language-specific information for a resource.
Not supported by the TypeScript code generator.
Not supported by the Python code generator.
Not supported by the Go code generator.
Set under the csharp key of a
language map. Generated from
pulumi/pulumi-dotnet v3.113.1.
namestring optionalAn override for the generated C# class name for the resource.
Not supported by the Java code generator.
ObjectTypeLanguage
Language-specific information for an object type.
Set under the nodejs key of a
language map. Generated from
pulumi/pulumi v3.262.0.
requiredInputsarray[string] requiredList of properties that are required on the input side of a type.requiredOutputsarray[string] requiredList of properties that are required on the output side of a type.
Not supported by the Python code generator.
Not supported by the Go code generator.
Not supported by the C# code generator.
Not supported by the Java code generator.
FunctionLanguage
Language-specific information for a function.
Not yet supported in any target language.
DefaultLanguage
Language-specific information for a property’s default value.
Not yet supported in any target language.