schema

package
v3.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 33 Imported by: 221

Documentation

Index

Constants

View Source
const (
	// ExamplesShortcode is the name for the `{{% examples %}}` shortcode, which demarcates a set of example sections.
	ExamplesShortcode = "examples"

	// ExampleShortcode is the name for the `{{% example %}}` shortcode, which demarcates the content for a single
	// example.
	ExampleShortcode = "example"
)

Variables

View Source
var KindShortcode = ast.NewNodeKind("Shortcode")

KindShortcode is an ast.NodeKind for the Shortcode node.

View Source
var MetaSchema *jsonschema.Schema

Functions

func IsPrimitiveType

func IsPrimitiveType(t Type) bool

IsPrimitiveType returns true if the given Type is a primitive type. The primitive types are bool, int, number, string, archive, asset, and any.

func NewShortcodeParser

func NewShortcodeParser() parser.BlockParser

NewShortcodeParser returns a BlockParser that parses shortcode (e.g. `{{% examples %}}`).

func ParseDocs

func ParseDocs(docs []byte) ast.Node

ParseDocs parses the given documentation text as Markdown with shortcodes and returns the AST.

func PropertyListJoinToString added in v3.12.0

func PropertyListJoinToString(propertyList [][]*Property, nameConverter func(string) string) []string

Joins the output of `ReplaceOnChanges` into property path names.

For example, given an input [[B, D], [C]] where each property has a name equivalent to it's variable, this function should yield: ["B.D", "C"]

func RenderDocs

func RenderDocs(w io.Writer, source []byte, node ast.Node, options ...RendererOption) error

RenderDocs renders parsed documentation to the given Writer. The source that was used to parse the documentation must be provided.

func RenderDocsToString

func RenderDocsToString(source []byte, node ast.Node, options ...RendererOption) string

RenderDocsToString is like RenderDocs, but renders to a string instead of a Writer.

Types

type Alias

type Alias struct {
	// Name is the "name" portion of the alias, if any.
	Name *string
	// Project is the "project" portion of the alias, if any.
	Project *string
	// Type is the "type" portion of the alias, if any.
	Type *string
}

Alias describes an alias for a Pulumi resource.

type AliasSpec

type AliasSpec struct {
	// Name is the name portion of the alias, if any.
	Name *string `json:"name,omitempty" yaml:"name,omitempty"`
	// Project is the project portion of the alias, if any.
	Project *string `json:"project,omitempty" yaml:"project,omitempty"`
	// Type is the type portion of the alias, if any.
	Type *string `json:"type,omitempty" yaml:"type,omitempty"`
}

AliasSpec is the serializable form of an alias description.

type ArrayType

type ArrayType struct {
	// ElementType is the element type of the array.
	ElementType Type
}

ArrayType represents arrays of particular element types.

func (*ArrayType) String

func (t *ArrayType) String() string

type ComplexTypeSpec

type ComplexTypeSpec struct {
	ObjectTypeSpec `yaml:",inline"`

	// Enum, if present, is the list of possible values for an enum type.
	Enum []EnumValueSpec `json:"enum,omitempty" yaml:"enum,omitempty"`
}

ComplexTypeSpec is the serializable form of an object or enum type.

type ConfigSpec

type ConfigSpec struct {
	// Variables is a map from variable name to PropertySpec that describes a package's configuration variables.
	Variables map[string]PropertySpec `json:"variables,omitempty" yaml:"variables,omitempty"`
	// Required is a list of the names of the package's required configuration variables.
	Required []string `json:"defaults,omitempty" yaml:"defaults,omitempty"`
}

ConfigSpec is the serializable description of a package's configuration variables.

type DefaultSpec

type DefaultSpec struct {
	// Environment specifies a set of environment variables to probe for a default value.
	Environment []string `json:"environment,omitempty" yaml:"environment,omitempty"`
	// Language specifies additional language-specific data about the default value.
	Language map[string]RawMessage `json:"language,omitempty" yaml:"language,omitempty"`
}

