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.
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](/docs/concepts/resources#components), 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`](/docs/reference/pkg/aws/apigateway/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.
| `keywords` | `array[string]` | No | Keywords is the list of keywords that are associated with the package, if any.<br><br>Reserved keywords can be specified that help with categorizing the package in the [Pulumi registry](/registry/). `category/<name>` and `kind/<type>` are the only reserved keywords at this time, where `<name>` can be one of: `cloud`, `database`, `infrastructure`, `network`, `utility`, `vcs` and `<type>` is either `native` or `component`. If the package is a bridged Terraform provider, then don't include a `kind/` label. |
| `pluginDownloadURL` | `string` | No | PluginDownloadURL is the URL to use to acquire the provider plugin binary, if any. See [Authoring & Publishing](/docs/using-pulumi/pulumi-packages/how-to-author#publish-your-package) for more details. |
| `meta` | [`Metadata`](#metadata) | No | Meta contains information for the importer about this package. |
| `config` | [`Config`](#config) | No | Config describes the set of configuration variables defined by this package. |
| `types` | [`map[ComplexType]`](#complextype) | No | Types is a map from type token to ComplexType that describes the set of complex types (ie. object, enum) defined by this package. |
| `provider` | [`Resource`](#resource) | No | Provider describes the provider type for this package. |
| `resources` | [`map[Resource]`](#resource) | No | Resources is a map from type token to Resourc that describes the set of resources defined by this package. |
| `functions` | [`map[Function]`](#function) | No | Functions is a map from token to Function that describes the set of functions defined by this package. |
| `language` | [`map[PackageLanguage]`](#packagelanguage) | No | Language specifies additional language-specific data about the package. |
| `moduleFormat` | `string` | No | ModuleFormat is a 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". |
| `variables` | [`map[Property]`](#property) | No | Variables is a map from variable name to Property that describes a package's configuration variables. |
| `required` | `array[string]` | No | Required is a list of the names of the package's required configuration variables. |
| `description` | `string` | No | Description is the description of the type, if any. |
| `properties` | [`map[Property]`](#property) | No | Properties, if present, is a map from property name to Property that describes the type's properties. |
| `type` | `string` | No | Type must be "object" if this is an object type, or the underlying type for an enum. |
| `required` | `array[string]` | No | Required, if present, is a 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. |
| All [`ObjectType`](#objecttype) properties, as well as: | | | |
| `inputProperties` | [`map[Property]`](#property) | No | Description is the description of the property, if any. |
| `requiredInputs` | `array[string]` | No | RequiredInputs is a list of the names of the resource's required input properties. |
| `stateInputs` | [`ObjectType`](#objecttype) | No | StateInputs is an optional ObjectType that describes additional inputs that may be necessary to get an existing resource. If this is unset, only an ID is necessary. |
| `aliases` | [`array[Alias]`](#alias) | No | Aliases is the list of aliases for the resource. |
| `deprecationMessage` | `string` | No | DeprecationMessage indicates whether or not the resource is deprecated. |
| `language` | [`map[ResourceLanguage]`](#resourcelanguage) | No | Language specifies additional language-specific data about the resource. |
| `isComponent` | `boolean` | No | IsComponent indicates whether the resource is a ComponentResource. |
| `type` | `string` | Yes | Type is the primitive or composite type, if any. May be "boolean", "integer", "number", "string", "array", or "object". |
| `$ref` | `string` | Yes | Ref is a reference to a type in this or another document. 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"`. |
| `additionalProperties` | [`Type`](#type) | No | AdditionalProperties, if set, describes the element type of an "object" (i.e. a string -> value map). |
| `items` | [`Type`](#type) | No | Items, if set, describes the element type of an array. |
| `oneOf` | [`array[Type]`](#type) | No | OneOf indicates that values of the type may be one of any of the listed types. |
| `discriminator` | [`Discriminator`](#discriminator) | No | Discriminator informs the consumer of an alternative schema based on the value associated with it. |
| `plain` | `boolean` | No | Plain indicates that when used as an input, this type does not accept eventual values. |
| All [`Type`](#type) properties, as well as: | | | |
| `description` | `string` | No | Description is the description of the property, if any. |
| `const` | `any` | No | Const is the constant value for the property, if any. The type of the value must be assignable to the type of the property. |
| `default` | `any` | No | Default is the default value for the property, if any. The type of the value must be assignable to the type of the property. |
| `defaultInfo` | `Default` | No | DefaultInfo contains additional information about the property's default value, if any. |
| `deprecationMessage` | `string` | No | DeprecationMessage indicates whether or not the property is deprecated. |
| `language` | [`map[PropertyLanguage]`](#propertylanguage) | No | Language specifies additional language-specific data about the property. |
| `secret` | `boolean` | No | Secret specifies if the property is secret (default false). |
| `replaceOnChanges` | `boolean` | No | ReplaceOnChanges specifies if the associated object should be updated with a replace operation instead of a update operation. |
| `willReplaceOnChanges` | `boolean` | No | WillReplaceOnChanges indiciates that the provider will replace the resource when this property is changed. |
| `propertyName` | `string` | Yes | PropertyName is the name of the property in the payload that will hold the discriminator value. |
| `mapping` | `map[string]` | No | Mapping is an optional object to hold mappings between payload values and schema names or references. |
## Language-Specific Extensions
Several schema types contain a `language` field which is a map from a supported language to a language-specific schema type. The schema for this type is language dependent, and offers extensibility for language-specific SDK code generators to encode language-specific information about the schema entry.
| `packageImportAliases` | `map[string]` | Map from package name -> package alias. |
| `generateResourceContainerTypes` | `boolean` | Generate container types (arrays, maps, pointer output types etc.) for each resource. These are typically used to support external references. |