DefaultSpec is the serializable form of extra information about the default value for a property.

type DefaultValue

type DefaultValue struct {
	// Value specifies a static default value, if any. This value must be representable in the Pulumi schema type
	// system, and its type must be assignable to that of the property to which the default applies.
	Value interface{}
	// Environment specifies a set of environment variables to probe for a default value.
	Environment []string
	// Language specifies additional language-specific data about the default value.
	Language map[string]interface{}
}

DefaultValue describes a default value for a property.

type DiscriminatorSpec added in v3.2.0

type DiscriminatorSpec struct {
	// PropertyName is the name of the property in the payload that will hold the discriminator value.
	PropertyName string `json:"propertyName" yaml:"propertyName"`
	// Mapping is an optional object to hold mappings between payload values and schema names or references.
	Mapping map[string]string `json:"mapping,omitempty" yaml:"mapping,omitempty"`
}

DiscriminatorSpec informs the consumer of an alternative schema based on the value associated with it.

type Enum

type Enum struct {
	// Value is the value of the enum.
	Value interface{}
	// Comment is the description for the enum value.
	Comment string
	// Name for the enum.
	Name string
	// DeprecationMessage indicates whether or not the value is deprecated.
	DeprecationMessage string
}

Enum contains information about an enum.

type EnumType

type EnumType struct {
	// Package is the type's package.
	Package *Package
	// Token is the type's Pulumi type token.
	Token string
	// Comment is the description of the type, if any.
	Comment string
	// Elements are the predefined enum values.
	Elements []*Enum
	// ElementType is the underlying type for the enum.
	ElementType Type

	// IsOverlay indicates 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.
	IsOverlay bool
}

EnumType represents an enum.

func (*EnumType) String

func (t *EnumType) String() string

type EnumValueSpec

type EnumValueSpec struct {
	// Name, if present, overrides the name of the enum value that would usually be derived from the value.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	// Description of the enum value.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// Value is the enum value itself.
	Value interface{} `json:"value" yaml:"value"`
	// DeprecationMessage indicates whether or not the value is deprecated.
	DeprecationMessage string `json:"deprecationMessage,omitempty" yaml:"deprecationMessage,omitempty"`
}

EnumValuesSpec is the serializable form of the values metadata associated with an enum type.

type Function

type Function struct {
	// Package is the package that defines the function.
	Package *Package
	// Token is the function's Pulumi type token.
	Token string
	// Comment is the description of the function, if any.
	Comment string
	// Inputs is the bag of input values for the function, if any.
	Inputs *ObjectType
	// Outputs is the bag of output values for the function, if any.
	Outputs *ObjectType
	// DeprecationMessage indicates whether or not the function is deprecated.
	DeprecationMessage string
	// Language specifies additional language-specific data about the function.
	Language map[string]interface{}
	// IsMethod indicates whether the function is a method of a resource.
	IsMethod bool
	// IsOverlay indicates whether the function is an overlay provided by the package. Overlay code is generated by the
	// package rather than using the core Pulumi codegen libraries.
	IsOverlay bool
}

Function describes a Pulumi function.

func (*Function) NeedsOutputVersion added in v3.11.0

func (fun *Function) NeedsOutputVersion() bool

Determines if codegen should emit a ${fn}Output version that automatically accepts Inputs and returns Outputs.

type FunctionSpec

type FunctionSpec struct {
	// Description is the description of the function, if any.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// Inputs is the bag of input values for the function, if any.
	Inputs *ObjectTypeSpec `json:"inputs,omitempty" yaml:"inputs,omitempty"`
	// Outputs is the bag of output values for the function, if any.
	Outputs *ObjectTypeSpec `json:"outputs,omitempty" yaml:"outputs,omitempty"`
	// DeprecationMessage indicates whether or not the function is deprecated.
	DeprecationMessage string `json:"deprecationMessage,omitempty" yaml:"deprecationMessage,omitempty"`
	// Language specifies additional language-specific data about the function.
	Language map[string]RawMessage `json:"language,omitempty" yaml:"language,omitempty"`
	// IsOverlay indicates whether the function is an overlay provided by the package. Overlay code is generated by the
	// package rather than using the core Pulumi codegen libraries.
	IsOverlay bool `json:"isOverlay,omitempty" yaml:"isOverlay,omitempty"`
}

FunctionSpec is the serializable form of a function description.

type InputType added in v3.6.0

type InputType struct {
	// ElementType is the element type of the input.
	ElementType Type
}

InputType represents a type that accepts either a prompt value or an output value.

func (*InputType) String added in v3.6.0

func (t *InputType) String() string

type InvalidType added in v3.12.0

type InvalidType struct {
	Diagnostics hcl.Diagnostics
}

An InvalidType represents an invalid type with associated diagnostics.

func (*InvalidType) String added in v3.12.0

func (t *InvalidType) String() string

type Language

type Language interface {
	// ImportDefaultSpec decodes language-specific metadata associated with a DefaultValue.
	ImportDefaultSpec(def *DefaultValue, bytes json.RawMessage) (interface{}, error)
	// ImportPropertySpec decodes language-specific metadata associated with a Property.
	ImportPropertySpec(property *Property, bytes json.RawMessage) (interface{}, error)
	// ImportObjectTypeSpec decodes language-specific metadata associated with a ObjectType.
	ImportObjectTypeSpec(object *ObjectType, bytes json.RawMessage) (interface{}, error)
	// ImportResourceSpec decodes language-specific metadata associated with a Resource.
	ImportResourceSpec(resource *Resource, bytes json.RawMessage) (interface{}, error)
	// ImportFunctionSpec decodes language-specific metadata associated with a Function.
	ImportFunctionSpec(function *Function, bytes json.RawMessage) (interface{}, error)
	// ImportPackageSpec decodes language-specific metadata associated with a Package.
	ImportPackageSpec(pkg *Package, bytes json.RawMessage) (interface{}, error)
}

Language provides hooks for importing language-specific metadata in a package.

type Loader

type Loader interface {
	LoadPackage(pkg string, version *semver.Version) (*Package, error)
}

func NewPluginLoader

func NewPluginLoader(host plugin.Host) Loader

type MapType

type MapType struct {
	// ElementType is the element type of the map.
	ElementType Type
}

MapType represents maps from strings to particular element types.

func (*MapType) String

func (t *MapType) String() string

type MetadataSpec

type MetadataSpec struct {
	// 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".
	ModuleFormat string `json:"moduleFormat,omitempty" yaml:"moduleFormat,omitempty"`
}

MetadataSpec contains information for the importer about this package.

type Method added in v3.5.0

type Method struct {
	// Name is the name of the method.
	Name string
	// Function is the function definition for the method.
	Function *Function
}

type ObjectType

type ObjectType struct {
	// Package is the package that defines the resource.
	Package *Package
	// Token is the type's Pulumi type token.
	Token string
	// Comment is the description of the type, if any.
	Comment string
	// Properties is the list of the type's properties.
	Properties []*Property
	// Language specifies additional language-specific data about the object type.
	Language map[string]interface{}
	// IsOverlay indicates 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.
	IsOverlay bool

	// InputShape is the input shape for this object. Only valid if IsPlainShape returns true.
	InputShape *ObjectType
	// PlainShape is the plain shape for this object. Only valid if IsInputShape returns true.
	PlainShape *ObjectType
	// contains filtered or unexported fields
}

ObjectType represents schematized maps from strings to particular types.

func (*ObjectType) IsInputShape added in v3.6.0

func (t *ObjectType) IsInputShape() bool

IsInputShape returns true if this object type is the plain shape of a (plain, input) pair. The input shape of an object may contain *InputType values and may reference other input shapes.

func (*ObjectType) IsPlainShape added in v3.6.0

func (t *ObjectType) IsPlainShape() bool

IsPlainShape returns true if this object type is the plain shape of a (plain, input) pair. The plain shape of an object does not contain *InputType values and only references other plain shapes.

func (*ObjectType) Property

func (t *ObjectType) Property(name string) (*Property, bool)

func (*ObjectType) String

func (t *ObjectType) String() string

type ObjectTypeSpec

type ObjectTypeSpec struct {
	// Description is the description of the type, if any.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// Properties, if present, is a map from property name to PropertySpec that describes the type's properties.
	Properties map[string]PropertySpec `json:"properties,omitempty" yaml:"properties,omitempty"`
	// Type must be "object" if this is an object type, or the underlying type for an enum.
	Type string `json:"type,omitempty" yaml:"type,omitempty"`
	// 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.
	Required []string `json:"required,omitempty" yaml:"required,omitempty"`
	// Plain, was a list of the names of an object type's plain properties. This property is ignored: instead, property
	// types should be marked as plain where necessary.
	Plain []string `json:"plain,omitempty" yaml:"plain,omitempty"`
	// Language specifies additional language-specific data about the type.
	Language map[string]RawMessage `json:"language,omitempty" yaml:"language,omitempty"`
	// IsOverlay indicates 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.
	IsOverlay bool `json:"isOverlay,omitempty" yaml:"isOverlay,omitempty"`
}

ObjectTypeSpec is the serializable form of an object type.

type OptionalType added in v3.6.0

type OptionalType struct {
	// ElementType is the element type of the input.
	ElementType Type
}

OptionalType represents a type that accepts an optional value.

func (*OptionalType) String added in v3.6.0

func (t *OptionalType) String() string

type Package

type Package struct {

	// Name is the unqualified name of the package (e.g. "aws", "azure", "gcp", "kubernetes". "random")
	Name string
	// DisplayName is the human-friendly name of the package.
	DisplayName string
	// Version is the version of the package.
	Version *semver.Version
	// Description is the description of the package.
	Description string
	// Keywords is the list of keywords that are associated with the package, if any.
	// Some reserved keywords can be specified as well that help with categorizing the
	// package in the Pulumi registry. `category/<name>` and `kind/<type>` are the only
	// reserved keywords at this time, where `<name>` can be one of:
	// `cloud`, `database`, `infrastructure`, `monitoring`, `network`, `utility`, `vcs`
	// and `<type>` is either `native` or `component`. If the package is a bridged Terraform
	// provider, then don't include the `kind/` label.
	Keywords []string
	// Homepage is the package's homepage.
	Homepage string
	// License indicates which license is used for the package's contents.
	License string
	// Attribution allows freeform text attribution of derived work, if needed.
	Attribution string
	// Repository is the URL at which the source for the package can be found.
	Repository string
	// LogoURL is the URL for the package's logo, if any.
	LogoURL string
	// PluginDownloadURL is the URL to use to acquire the provider plugin binary, if any.
	PluginDownloadURL string
	// Publisher is the name of the person or organization that authored and published the package.
	Publisher string

	// Types is the list of non-resource types defined by the package.
	Types []Type
	// Config is the set of configuration properties defined by the package.
	Config []*Property
	// Provider is the resource provider for the package, if any.
	Provider *Resource
	// Resources is the list of resource types defined by the package.
	Resources []*Resource
	// Functions is the list of functions defined by the package.
	Functions []*Function
	// Language specifies additional language-specific data about the package.
	Language map[string]interface{}
	// contains filtered or unexported fields
}

Package describes a Pulumi package.

func BindSpec added in v3.12.0

func BindSpec(spec PackageSpec, languages map[string]Language) (*Package, hcl.Diagnostics, error)

BindSpec converts a serializable PackageSpec into a Package. Any semantic errors encountered during binding are contained in the returned diagnostics. The returned error is only non-nil if a fatal error was encountered.

func ImportSpec

func ImportSpec(spec PackageSpec, languages map[string]Language) (*Package, error)

ImportSpec converts a serializable PackageSpec into a Package. Unlike BindSpec, ImportSpec does not validate its input against the Pulumi package metaschema. ImportSpec should only be used to load packages that are assumed to be well-formed (e.g. packages referenced for program code generation or by a root package being used for SDK generation). BindSpec should be used to load and validate a package spec prior to generating its SDKs.

func (*Package) GetFunction

func (pkg *Package) GetFunction(token string) (*Function, bool)

func (*Package) GetResource

func (pkg *Package) GetResource(token string) (*Resource, bool)

func (*Package) GetResourceType

func (pkg *Package) GetResourceType(token string) (*ResourceType, bool)

func (*Package) GetType

func (pkg *Package) GetType(token string) (Type, bool)

func (*Package) ImportLanguages

func (pkg *Package) ImportLanguages(languages map[string]Language) error

func (*Package) MarshalJSON added in v3.7.0

func (pkg *Package) MarshalJSON() ([]byte, error)

func (*Package) MarshalSpec added in v3.7.1

func (pkg *Package) MarshalSpec() (spec *PackageSpec, err error)

func (*Package) MarshalYAML added in v3.7.1

func (pkg *Package) MarshalYAML() ([]byte, error)

func (*Package) TokenToModule

func (pkg *Package) TokenToModule(tok string) string

func (*Package) TokenToRuntimeModule

func (pkg *Package) TokenToRuntimeModule(tok string) string

type PackageSpec

type PackageSpec struct {
	// Name is the unqualified name of the package (e.g. "aws", "azure", "gcp", "kubernetes", "random")
	Name string `json:"name" yaml:"name"`
	// DisplayName is the human-friendly name of the package.
	DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"`
	// Version is the version of the package. The version must be valid semver.
	Version string `json:"version,omitempty" yaml:"version,omitempty"`
	// Description is the description of the package.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// Keywords is the list of keywords that are associated with the package, if any.
	// Some reserved keywords can be specified as well that help with categorizing the
	// package in the Pulumi registry. `category/<name>` and `kind/<type>` are the only
	// reserved keywords at this time, where `<name>` can be one of:
	// `cloud`, `database`, `infrastructure`, `monitoring`, `network`, `utility`, `vcs`
	// and `<type>` is either `native` or `component`. If the package is a bridged Terraform
	// provider, then don't include the `kind/` label.
	Keywords []string `json:"keywords,omitempty" yaml:"keywords,omitempty"`
	// Homepage is the package's homepage.
	Homepage string `json:"homepage,omitempty" yaml:"homepage,omitempty"`
	// License indicates which license is used for the package's contents.
	License string `json:"license,omitempty" yaml:"license,omitempty"`
	// Attribution allows freeform text attribution of derived work, if needed.
	Attribution string `json:"attribution,omitempty" yaml:"attribution,omitempty"`
	// Repository is the URL at which the source for the package can be found.
	Repository string `json:"repository,omitempty" yaml:"repository,omitempty"`
	// LogoURL is the URL for the package's logo, if any.
	LogoURL string `json:"logoUrl,omitempty" yaml:"logoUrl,omitempty"`
	// PluginDownloadURL is the URL to use to acquire the provider plugin binary, if any.
	PluginDownloadURL string `json:"pluginDownloadURL,omitempty" yaml:"pluginDownloadURL,omitempty"`
	// Publisher is the name of the person or organization that authored and published the package.
	Publisher string `json:"publisher,omitempty" yaml:"publisher,omitempty"`

	// Meta contains information for the importer about this package.
	Meta *MetadataSpec `json:"meta,omitempty" yaml:"meta,omitempty"`

	// A list of allowed package name in addition to the Name property.
	AllowedPackageNames []string `json:"allowedPackageNames,omitempty" yaml:"allowedPackageNames,omitempty"`

	// Config describes the set of configuration variables defined by this package.
	Config ConfigSpec `json:"config" yaml:"config"`
	// Types is a map from type token to ComplexTypeSpec that describes the set of complex types (ie. object, enum)
	// defined by this package.
	Types map[string]ComplexTypeSpec `json:"types,omitempty" yaml:"types,omitempty"`
	// Provider describes the provider type for this package.
	Provider ResourceSpec `json:"provider" yaml:"provider"`
	// Resources is a map from type token to ResourceSpec that describes the set of resources defined by this package.
	Resources map[string]ResourceSpec `json:"resources,omitempty" yaml:"resources,omitempty"`
	// Functions is a map from token to FunctionSpec that describes the set of functions defined by this package.
	Functions map[string]FunctionSpec `json:"functions,omitempty" yaml:"functions,omitempty"`
	// Language specifies additional language-specific data about the package.
	Language map[string]RawMessage `json:"language,omitempty" yaml:"language,omitempty"`
}

PackageSpec is the serializable description of a Pulumi package.

type Property

type Property struct {
	// Name is the name of the property.
	Name string
	// Comment is the description of the property, if any.
	Comment string
	// Type is the type of the property.
	Type Type
	// ConstValue is the constant value for the property, if any.
	ConstValue interface{}
	// DefaultValue is the default value for the property, if any.
	DefaultValue *DefaultValue
	// DeprecationMessage indicates whether or not the property is deprecated.
	DeprecationMessage string
	// Language specifies additional language-specific data about the property.
	Language map[string]interface{}
	// Secret is true if the property is secret (default false).
	Secret bool
	// ReplaceOnChanges specifies if the property is to be replaced instead of updated (default false).
	ReplaceOnChanges bool
}

Property describes an object or resource property.

func (*Property) IsRequired

func (p *Property) IsRequired() bool

IsRequired returns true if this property is required (i.e. its type is not Optional).

type PropertySpec

type PropertySpec struct {
	TypeSpec `yaml:",inline"`

	// Description is the description of the property, if any.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// Const is the constant value for the property, if any. The type of the value must be assignable to the type of
	// the property.
	Const interface{} `json:"const,omitempty" yaml:"const,omitempty"`
	// Default is the default value for the property, if any. The type of the value must be assignable to the type of
	// the property.
	Default interface{} `json:"default,omitempty" yaml:"default,omitempty"`
	// DefaultInfo contains additional information about the property's default value, if any.
	DefaultInfo *DefaultSpec `json:"defaultInfo,omitempty" yaml:"defaultInfo,omitempty"`
	// DeprecationMessage indicates whether or not the property is deprecated.
	DeprecationMessage string `json:"deprecationMessage,omitempty" yaml:"deprecationMessage,omitempty"`
	// Language specifies additional language-specific data about the property.
	Language map[string]RawMessage `json:"language,omitempty" yaml:"language,omitempty"`
	// Secret specifies if the property is secret (default false).
	Secret bool `json:"secret,omitempty" yaml:"secret,omitempty"`
	// ReplaceOnChanges specifies if the property is to be replaced instead of updated (default false).
	ReplaceOnChanges bool `json:"replaceOnChanges,omitempty" yaml:"replaceOnChanges,omitempty"`
}

PropertySpec is the serializable form of an object or resource property.

type RawMessage added in v3.7.1

type RawMessage []byte

func (RawMessage) MarshalJSON added in v3.7.1

func (m RawMessage) MarshalJSON() ([]byte, error)

func (RawMessage) MarshalYAML added in v3.7.1

func (m RawMessage) MarshalYAML() ([]byte, error)

func (*RawMessage) UnmarshalJSON added in v3.7.1

func (m *RawMessage) UnmarshalJSON(bytes []byte) error

func (*RawMessage) UnmarshalYAML added in v3.7.1

func (m *RawMessage) UnmarshalYAML(node *yaml.Node) error

type ReferenceRenderer

type ReferenceRenderer func(r *Renderer, w io.Writer, source []byte, link *ast.Link, enter bool) (ast.WalkStatus, error)

A ReferenceRenderer is responsible for rendering references to entities in a schema.

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

A Renderer provides the ability to render parsed documentation back to Markdown source.

func (*Renderer) MarkdownRenderer

func (r *Renderer) MarkdownRenderer() *markdown.Renderer

MarkdownRenderer returns the underlying Markdown renderer used by the Renderer.

func (*Renderer) RegisterFuncs

func (r *Renderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)

type RendererOption

type RendererOption func(*Renderer)

A RendererOption controls the behavior of a Renderer.

func WithReferenceRenderer

func WithReferenceRenderer(refRenderer ReferenceRenderer) RendererOption

WithReferenceRenderer sets the reference renderer for a renderer.

type Resource

type Resource struct {
	// Package is the package that defines the resource.
	Package *Package
	// Token is the resource's Pulumi type token.
	Token string
	// Comment is the description of the resource, if any.
	Comment string
	// IsProvider is true if the resource is a provider resource.
	IsProvider bool
	// InputProperties is the list of the resource's input properties.
	InputProperties []*Property
	// Properties is the list of the resource's output properties. This should be a superset of the input properties.
	Properties []*Property
	// StateInputs is the set of inputs used to get an existing resource, if any.
	StateInputs *ObjectType
	// Aliases is the list of aliases for the resource.
	Aliases []*Alias
	// DeprecationMessage indicates whether or not the resource is deprecated.
	DeprecationMessage string
	// Language specifies additional language-specific data about the resource.
	Language map[string]interface{}
	// IsComponent indicates whether the resource is a ComponentResource.
	IsComponent bool
	// Methods is the list of methods for the resource.
	Methods []*Method
	// IsOverlay indicates 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.
	IsOverlay bool
}

Resource describes a Pulumi resource.

func (*Resource) ReplaceOnChanges added in v3.12.0

func (r *Resource) ReplaceOnChanges() (changes [][]*Property, err []error)

The set of resource paths where ReplaceOnChanges is true.

For example, if you have the following resource struct:

Resource A {

Properties: {
	 Object B {
	   Object D: {
	     ReplaceOnChanges: true
	     }
	   Object F: {}
    }
	 Object C {
	   ReplaceOnChanges: true
	   }
  }
}

A.ReplaceOnChanges() == [[B, D], [C]]

type ResourceSpec

type ResourceSpec struct {
	ObjectTypeSpec `yaml:",inline"`

	// InputProperties is a map from property name to PropertySpec that describes the resource's input properties.
	InputProperties map[string]PropertySpec `json:"inputProperties,omitempty" yaml:"inputProperties,omitempty"`
	// RequiredInputs is a list of the names of the resource's required input properties.
	RequiredInputs []string `json:"requiredInputs,omitempty" yaml:"requiredInputs,omitempty"`
	// PlainInputs was a list of the names of the resource's plain input properties. This property is ignored:
	// instead, property types should be marked as plain where necessary.
	PlainInputs []string `json:"plainInputs,omitempty" yaml:"plainInputs,omitempty"`
	// StateInputs is an optional ObjectTypeSpec that describes additional inputs that mau be necessary to get an
	// existing resource. If this is unset, only an ID is necessary.
	StateInputs *ObjectTypeSpec `json:"stateInputs,omitempty" yaml:"stateInputs,omitempty"`
	// Aliases is the list of aliases for the resource.
	Aliases []AliasSpec `json:"aliases,omitempty" yaml:"aliases,omitempty"`
	// DeprecationMessage indicates whether or not the resource is deprecated.
	DeprecationMessage string `json:"deprecationMessage,omitempty" yaml:"deprecationMessage,omitempty"`
	// IsComponent indicates whether the resource is a ComponentResource.
	IsComponent bool `json:"isComponent,omitempty" yaml:"isComponent,omitempty"`
	// Methods maps method names to functions in this schema.
	Methods map[string]string `json:"methods,omitempty" yaml:"methods,omitempty"`
}

ResourceSpec is the serializable form of a resource description.

type ResourceType

type ResourceType struct {
	// Token is the type's Pulumi type token.
	Token string
	// Resource is the type's underlying resource.
	Resource *Resource
}

func (*ResourceType) String

func (t *ResourceType) String() string

type Shortcode

type Shortcode struct {
	ast.BaseBlock

	// Name is the name of the shortcode.
	Name []byte
}

Shortcode represents a shortcode element and its contents, e.g. `{{% examples %}}`.

func NewShortcode

func NewShortcode(name []byte) *Shortcode

NewShortcode creates a new shortcode with the given name.

func (*Shortcode) Dump

func (s *Shortcode) Dump(w io.Writer, source []byte, level int)

func (*Shortcode) Kind

func (*Shortcode) Kind() ast.NodeKind

Kind implements ast.Node.Kind.

type TokenType

type TokenType struct {
	// Token is the type's Pulumi type token.
	Token string
	// Underlying type is the type's underlying type, if any.
	UnderlyingType Type
}

TokenType represents an opaque type that is referred to only by its token. A TokenType may have an underlying type that can be used in place of the token.

func (*TokenType) String

func (t *TokenType) String() string

type Type

type Type interface {
	String() string
	// contains filtered or unexported methods
}

Type represents a datatype in the Pulumi Schema. Types created by this package are identical if they are equal values.

var (
	// BoolType represents the set of boolean values.
	BoolType Type = boolType
	// IntType represents the set of 32-bit integer values.
	IntType Type = intType
	// NumberType represents the set of IEEE754 double-precision values.
	NumberType Type = numberType
	// StringType represents the set of UTF-8 string values.
	StringType Type = stringType
	// ArchiveType represents the set of Pulumi Archive values.
	ArchiveType Type = archiveType
	// AssetType represents the set of Pulumi Asset values.
	AssetType Type = assetType
	// JSONType represents the set of JSON-encoded values.
	JSONType Type = jsonType
	// AnyType represents the complete set of values.
	AnyType Type = anyType
)

type TypeSpec

type TypeSpec struct {
	// Type is the primitive or composite type, if any. May be "bool", "integer", "number", "string", "array", or
	// "object".
	Type string `json:"type,omitempty" yaml:"type,omitempty"`
	// 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"
	Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	// AdditionalProperties, if set, describes the element type of an "object" (i.e. a string -> value map).
	AdditionalProperties *TypeSpec `json:"additionalProperties,omitempty" yaml:"additionalProperties,omitempty"`
	// Items, if set, describes the element type of an array.
	Items *TypeSpec `json:"items,omitempty" yaml:"items,omitempty"`
	// OneOf indicates that values of the type may be one of any of the listed types.
	OneOf []TypeSpec `json:"oneOf,omitempty" yaml:"oneOf,omitempty"`
	// Discriminator informs the consumer of an alternative schema based on the value associated with it.
	Discriminator *DiscriminatorSpec `json:"discriminator,omitempty" yaml:"discriminator,omitempty"`
	// Plain indicates that when used as an input, this type does not accept eventual values.
	Plain bool `json:"plain,omitempty" yaml:"plain,omitempty"`
}

TypeSpec is the serializable form of a reference to a type.

type UnionType

type UnionType struct {
	// ElementTypes are the allowable types for the union type.
	ElementTypes []Type
	// DefaultType is the default type, if any, for the union type. This can be used by targets that do not support
	// unions, or in positions where unions are not appropriate.
	DefaultType Type
	// Discriminator informs the consumer of an alternative schema based on the value associated with it.
	Discriminator string
	// Mapping is an optional object to hold mappings between payload values and schema names or references.
	Mapping map[string]string
}

UnionType represents values that may be any one of a specified set of types.

func (*UnionType) String

func (t *UnionType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL