plugin

package
v3.245.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: Apache-2.0 Imports: 61 Imported by: 141

Documentation

Index

Constants

View Source
const (
	// Propose: The provider may use the proposed name as a suggestion but is free to modify it.
	AutonamingModePropose AutonamingMode = iota
	// Enforce: The provider must use exactly the proposed name or return an error.
	AutonamingModeEnforce = 1
	// Disabled: The provider should disable automatic naming and return an error if no explicit name is provided
	// by user's program.
	AutonamingModeDisabled = 2
)
View Source
const (
	// UnknownBoolValue is a sentinel indicating that a bool property's value is not known, because it depends on
	// a computation with values whose values themselves are not yet known (e.g., dependent upon an output property).
	UnknownBoolValue = "1c4a061d-8072-4f0a-a4cb-0ff528b18fe7"
	// UnknownNumberValue is a sentinel indicating that a number property's value is not known, because it depends on
	// a computation with values whose values themselves are not yet known (e.g., dependent upon an output property).
	UnknownNumberValue = "3eeb2bf0-c639-47a8-9e75-3b44932eb421"
	// UnknownStringValue is a sentinel indicating that a string property's value is not known, because it depends on
	// a computation with values whose values themselves are not yet known (e.g., dependent upon an output property).
	UnknownStringValue = "04da6b54-80e4-46f7-96ec-b56ff0331ba9"
	// UnknownArrayValue is a sentinel indicating that an array property's value is not known, because it depends on
	// a computation with values whose values themselves are not yet known (e.g., dependent upon an output property).
	UnknownArrayValue = "6a19a0b0-7e62-4c92-b797-7f8e31da9cc2"
	// UnknownAssetValue is a sentinel indicating that an asset property's value is not known, because it depends on
	// a computation with values whose values themselves are not yet known (e.g., dependent upon an output property).
	UnknownAssetValue = "030794c1-ac77-496b-92df-f27374a8bd58"
	// UnknownArchiveValue is a sentinel indicating that an archive property's value is not known, because it depends
	// on a computation with values whose values themselves are not yet known (e.g., dependent upon an output property).
	UnknownArchiveValue = "e48ece36-62e2-4504-bad9-02848725956a"
	// UnknownObjectValue is a sentinel indicating that an archive property's value is not known, because it depends
	// on a computation with values whose values themselves are not yet known (e.g., dependent upon an output property).
	UnknownObjectValue = "dd056dcd-154b-4c76-9bd3-c8f88648b5ff"
)

Variables

View Source
var ErrDoubleParameterized = errors.New("cannot specify parameterization for a parameterized provider")
View Source
var ErrNotYetImplemented = errors.New("NYI")

ErrNotYetImplemented may be returned from a provider for optional methods that are not yet implemented.

Functions

func GetLanguageAttachPort added in v3.143.0

func GetLanguageAttachPort(runtime string) (*int, error)

Checks PULUMI_DEBUG_LANGUAGES environment variable for any overrides for the language identified by name. If the user has requested to attach to a live language plugin, returns the port number from the env var.

For example, `PULUMI_DEBUG_LANGUAGES=go:12345,dotnet:678` will result in 12345 for go and 678 for dotnet.

func GetProviderAttachPort added in v3.109.0

func GetProviderAttachPort(pkg tokens.Package) (*int, error)

Checks PULUMI_DEBUG_PROVIDERS environment variable for any overrides for the provider identified by pkg. If the user has requested to attach to a live provider, returns the port number from the env var. For example, `PULUMI_DEBUG_PROVIDERS=aws:12345,gcp:678` will result in 12345 for aws.

func HclDiagnosticToRPCDiagnostic added in v3.67.0

func HclDiagnosticToRPCDiagnostic(diag *hcl.Diagnostic) *codegenrpc.Diagnostic

func HclDiagnosticsToRPCDiagnostics added in v3.80.0

func HclDiagnosticsToRPCDiagnostics(diags []*hcl.Diagnostic) []*codegenrpc.Diagnostic

func IsLocalPluginPath added in v3.157.0

func IsLocalPluginPath(ctx context.Context, source string) bool

IsLocalPluginPath determines if a plugin source refers to a local path rather than a downloadable plugin. A plugin is considered local if it doesn't match the plugin name regexp and doesn't have a download URL.

func MakeExecutablePromptChoices added in v3.122.0

func MakeExecutablePromptChoices(executables ...string) []*pulumirpc.RuntimeOptionPrompt_RuntimeOptionValue

MakeRuntimeOptionPromptChoices creates a list of runtime option values from a list of executable names. If an executable is not found, it will be listed with a `[not found]` suffix at the end of the list.

func MarshalArchive

func MarshalArchive(v *archive.Archive, opts MarshalOptions) (*structpb.Value, error)

MarshalArchive marshals an archive into its wire form for resource provider plugins.

func MarshalAsset

func MarshalAsset(v *asset.Asset, opts MarshalOptions) (*structpb.Value, error)

MarshalAsset marshals an asset into its wire form for resource provider plugins.

func MarshalNull

func MarshalNull(opts MarshalOptions) *structpb.Value

MarshalNull marshals a nil to its protobuf form.

func MarshalProperties

func MarshalProperties(props resource.PropertyMap, opts MarshalOptions) (*structpb.Struct, error)

MarshalProperties marshals a resource's property map as a "JSON-like" protobuf structure.

func MarshalPropertyValue

func MarshalPropertyValue(key resource.PropertyKey, v resource.PropertyValue,
	opts MarshalOptions,
) (*structpb.Value, error)

MarshalPropertyValue marshals a single resource property value into its "JSON-like" value representation.

func MarshalString

func MarshalString(s string, opts MarshalOptions) *structpb.Value

MarshalString marshals a string to its protobuf form.

func MarshalStruct

func MarshalStruct(obj *structpb.Struct, opts MarshalOptions) *structpb.Value

MarshalStruct marshals a struct for use in a protobuf field where a value is expected.

func NewAnalyzerServer added in v3.204.0

func NewAnalyzerServer(analyzer Analyzer) pulumirpc.AnalyzerServer

func NewCheckResponse

func NewCheckResponse(err error) *pulumirpc.CheckResponse

NewCheckResponse produces a response with property validation failures from the given array of mapper failures.

func NewConverterServer added in v3.58.0

func NewConverterServer(converter Converter) pulumirpc.ConverterServer

func NewDetailedDiffFromObjectDiff added in v3.19.0

func NewDetailedDiffFromObjectDiff(diff *resource.ObjectDiff, inputDiff bool) map[string]PropertyDiff

NewDetailedDiffFromObjectDiff computes the detailed diff of Updated, Added and Deleted keys.

func NewProviderServer

func NewProviderServer(provider Provider) pulumirpc.ResourceProviderServer

func RPCDiagnosticToHclDiagnostic added in v3.67.0

func RPCDiagnosticToHclDiagnostic(diag *codegenrpc.Diagnostic) *hcl.Diagnostic

func UnmarshalProperties

func UnmarshalProperties(props *structpb.Struct, opts MarshalOptions) (resource.PropertyMap, error)

UnmarshalProperties unmarshals a "JSON-like" protobuf structure into a new resource property map.

func UnmarshalPropertyValue

func UnmarshalPropertyValue(key resource.PropertyKey, v *structpb.Value,
	opts MarshalOptions,
) (*resource.PropertyValue, error)

UnmarshalPropertyValue unmarshals a single "JSON-like" value into a new property value.

func ValidatePulumiVersionRange added in v3.217.0

func ValidatePulumiVersionRange(pulumiVersionRange, cliVersion string) error

ValidatePulumiVersionRange validates that the CLI version satisfies the passed version range. The supported syntax for ranges is that of https://pkg.go.dev/github.com/blang/semver#ParseRange. For example ">=3.0.0", or "!3.1.2". Ranges can be AND-ed together by concatenating with spaces ">=3.5.0 !3.7.7", meaning greater-or-equal to 3.5.0 and not exactly 3.7.7. Ranges can be OR-ed with the `||` operator: "<3.4.0 || >3.8.0", meaning less-than 3.4.0 or greater-than 3.8.0.

Types

type AboutInfo added in v3.38.0

type AboutInfo struct {
	Executable string
	Version    string
	Metadata   map[string]string
}

type AnalyzeDiagnostic

type AnalyzeDiagnostic struct {
	PolicyName        string
	PolicyPackName    string
	PolicyPackVersion string
	Description       string
	Message           string
	EnforcementLevel  apitype.EnforcementLevel
	URN               resource.URN
	Severity          apitype.PolicySeverity
}

AnalyzeDiagnostic indicates that resource analysis failed; it contains the property and reason for the failure.

type AnalyzeResponse added in v3.197.0

type AnalyzeResponse struct {
	// Information about policy violations.
	Diagnostics []AnalyzeDiagnostic
	// Information about policies that were not applicable.
	NotApplicable []PolicyNotApplicable
}

AnalyzeResponse is the response from the Analyze method, containing violations.

type Analyzer

type Analyzer interface {
	// Closer closes any underlying OS resources associated with this provider (like processes, RPC channels, etc).
	io.Closer
	// Name fetches an analyzer's qualified name.
	Name() tokens.QName
	// Analyze analyzes a single resource object, and returns any errors that it finds.
	// Is called before the resource is modified.
	Analyze(ctx context.Context, r AnalyzerResource) (AnalyzeResponse, error)
	// AnalyzeStack analyzes all resources after a successful preview or update.
	// Is called after all resources have been processed, and all changes applied.
	AnalyzeStack(ctx context.Context, resources []AnalyzerStackResource) (AnalyzeResponse, error)
	// Remediate is given the opportunity to optionally transform a single resource's properties.
	Remediate(ctx context.Context, r AnalyzerResource) (RemediateResponse, error)
	// GetAnalyzerInfo returns metadata about the analyzer (e.g., list of policies contained).
	GetAnalyzerInfo(ctx context.Context) (AnalyzerInfo, error)
	// GetPluginInfo returns this plugin's information.
	GetPluginInfo(ctx context.Context) (PluginInfo, error)
	// Configure configures the analyzer, passing configuration properties for each policy.
	Configure(ctx context.Context, policyConfig map[string]AnalyzerPolicyConfig) error
	// Cancel signals the analyzer to gracefully shut down and abort any ongoing analysis operations.
	// Operations aborted in this way will return an error. Since Cancel is advisory and non-blocking,
	// it is up to the host to decide how long to wait after Cancel is called before (e.g.)
	// hard-closing any gRPC connection.
	Cancel(ctx context.Context) error
}

Analyzer provides a pluggable interface for performing arbitrary analysis of entire projects/stacks/snapshots, and/or individual resources, for arbitrary issues. These might be style, policy, correctness, security, or performance related. This interface hides the messiness of the underlying machinery, since providers are behind an RPC boundary.

func NewAnalyzer

func NewAnalyzer(host Host, ctx *Context, name tokens.QName) (Analyzer, error)

NewAnalyzer binds to a given analyzer's plugin by name and creates a gRPC connection to it. If the associated plugin could not be found by name on the PATH, or an error occurs while creating the child process, an error is returned.

func NewAnalyzerWithClient added in v3.204.0

func NewAnalyzerWithClient(name tokens.QName, client pulumirpc.AnalyzerClient) Analyzer

func NewPolicyAnalyzer

func NewPolicyAnalyzer(
	host Host, ctx *Context, name tokens.QName, policyPackPath string, opts *PolicyAnalyzerOptions,
	hasPlugin func(workspace.PluginDescriptor) bool,
) (Analyzer, error)

NewPolicyAnalyzer boots the analyzer plugin located at `policyPackpath`. `hasPlugin` is a function that allows the caller to configure how it is determined if the language plugin is available. If nil it will default to looking for the plugin by path.

type AnalyzerInfo

type AnalyzerInfo struct {
	// The name of the policy pack.
	Name string
	// An optional pretty name for the policy pack.
	DisplayName string
	// The version of the policy pack.
	Version string
	// Whether the policy pack supports configuration.
	SupportsConfig bool
	// The policies defined in the policy pack.
	Policies []AnalyzerPolicyInfo
	// The initial configuration for the policy pack.
	InitialConfig map[string]AnalyzerPolicyConfig
	// A brief description of the policy pack. This will override the description in PulumiPolicy.yaml.
	Description string
	// README text about the policy pack.
	Readme string
	// The cloud provider/platform this policy pack is associated with, e.g. AWS, Azure, etc.
	Provider string
	// Tags for this policy pack.
	Tags []string
	// A URL to the repository where the policy pack is defined.
	Repository string
}

AnalyzerInfo provides metadata about a PolicyPack inside an analyzer.

type AnalyzerPolicyComplianceFramework added in v3.197.0

type AnalyzerPolicyComplianceFramework struct {
	// The compliance framework name.
	Name string
	// The compliance framework version.
	Version string
	// The compliance framework reference.
	Reference string
	// The compliance framework specification.
	Specification string
}

AnalyzerPolicyComplianceFramework represents a compliance framework that a policy belongs to.

type AnalyzerPolicyConfig

type AnalyzerPolicyConfig struct {
	// Configured enforcement level for the policy.
	EnforcementLevel apitype.EnforcementLevel
	// Configured properties of the policy.
	Properties map[string]any
}

AnalyzerPolicyConfig is the configuration for a policy.

type AnalyzerPolicyConfigSchema

type AnalyzerPolicyConfigSchema struct {
	// Map of config property names to JSON schema.
	Properties map[string]JSONSchema

	// Required config properties
	Required []string
}

AnalyzerPolicyConfigSchema provides metadata about a policy's configuration.

type AnalyzerPolicyInfo

type AnalyzerPolicyInfo struct {
	// Unique URL-safe name for the policy.  This is unique to a specific version
	// of a Policy Pack.
	Name string
	// An optional pretty name for the policy.
	DisplayName string

	// Description is used to provide more context about the purpose of the policy.
	Description      string
	EnforcementLevel apitype.EnforcementLevel

	// Message is the message that will be displayed to end users when they violate
	// this policy.
	Message string

	// ConfigSchema is optional config schema for the policy.
	ConfigSchema *AnalyzerPolicyConfigSchema

	// Type of the policy.
	Type AnalyzerPolicyType
	// Severity is the severity level of the policy.
	Severity apitype.PolicySeverity
	// The compliance framework that this policy belongs to.
	Framework *AnalyzerPolicyComplianceFramework
	// Tags associated with the policy
	Tags []string
	// A description of the steps to take to remediate a policy violation.
	RemediationSteps string
	// An optional URL to more information about the policy.
	URL string
}

AnalyzerPolicyInfo defines the metadata for an individual Policy within a Policy Pack.

type AnalyzerPolicyType added in v3.197.0

type AnalyzerPolicyType int

AnalyzerPolicyType indicates the type of a policy.

const (
	// Unknown policy type.
	AnalyzerPolicyTypeUnknown AnalyzerPolicyType = iota
	// A policy that validates a resource.
	AnalyzerPolicyTypeResource
	// A policy that validates a stack.
	AnalyzerPolicyTypeStack
)

type AnalyzerProviderResource

type AnalyzerProviderResource struct {
	URN        resource.URN
	Type       tokens.Type
	Name       string
	Properties resource.PropertyMap
}

AnalyzerProviderResource mirrors a resource's provider sent to the analyzer.

type AnalyzerResource

type AnalyzerResource struct {
	URN        resource.URN
	Type       tokens.Type
	Name       string
	Properties resource.PropertyMap
	Options    AnalyzerResourceOptions
	Provider   *AnalyzerProviderResource
}

AnalyzerResource mirrors a resource that is passed to `Analyze`.

type AnalyzerResourceOptions

type AnalyzerResourceOptions struct {
	Protect                 bool                    // true to protect this resource from deletion.
	IgnoreChanges           []string                // a list of property names to ignore during changes.
	DeleteBeforeReplace     *bool                   // true if this resource should be deleted prior to replacement.
	AdditionalSecretOutputs []resource.PropertyKey  // outputs that should always be treated as secrets.
	AliasURNs               []resource.URN          // additional URNs that should be aliased to this resource.
	Aliases                 []resource.Alias        // additional URNs that should be aliased to this resource.
	CustomTimeouts          resource.CustomTimeouts // an optional config object for resource options
	Parent                  resource.URN            // an optional parent URN for this resource.
}

AnalyzerResourceOptions mirrors resource options sent to the analyzer.

type AnalyzerStackResource

type AnalyzerStackResource struct {
	AnalyzerResource
	Parent               resource.URN                            // an optional parent URN for this resource.
	Dependencies         []resource.URN                          // dependencies of this resource object.
	PropertyDependencies map[resource.PropertyKey][]resource.URN // the set of dependencies that affect each property.
}

AnalyzerStackResource mirrors a resource that is passed to `AnalyzeStack`.

type AutonamingMode added in v3.143.0

type AutonamingMode int32

The mode that controls how the provider handles the proposed name. If not specified, defaults to `Propose`.

type AutonamingOptions added in v3.143.0

type AutonamingOptions struct {
	// ProposedName is the name that the provider should use for the resource.
	ProposedName string
	// Mode is the mode that controls how the provider handles the proposed name.
	Mode AutonamingMode
	// WarnIfNoSupport indicates whether the provider plugin should log a warning if the provider does not support
	// autonaming configuration.
	WarnIfNoSupport bool
}

Configuration for automatic resource naming behavior. This structure contains fields that control how the provider handles resource names, including proposed names and naming modes.

type CallInfo added in v3.6.0

type CallInfo struct {
	Project        string                // the project name housing the program being run.
	Stack          string                // the stack name being evaluated.
	Config         map[config.Key]string // the configuration variables to apply before running.
	DryRun         bool                  // true if we are performing a dry-run (preview).
	Parallel       int32                 // the degree of parallelism for resource operations (<=1 for serial).
	MonitorAddress string                // the RPC address to the host resource monitor.

	// A handle to the stack trace that originated the Call. Used to stitch together stack traces across plugins.
	StackTraceHandle string
}

CallInfo contains all of the information required to register resources as part of a call to Construct.

type CallOptions added in v3.6.0

type CallOptions struct {
	// ArgDependencies is a map from argument keys to a list of resources that the argument depends on.
	ArgDependencies map[resource.PropertyKey][]resource.URN
}

CallOptions captures options for a call to Call.

type CallRequest added in v3.120.0

type CallRequest struct {
	Tok     tokens.ModuleMember
	Args    resource.PropertyMap
	Info    CallInfo
	Options CallOptions
}

type CallResponse added in v3.120.0

type CallResponse = CallResult

type CallResult added in v3.6.0

type CallResult struct {
	// The returned values, if the call was successful.
	// In the case of a scalar/non-map result, a single key with any name can be used to return the
	// value.
	Return resource.PropertyMap
	// A map from return value keys to the dependencies of the return value.
	ReturnDependencies map[resource.PropertyKey][]resource.URN
	// The failures if any arguments didn't pass verification.
	Failures []CheckFailure
}

CallResult is the result of a call to Call.

type CheckConfigRequest added in v3.120.0

type CheckConfigRequest struct {
	URN           resource.URN
	Name          string
	Type          tokens.Type
	Olds, News    resource.PropertyMap
	AllowUnknowns bool
}

type CheckConfigResponse added in v3.120.0

type CheckConfigResponse struct {
	Properties resource.PropertyMap
	Failures   []CheckFailure
}

type CheckFailure

type CheckFailure struct {
	Property resource.PropertyKey // the property that failed checking.
	Reason   string               // the reason the property failed to check.
}

CheckFailure indicates that a call to check failed; it contains the property and reason for the failure.

type CheckRequest added in v3.120.0

type CheckRequest struct {
	URN  resource.URN
	Name string
	Type tokens.Type
	// TODO Change to (State, Input)
	Olds, News    resource.PropertyMap
	AllowUnknowns bool
	RandomSeed    []byte
	Autonaming    *AutonamingOptions
}

type CheckResponse added in v3.120.0

type CheckResponse struct {
	Properties resource.PropertyMap
	Failures   []CheckFailure
}

type ConfigSource

type ConfigSource interface {
	// GetPackageConfig returns the set of configuration parameters for the indicated package, if any.
	GetPackageConfig(pkg tokens.Package) (resource.PropertyMap, error)
}

ConfigSource is an interface that allows a plugin context to fetch configuration data for a plugin named by package.

type ConfigureRequest added in v3.120.0

type ConfigureRequest struct {
	// The URN of the provider being configured. N.B. This will be null if configure_with_urn was false in
	// Handshake.
	URN *resource.URN
	// The name of the provider being configured. This must match the name specified by the `urn` field, and
	// is passed so that providers do not have to implement URN parsing in order to extract the name of the
	// provider.  N.B. This will be null if configure_with_urn was false in Handshake.
	Name *string
	// The type of the provider being configured. This must match the type specified by the `urn` field, and
	// is passed so that providers do not have to implement URN parsing in order to extract the type of the
	// provider. N.B. This will be null if configure_with_urn was false in Handshake.
	Type *tokens.Type
	// The ID of the provider being configured. N.B. This will be null if configure_with_urn was false in
	// Handshake.
	ID *resource.ID
	// A map of input properties for the provider.
	Inputs resource.PropertyMap
}

type ConfigureResponse added in v3.120.0

type ConfigureResponse struct{}

type ConstructInfo

type ConstructInfo struct {
	Project          string                // the project name housing the program being run.
	Stack            string                // the stack name being evaluated.
	Organization     string                // the organization name housing the program being run (might be empty).
	Config           map[config.Key]string // the configuration variables to apply before running.
	ConfigSecretKeys []config.Key          // the configuration keys that have secret values.
	DryRun           bool                  // true if we are performing a dry-run (preview).
	Parallel         int32                 // the degree of parallelism for resource operations (<=1 for serial).
	MonitorAddress   string                // the RPC address to the host resource monitor.

	// A handle to the stack trace that originated the Construct. Used to stitch together stack traces across plugins.
	StackTraceHandle string
}

ConstructInfo contains all of the information required to register resources as part of a call to Construct.

type ConstructOptions

type ConstructOptions struct {
	// Aliases is the set of aliases for the component.
	Aliases []resource.Alias

	// Dependencies is the list of resources this component depends on.
	Dependencies []resource.URN

	// Protect is true if the component is protected.
	Protect *bool

	// Providers is a map from package name to provider reference.
	Providers map[string]string

	// PropertyDependencies is a map from property name to a list of resources that property depends on.
	PropertyDependencies map[resource.PropertyKey][]resource.URN

	// AdditionalSecretOutputs lists extra output properties
	// that should be treated as secrets.
	AdditionalSecretOutputs []string

	// CustomTimeouts overrides default timeouts for resource operations.
	CustomTimeouts *CustomTimeouts

	// DeletedWith specifies that if the given resource is deleted,
	// it will also delete this resource.
	DeletedWith resource.URN

	// ReplaceWith specifies that if any of the given resources are replaced,
	// this resource will also be replaced.
	ReplaceWith []resource.URN

	// DeleteBeforeReplace specifies that replacements of this resource
	// should delete the old resource before creating the new resource.
	DeleteBeforeReplace *bool

	// IgnoreChanges lists properties that should be ignored
	// when determining whether the resource should has changed.
	IgnoreChanges []string

	// ReplaceOnChanges lists properties changing which should cause
	// the resource to be replaced.
	ReplaceOnChanges []string

	// ReplacementTrigger specifies that if set, the engine will diff this with
	// the last recorded value, and trigger a replace if they are not equal.
	ReplacementTrigger resource.PropertyValue

	// RetainOnDelete is true if deletion of the resource should not
	// delete the resource in the provider.
	RetainOnDelete *bool

	// ResourceHooks specifies hooks to be executed before and after
	// resource operations.
	ResourceHooks map[resource.HookType][]string
}

ConstructOptions captures options for a call to Construct.

type ConstructRequest added in v3.120.0

type ConstructRequest struct {
	Info    ConstructInfo
	Type    tokens.Type
	Name    string
	Parent  resource.URN
	Inputs  resource.PropertyMap
	Options ConstructOptions
}

type ConstructResponse added in v3.120.0

type ConstructResponse = ConstructResult

type ConstructResult

type ConstructResult struct {
	// The URN of the constructed component resource.
	URN resource.URN
	// The output properties of the component resource.
	Outputs resource.PropertyMap
	// The resources that each output property depends on.
	OutputDependencies map[resource.PropertyKey][]resource.URN
}

ConstructResult is the result of a call to Construct.

type Context

type Context struct {
	Diag       diag.Sink // the diagnostics sink to use for messages.
	StatusDiag diag.Sink // the diagnostics sink to use for status messages.
	Host       Host      // the host that can be used to fetch providers.
	Pwd        string    // the working directory to spawn all plugins in.
	Root       string    // the root directory of the context.

	// If non-nil, configures custom gRPC client options. Receives pluginInfo which is a JSON-serializable bit of
	// metadata describing the plugin.
	DialOptions func(pluginInfo any) []grpc.DialOption

	DebugTraceMutex *sync.Mutex // used internally to syncronize debug tracing
	// contains filtered or unexported fields
}

Context is used to group related operations together so that associated OS resources can be cached, shared, and reclaimed as appropriate. It also carries shared plugin configuration.

func NewContext

func NewContext(ctx context.Context, d, statusD diag.Sink, host Host, _ ConfigSource,
	pwd string, runtimeOptions map[string]any, disableProviderPreview bool,
	parentSpan opentracing.Span, newLoader NewLoaderFunc, installLang LanguageInstaller,
) (*Context, error)

NewContext allocates a new context with a given sink and host. Note that the host is "owned" by this context from here forwards, such that when the context's resources are reclaimed, so too are the host's.

func NewContextWithHost added in v3.217.0

func NewContextWithHost(
	ctx context.Context,
	d, statusD diag.Sink,
	host Host,
	pwd, root string,
	parentSpan opentracing.Span,
) *Context

NewContextWithHost creates a new Context without interacting with global state.

Unilke [NewDefaultContext] or NewContextWithRoot, NewContextWithHost does not accept a nil host.

d, statusD and parentSpan may all be nil.

func NewContextWithRoot added in v3.3.0

func NewContextWithRoot(ctx context.Context, d, statusD diag.Sink, host Host,
	pwd, root string, runtimeOptions map[string]any, disableProviderPreview bool,
	parentSpan opentracing.Span, plugins *workspace.Plugins, packages map[string]workspace.PackageSpec,
	config map[config.Key]string, debugging DebugContext, newLoader NewLoaderFunc,
	installLang LanguageInstaller,
) (*Context, error)

NewContextWithRoot is a variation of NewContext that also sets known project Root. Additionally accepts Plugins

func (*Context) Base added in v3.139.0

func (ctx *Context) Base() context.Context

Base returns this plugin context's base context; this is useful for things like cancellation.

func (*Context) Close

func (ctx *Context) Close() error

Close reclaims all resources associated with this context.

func (*Context) Request

func (ctx *Context) Request() context.Context

Request allocates a request sub-context.

type ConvertProgramRequest added in v3.58.0

type ConvertProgramRequest struct {
	SourceDirectory           string
	TargetDirectory           string
	MapperTarget              string
	LoaderTarget              string
	Args                      []string
	GeneratedProjectDirectory string
}

type ConvertProgramResponse added in v3.58.0

type ConvertProgramResponse struct {
	Diagnostics hcl.Diagnostics
}

type ConvertSnippetRequest added in v3.243.0

type ConvertSnippetRequest struct {
	Filename     string
	Source       []byte
	TargetLoader string
	// Package identifies the package (and any parameterization) the snippet belongs to so the converter can load
	// the same schema we did when invoking the provider.
	Package    *codegenrpc.GetSchemaRequest
	Token      string
	Attributes map[string]string
}

type ConvertSnippetResponse added in v3.243.0

type ConvertSnippetResponse struct {
	Diagnostics hcl.Diagnostics
	Filename    string
	Source      []byte
	Attributes  map[string]string
}

type ConvertStateRequest added in v3.58.0

type ConvertStateRequest struct {
	MapperTarget string
	Args         []string
}

type ConvertStateResponse added in v3.58.0

type ConvertStateResponse struct {
	Resources   []ResourceImport
	Diagnostics hcl.Diagnostics
}

type Converter added in v3.58.0

type Converter interface {
	io.Closer

	ConvertState(ctx context.Context, req *ConvertStateRequest) (*ConvertStateResponse, error)

	ConvertProgram(ctx context.Context, req *ConvertProgramRequest) (*ConvertProgramResponse, error)

	ConvertSnippet(ctx context.Context, req *ConvertSnippetRequest) (*ConvertSnippetResponse, error)
}

func NewConverter added in v3.58.0

func NewConverter(ctx *Context, name string, version *semver.Version) (Converter, error)

type CreateRequest added in v3.120.0

type CreateRequest struct {
	URN        resource.URN
	Name       string
	Type       tokens.Type
	Properties resource.PropertyMap
	Timeout    float64
	Preview    bool
	// The gRPC address of the ResourceStatus service which can be used to create view resources.
	ResourceStatusAddress string
	// The ResourceStatus service token to pass when calling methods on the service.
	ResourceStatusToken string
}

type CreateResponse added in v3.120.0

type CreateResponse struct {
	ID         resource.ID
	Properties resource.PropertyMap
	Status     resource.Status
	// Indicates that this resource should always be refreshed prior to updates.
	RefreshBeforeUpdate bool
}

type CustomTimeouts added in v3.65.0

type CustomTimeouts struct {
	Create string
	Update string
	Delete string
}

CustomTimeouts overrides default timeouts for resource operations. Timeout values are strings in the format accepted by time.ParseDuration.

type DebugContext added in v3.170.0

type DebugContext interface {
	// StartDebugging asks the host to start a debug session for the given configuration.
	StartDebugging(info DebuggingInfo) error

	// AttachDebugger returns true if debugging is enabled.
	AttachDebugger(spec DebugSpec) bool
}

type DebugSpec added in v3.171.0

type DebugSpec struct {
	// Type is the type of the thing to debug. Can be "program" or "plugin".
	Type DebugType

	// Name is the name of the plugin. Only used if Type is DebugTypePlugin.
	Name string
}

type DebugType added in v3.171.0

type DebugType int
const (
	// DebugTypeProgram indicates that the debug session is for a program.
	DebugTypeProgram DebugType = iota
	// DebugTypePlugin indicates that the debug session is for a plugin.
	DebugTypePlugin
)

type DebuggingInfo added in v3.131.0

type DebuggingInfo struct {
	// Config is the debug configuration (language-specific, see Debug Adapter Protocol)
	Config map[string]any
}

type DeleteRequest added in v3.120.0

type DeleteRequest struct {
	URN             resource.URN
	Name            string
	Type            tokens.Type
	ID              resource.ID
	Inputs, Outputs resource.PropertyMap
	Timeout         float64
	// The gRPC address of the ResourceStatus service which can be used to delete view resources.
	ResourceStatusAddress string
	// The ResourceStatus service token to pass when calling methods on the service.
	ResourceStatusToken string
	// The old views of the resource being deleted.
	OldViews []View
}

type DeleteResponse added in v3.120.0

type DeleteResponse struct {
	Status resource.Status
}

type DependencyInfo added in v3.38.0

type DependencyInfo struct {
	// The name of the dependency.
	Name string
	// The version of the dependency. Unlike most versions in the system this is not guaranteed to be a semantic
	// version.
	Version string
}

DependencyInfo contains information about a dependency reported by a language runtime. These are the languages dependencies, they are not necessarily Pulumi packages.

type DiffChanges

type DiffChanges int

DiffChanges represents the kind of changes detected by a diff operation.

const (
	// DiffUnknown indicates the provider didn't offer information about the changes (legacy behavior).
	DiffUnknown DiffChanges = 0
	// DiffNone indicates the provider performed a diff and concluded that no update is needed.
	DiffNone DiffChanges = 1
	// DiffSome indicates the provider performed a diff and concluded that an update or replacement is needed.
	DiffSome DiffChanges = 2
)

type DiffConfigRequest added in v3.120.0

type DiffConfigRequest struct {
	URN                              resource.URN
	Name                             string
	Type                             tokens.Type
	OldInputs, OldOutputs, NewInputs resource.PropertyMap
	AllowUnknowns                    bool
	IgnoreChanges                    []string
}

type DiffConfigResponse added in v3.120.0

type DiffConfigResponse = DiffResult

type DiffKind

type DiffKind int

DiffKind represents the kind of diff that applies to a particular property.

const (
	// DiffAdd indicates that the property was added.
	DiffAdd DiffKind = 0
	// DiffAddReplace indicates that the property was added and requires that the resource be replaced.
	DiffAddReplace DiffKind = 1
	// DiffDelete indicates that the property was deleted.
	DiffDelete DiffKind = 2
	// DiffDeleteReplace indicates that the property was added and requires that the resource be replaced.
	DiffDeleteReplace DiffKind = 3
	// DiffUpdate indicates that the property was updated.
	DiffUpdate DiffKind = 4
	// DiffUpdateReplace indicates that the property was updated and requires that the resource be replaced.
	DiffUpdateReplace DiffKind = 5
)

func (DiffKind) AsReplace added in v3.6.1

func (d DiffKind) AsReplace() DiffKind

AsReplace converts a DiffKind into the equivalent replacement if it not already a replacement.

func (DiffKind) Invert added in v3.120.0

func (d DiffKind) Invert() DiffKind

Invert returns the opposite diff kind to the receiver. That is:

  • Add -> Delete
  • AddReplace -> DeleteReplace
  • Delete -> Add
  • DeleteReplace -> AddReplace
  • Update -> Update
  • UpdateReplace -> UpdateReplace

func (DiffKind) IsReplace

func (d DiffKind) IsReplace() bool

func (DiffKind) String

func (d DiffKind) String() string

type DiffRequest added in v3.120.0

type DiffRequest struct {
	URN  resource.URN
	Name string
	Type tokens.Type
	ID   resource.ID
	// TODO Change to (OldInputs, OldState, NewInputs)
	OldInputs, OldOutputs, NewInputs resource.PropertyMap
	AllowUnknowns                    bool
	IgnoreChanges                    []string
}

type DiffResponse added in v3.120.0

type DiffResponse = DiffResult

type DiffResult

type DiffResult struct {
	Changes             DiffChanges             // true if this diff represents a changed resource.
	ReplaceKeys         []resource.PropertyKey  // an optional list of replacement keys.
	StableKeys          []resource.PropertyKey  // an optional list of property keys that are stable.
	ChangedKeys         []resource.PropertyKey  // an optional list of keys that changed.
	DetailedDiff        map[string]PropertyDiff // an optional structured diff
	DeleteBeforeReplace bool                    // if true, this resource must be deleted before recreating it.
}

DiffResult indicates whether an operation should replace or update an existing resource.

func (DiffResult) Invert added in v3.120.0

func (r DiffResult) Invert() DiffResult

Invert computes the inverse diff of the receiver -- the diff that would be required to "undo" this one.

func (DiffResult) Replace

func (r DiffResult) Replace() bool

Replace returns true if this diff represents a replacement.

type DiffUnavailableError

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

DiffUnavailableError may be returned by a provider if the provider is unable to diff a resource.

func DiffUnavailable

func DiffUnavailable(reason string) DiffUnavailableError

DiffUnavailable creates a new DiffUnavailableError with the given message.

func (DiffUnavailableError) Error

func (e DiffUnavailableError) Error() string

Error returns the error message for this DiffUnavailableError.

type Flags

type Flags int

Flags can be used to filter out plugins during loading that aren't necessary.

const (
	// AnalyzerPlugins is used to only load analyzers.
	AnalyzerPlugins Flags = 1 << iota
	// LanguagePlugins is used to only load language plugins.
	LanguagePlugins
	// ResourcePlugins is used to only load resource provider plugins.
	ResourcePlugins
)

type GetMappingRequest added in v3.120.0

type GetMappingRequest struct {
	Key, Provider string
}

type GetMappingResponse added in v3.120.0

type GetMappingResponse struct {
	Data     []byte
	Provider string
}

type GetMappingsRequest added in v3.120.0

type GetMappingsRequest struct {
	Key string
}

type GetMappingsResponse added in v3.120.0

type GetMappingsResponse struct {
	Keys []string
}

type GetSchemaRequest added in v3.117.0

type GetSchemaRequest struct {
	// Version is the version of the schema to return. If omitted, the latest version of the schema should be returned.
	Version int32
	// Subpackage name to get the schema for.
	SubpackageName string
	// Subpackage version to get the schema for.
	SubpackageVersion *semver.Version
}

type GetSchemaResponse added in v3.120.0

type GetSchemaResponse struct {
	// The bytes of the JSON serialized Pulumi schema for generating the provider's SDK.
	Schema []byte
}

GetSchemaResponse is the response to a GetSchema call.

type GrpcProvider added in v3.30.0

type GrpcProvider interface {
	Provider

	// Attach triggers an attach for a currently running provider to the engine
	// TODO It would be nice if this was a HostClient rather than the string address but due to dependency
	// ordering we don't have access to declare that here.
	Attach(address string) error
}

type GrpcServer added in v3.60.0

type GrpcServer struct {
	io.Closer
	// contains filtered or unexported fields
}

GrpcServer is a standard Pulumi style gRPC server that can be used to serve gRPC services.

func NewServer added in v3.60.0

func NewServer(ctx *Context, registrations ...func(server *grpc.Server)) (*GrpcServer, error)

NewServer creates a new GrpcServer wired up to the given services and context.

func (*GrpcServer) Addr added in v3.60.0

func (s *GrpcServer) Addr() string

func (*GrpcServer) Close added in v3.60.0

func (s *GrpcServer) Close() error

type Host

type Host interface {
	// ServerAddr returns the address at which the host's RPC interface may be found.
	ServerAddr() string

	// LoaderAddr returns the address at which a plugin loader service may be found.
	LoaderAddr() string

	// Log logs a message, including errors and warnings.  Messages can have a resource URN
	// associated with them.  If no urn is provided, the message is global.
	Log(sev diag.Severity, urn resource.URN, msg string, streamID int32)

	// LogStatus logs a status message message, including errors and warnings. Status messages show
	// up in the `Info` column of the progress display, but not in the final output. Messages can
	// have a resource URN associated with them.  If no urn is provided, the message is global.
	LogStatus(sev diag.Severity, urn resource.URN, msg string, streamID int32)

	// Analyzer fetches the analyzer with a given name, possibly lazily allocating the plugins for
	// it.  If an analyzer could not be found, or an error occurred while creating it, a non-nil
	// error is returned.
	Analyzer(nm tokens.QName) (Analyzer, error)

	// PolicyAnalyzer boots the nodejs analyzer plugin located at a given path. This is useful
	// because policy analyzers generally do not need to be "discovered" -- the engine is given a
	// set of policies that are required to be run during an update, so they tend to be in a
	// well-known place.
	PolicyAnalyzer(name tokens.QName, path string, opts *PolicyAnalyzerOptions) (Analyzer, error)

	// Provider loads a new copy of the provider for a given package.  If a provider for this package could not be
	// found, or an error occurs while creating it, a non-nil error is returned.
	Provider(descriptor workspace.PluginDescriptor, e env.Env) (Provider, error)
	// LanguageRuntime fetches the language runtime plugin for a given language, lazily allocating if necessary.  If
	// an implementation of this language runtime wasn't found, on an error occurs, a non-nil error is returned.
	LanguageRuntime(runtime string) (LanguageRuntime, error)

	// ResolvePlugin resolves a pluginspec to a candidate plugin to load.
	ResolvePlugin(spec workspace.PluginDescriptor) (*workspace.PluginInfo, error)

	GetProjectPlugins() []workspace.ProjectPlugin

	// SignalCancellation asks all resource providers to gracefully shut down and abort any ongoing
	// operations. Operation aborted in this way will return an error (e.g., `Update` and `Create`
	// will either a creation error or an initialization error. SignalCancellation is advisory and
	// non-blocking; it is up to the host to decide how long to wait after SignalCancellation is
	// called before (e.g.) hard-closing any gRPC connection.
	SignalCancellation() error

	// StartDebugging asks the host to start a debugging session with the given configuration.
	StartDebugging(info DebuggingInfo) error

	// AttachDebugger returns true if debugging is enabled.
	AttachDebugger(spec DebugSpec) bool

	// Close reclaims any resources associated with the host.
	Close() error
}

A Host hosts provider plugins and makes them easily accessible by package name.

func NewDefaultHost

func NewDefaultHost(ctx *Context, runtimeOptions map[string]any,
	disableProviderPreview bool, plugins *workspace.Plugins, packages map[string]workspace.PackageSpec,
	config map[config.Key]string, debugging DebugContext, projectName tokens.PackageName,
	newLoader NewLoaderFunc, installLang LanguageInstaller,
) (Host, error)

NewDefaultHost implements the standard plugin logic, using the standard installation root to find them.

type InitError

type InitError struct {
	Reasons []string
}

InitError represents a failure to initialize a resource, i.e., the resource has been successfully created, but it has failed to initialize.

func (*InitError) Error

func (ie *InitError) Error() string

type InstallDependenciesRequest added in v3.130.0

type InstallDependenciesRequest struct {
	Info ProgramInfo
	// True if the host should use language-specific version managers, such as `pyenv` or `nvm`, to set up the version
	// of the language toolchain used.
	UseLanguageVersionTools bool
	// True if this install is for a plugin, as opposed to a top level Pulumi program.
	IsPlugin bool
}

func (InstallDependenciesRequest) String added in v3.130.0

func (options InstallDependenciesRequest) String() string

type InvokeRequest added in v3.120.0

type InvokeRequest struct {
	Tok     tokens.ModuleMember
	Args    resource.PropertyMap
	Preview bool
}

type InvokeResponse added in v3.120.0

type InvokeResponse struct {
	Properties resource.PropertyMap
	Failures   []CheckFailure
}

type JSONSchema

type JSONSchema map[string]any

JSONSchema represents a JSON schema.

type LanguageInstaller added in v3.245.0

type LanguageInstaller = func(ctx context.Context, runtime string, newLoader NewLoaderFunc) error

LanguageInstaller downloads and installs an unbundled language runtime on demand, so that loading it via Host.LanguageRuntime works even when the runtime is not bundled with the CLI or already cached. It is the language-runtime analogue of the engine's plugin install path.

The install machinery lives in the pkg module, which the SDK cannot import, so a host is given its installer at construction. newLoader is the same loader the host was built with; installing a plugin may need it to install the plugin's dependencies. A nil LanguageInstaller disables on-demand install (the host then relies on the runtime already being present).

type LanguageRuntime

type LanguageRuntime interface {
	// Closer closes any underlying OS resources associated with this plugin (like processes, RPC channels, etc).
	io.Closer
	// GetRequiredPackages computes the complete set of anticipated packages required by a program.
	GetRequiredPackages(
		ctx context.Context, info ProgramInfo,
	) ([]workspace.PackageDescriptor, []workspace.PackageSpec, error)
	// Run executes a program in the language runtime for planning or deployment purposes.  If
	// info.DryRun is true, the code must not assume that side-effects or final values resulting
	// from resource deployments are actually available.  If it is false, on the other hand, a real
	// deployment is occurring and it may safely depend on these.
	//
	// Returns a triple of "error message", "bail", or real "error".  If "bail", the caller should
	// return result.Bail immediately and not print any further messages to the user.
	Run(ctx context.Context, info RunInfo) (string, bool, error)
	// GetPluginInfo returns this plugin's information.
	GetPluginInfo(ctx context.Context) (PluginInfo, error)

	// InstallDependencies will install dependencies for the project, e.g. by running `npm install` for nodejs projects.
	// It returns io.Readers for stdout and stderr as well as a channel that will be closed when the operation is
	// complete, producing an error if one occurred. Callers *must* drain the stdout and stderr readers if they await the
	// done channel to avoid deadlocks.
	InstallDependencies(
		ctx context.Context, request InstallDependenciesRequest,
	) (io.Reader, io.Reader, <-chan error, error)

	// RuntimeOptionsPrompts returns additional options that can be set for the runtime.
	RuntimeOptionsPrompts(ctx context.Context, info ProgramInfo) ([]RuntimeOptionPrompt, error)

	// Template allows the language runtime to perform additional templating on a newly instantiated project template.
	Template(ctx context.Context, info ProgramInfo, projectName tokens.PackageName) error

	// About returns information about the language runtime.
	About(ctx context.Context, info ProgramInfo) (AboutInfo, error)

	// GetProgramDependencies returns information about the dependencies for the given program.
	GetProgramDependencies(ctx context.Context, info ProgramInfo, transitiveDependencies bool) ([]DependencyInfo, error)

	// RunPlugin executes a plugin program and returns its result asynchronously.
	RunPlugin(ctx context.Context, info RunPluginInfo) (io.Reader, io.Reader, *promise.Promise[int32], error)

	// GenerateProject generates a program project in the given directory. This will include metadata files such
	// as Pulumi.yaml and package.json.
	GenerateProject(ctx context.Context, sourceDirectory, targetDirectory, project string,
		strict bool, loaderTarget string, localDependencies map[string]string) (hcl.Diagnostics, error)

	// GeneratePackage generates an SDK package.
	GeneratePackage(
		ctx context.Context, directory string, schema string, extraFiles map[string][]byte,
		loaderTarget string, localDependencies map[string]string,
		local bool,
	) (hcl.Diagnostics, error)

	// GenerateProgram is similar to GenerateProject but doesn't include any metadata files, just the program
	// source code.
	GenerateProgram(ctx context.Context, program map[string]string, loaderTarget string,
		strict bool) (map[string][]byte, hcl.Diagnostics, error)

	// Pack packs a library package into a language specific artifact in the given destination directory.
	Pack(ctx context.Context, packageDirectory string, destinationDirectory string) (string, error)

	// Link links a set of local dependencies into the given program directory.
	Link(
		ctx context.Context, info ProgramInfo, localDependencies []workspace.LinkablePackageDescriptor,
		loaderTarget string,
	) (string, error)

	// Cancel signals the language runtime to gracefully shut down and abort any ongoing operations.
	// Operations aborted in this way will return an error.
	Cancel(ctx context.Context) error
}

LanguageRuntime is a convenient interface for interacting with language runtime plugins. These tend to be dynamically loaded as plugins, although this interface hides this fact from the calling code.

func NewLanguageRuntime

func NewLanguageRuntime(host Host, ctx *Context, runtime, workingDirectory string,
) (LanguageRuntime, error)

NewLanguageRuntime binds to a language's runtime plugin and then creates a gRPC connection to it. If the plugin could not be found, or an error occurs while creating the child process, an error is returned.

func NewLanguageRuntimeClient

func NewLanguageRuntimeClient(runtime string, client pulumirpc.LanguageRuntimeClient) LanguageRuntime

type ListRequest added in v3.243.0

type ListRequest struct {
	// Token is the resource type to enumerate.
	Token tokens.Type
	// Query is an optional provider-defined filter over resource state. It may contain unknown values, in which case
	// the provider should respond with a [ListResponse] whose Computed flag is set.
	Query resource.PropertyMap
	// Limit caps the total number of results across the entire enumeration. A value of zero means "no limit". The
	// provider may return fewer results than Limit even when more match.
	Limit int64
	// PageSize is the maximum number of results the caller wants in a single page. The provider is free to return
	// fewer than PageSize, but should not exceed it. A value of zero lets the provider choose.
	PageSize int64
	// ContinuationToken is the opaque token returned by a previous List call. Empty for the first page; non-empty to
	// fetch the next page using the same Token/Query/Limit as the original call.
	ContinuationToken string
}

ListRequest is the type of requests sent as part of a [Provider.List] call.

type ListResult added in v3.243.0

type ListResult struct {
	// ID is an importable identifier for the resource. It can be passed to [Provider.Read] to fetch full state.
	ID resource.ID
	// Name is the provider-supplied name for the resource, or empty if the provider does not supply one.
	Name string
}

ListResult is a single resource returned by a [Provider.List] call.

type ListStream added in v3.243.0

type ListStream struct {
	// Items yields each list result. See the [ListStream] doc comment for the iteration contract.
	Items iter.Seq2[ListResult, error]
	// Computed is set after Items completes if the provider could not compute the list, typically because the query
	// contained unknown values. When true, no items will have been yielded.
	Computed bool
	// ContinuationToken is set after Items completes to the cursor for the next page. Empty when there are no more
	// pages.
	ContinuationToken string
}

ListStream is the streamed response of a [Provider.List] call. The caller iterates Items to receive each resource one at a time; after iteration completes, Computed and ContinuationToken hold any trailing metadata the provider returned.

The contract for Items is:

  • Each yield delivers either (item, nil) for a successful result, or (zero, err) for an error. An error pair is always the final yield — the iterator returns immediately afterwards.
  • Items must be drained to completion to ensure the underlying transport is closed and Computed / ContinuationToken are populated. Stopping early (e.g. break out of the range loop) is allowed but those metadata fields may not reflect the full stream.
  • Items may only be iterated once.

A typical caller looks like:

stream, err := p.List(req)
if err != nil { return err }
for item, err := range stream.Items {
    if err != nil { return err }
    // process item
}
if stream.Computed { /* query had unknowns */ }
next := stream.ContinuationToken

func NewComputedListStream added in v3.243.0

func NewComputedListStream() *ListStream

NewComputedListStream builds a ListStream that yields no items and reports Computed=true. It is intended for providers that detect unknown values in the query at construction time.

func NewListStream added in v3.243.0

func NewListStream(results []ListResult, continuationToken string) *ListStream

NewListStream builds a ListStream that yields each entry in results, then exposes the supplied continuationToken. It is intended for synthetic implementations such as test doubles. The returned stream's Items can be iterated exactly once.

type MarshalOptions

type MarshalOptions struct {
	Label                 string // an optional label for debugging.
	SkipNulls             bool   // true to skip nulls altogether in the resulting map.
	KeepUnknowns          bool   // true if we are keeping unknown values (otherwise we skip them).
	RejectUnknowns        bool   // true if we should return errors on unknown values. Takes precedence over KeepUnknowns.
	ElideAssetContents    bool   // true if we are eliding the contents of assets.
	ComputeAssetHashes    bool   // true if we are computing missing asset hashes on the fly.
	KeepSecrets           bool   // true if we are keeping secrets (otherwise we replace them with their underlying value).
	RejectAssets          bool   // true if we should return errors on Asset and Archive values.
	KeepResources         bool   // true if we are keeping resoures (otherwise we return raw urn).
	SkipInternalKeys      bool   // true to skip internal property keys (keys that start with "__") in the resulting map.
	KeepOutputValues      bool   // true if we are keeping output values.
	UpgradeToOutputValues bool   // true if secrets and unknowns should be upgraded to output values.
	WorkingDirectory      string // the optional working directory to use when serializing assets & archives.

	// true if a nil input should result in a nil output, false if it should result in an empty struct/map.
	PropagateNil bool
}

MarshalOptions controls the marshaling of RPC structures.

type MockConverter added in v3.243.0

type MockConverter struct {
	CloseF          func() error
	ConvertStateF   func(context.Context, *ConvertStateRequest) (*ConvertStateResponse, error)
	ConvertProgramF func(context.Context, *ConvertProgramRequest) (*ConvertProgramResponse, error)
	ConvertSnippetF func(context.Context, *ConvertSnippetRequest) (*ConvertSnippetResponse, error)
}

func (*MockConverter) Close added in v3.243.0

func (m *MockConverter) Close() error

func (*MockConverter) ConvertProgram added in v3.243.0

func (m *MockConverter) ConvertProgram(
	ctx context.Context, req *ConvertProgramRequest,
) (*ConvertProgramResponse, error)

func (*MockConverter) ConvertSnippet added in v3.243.0

func (m *MockConverter) ConvertSnippet(
	ctx context.Context, req *ConvertSnippetRequest,
) (*ConvertSnippetResponse, error)

func (*MockConverter) ConvertState added in v3.243.0

type MockHost added in v3.131.0

type MockHost struct {
	ServerAddrF         func() string
	LoaderAddrF         func() string
	LogF                func(sev diag.Severity, urn resource.URN, msg string, streamID int32)
	LogStatusF          func(sev diag.Severity, urn resource.URN, msg string, streamID int32)
	AnalyzerF           func(nm tokens.QName) (Analyzer, error)
	PolicyAnalyzerF     func(name tokens.QName, path string, opts *PolicyAnalyzerOptions) (Analyzer, error)
	ProviderF           func(descriptor workspace.PluginDescriptor, e env.Env) (Provider, error)
	LanguageRuntimeF    func(runtime string) (LanguageRuntime, error)
	ResolvePluginF      func(spec workspace.PluginDescriptor) (*workspace.PluginInfo, error)
	GetProjectPluginsF  func() []workspace.ProjectPlugin
	SignalCancellationF func() error
	CloseF              func() error
	StartDebuggingF     func(info DebuggingInfo) error
	AttachDebuggerF     func(spec DebugSpec) bool
}

func (*MockHost) Analyzer added in v3.131.0

func (m *MockHost) Analyzer(nm tokens.QName) (Analyzer, error)

func (*MockHost) AttachDebugger added in v3.170.0

func (m *MockHost) AttachDebugger(spec DebugSpec) bool

func (*MockHost) Close added in v3.131.0

func (m *MockHost) Close() error

func (*MockHost) GetProjectPlugins added in v3.131.0

func (m *MockHost) GetProjectPlugins() []workspace.ProjectPlugin

func (*MockHost) LanguageRuntime added in v3.131.0

func (m *MockHost) LanguageRuntime(runtime string) (LanguageRuntime, error)

func (*MockHost) LoaderAddr added in v3.221.0

func (m *MockHost) LoaderAddr() string

func (*MockHost) Log added in v3.131.0

func (m *MockHost) Log(sev diag.Severity, urn resource.URN, msg string, streamID int32)

func (*MockHost) LogStatus added in v3.131.0

func (m *MockHost) LogStatus(sev diag.Severity, urn resource.URN, msg string, streamID int32)

func (*MockHost) PolicyAnalyzer added in v3.131.0

func (m *MockHost) PolicyAnalyzer(name tokens.QName, path string, opts *PolicyAnalyzerOptions) (Analyzer, error)

func (*MockHost) Provider added in v3.131.0

func (m *MockHost) Provider(descriptor workspace.PluginDescriptor, e env.Env) (Provider, error)

func (*MockHost) ResolvePlugin added in v3.131.0

func (m *MockHost) ResolvePlugin(
	spec workspace.PluginDescriptor,
) (*workspace.PluginInfo, error)

func (*MockHost) ServerAddr added in v3.131.0

func (m *MockHost) ServerAddr() string

func (*MockHost) SignalCancellation added in v3.131.0

func (m *MockHost) SignalCancellation() error

func (*MockHost) StartDebugging added in v3.131.0

func (m *MockHost) StartDebugging(info DebuggingInfo) error

type MockProvider added in v3.131.0

type MockProvider struct {
	NotForwardCompatibleProvider

	CloseF              func() error
	HandshakeF          func(context.Context, ProviderHandshakeRequest) (*ProviderHandshakeResponse, error)
	ParameterizeF       func(context.Context, ParameterizeRequest) (ParameterizeResponse, error)
	GetSchemaF          func(context.Context, GetSchemaRequest) (GetSchemaResponse, error)
	CheckConfigF        func(context.Context, CheckConfigRequest) (CheckConfigResponse, error)
	DiffConfigF         func(context.Context, DiffConfigRequest) (DiffConfigResponse, error)
	ConfigureF          func(context.Context, ConfigureRequest) (ConfigureResponse, error)
	CheckF              func(context.Context, CheckRequest) (CheckResponse, error)
	DiffF               func(context.Context, DiffRequest) (DiffResponse, error)
	CreateF             func(context.Context, CreateRequest) (CreateResponse, error)
	ReadF               func(context.Context, ReadRequest) (ReadResponse, error)
	UpdateF             func(context.Context, UpdateRequest) (UpdateResponse, error)
	DeleteF             func(context.Context, DeleteRequest) (DeleteResponse, error)
	ListF               func(context.Context, ListRequest) (*ListStream, error)
	ConstructF          func(context.Context, ConstructRequest) (ConstructResponse, error)
	InvokeF             func(context.Context, InvokeRequest) (InvokeResponse, error)
	CallF               func(context.Context, CallRequest) (CallResponse, error)
	GetPluginInfoF      func(context.Context) (PluginInfo, error)
	SignalCancellationF func(context.Context) error
	GetMappingF         func(context.Context, GetMappingRequest) (GetMappingResponse, error)
	GetMappingsF        func(context.Context, GetMappingsRequest) (GetMappingsResponse, error)
}

func (*MockProvider) Call added in v3.131.0

func (*MockProvider) Check added in v3.131.0

func (*MockProvider) CheckConfig added in v3.131.0

func (*MockProvider) Close added in v3.131.0

func (m *MockProvider) Close() error

func (*MockProvider) Configure added in v3.131.0

func (*MockProvider) Construct added in v3.131.0

func (*MockProvider) Create added in v3.131.0

func (*MockProvider) Delete added in v3.131.0

func (*MockProvider) Diff added in v3.131.0

func (*MockProvider) DiffConfig added in v3.131.0

func (*MockProvider) GetMapping added in v3.131.0

func (*MockProvider) GetMappings added in v3.131.0

func (*MockProvider) GetPluginInfo added in v3.131.0

func (m *MockProvider) GetPluginInfo(ctx context.Context) (PluginInfo, error)

func (*MockProvider) GetSchema added in v3.131.0

func (*MockProvider) Handshake added in v3.143.0

func (*MockProvider) Invoke added in v3.131.0

func (*MockProvider) List added in v3.243.0

func (m *MockProvider) List(ctx context.Context, req ListRequest) (*ListStream, error)

func (*MockProvider) Parameterize added in v3.131.0

func (*MockProvider) Read added in v3.131.0

func (*MockProvider) SignalCancellation added in v3.131.0

func (m *MockProvider) SignalCancellation(ctx context.Context) error

func (*MockProvider) Update added in v3.131.0

type NewLoaderFunc added in v3.221.0

type NewLoaderFunc = func(h Host) codegenrpc.LoaderServer

type NotForwardCompatibleProvider added in v3.118.0

type NotForwardCompatibleProvider struct{}

NotForwardCompatible can be embedded to explicitly opt out of forward compatibility.

Either NotForwardCompatibleProvider or UnimplementedProvider must be embedded to implement Provider.

type ParameterizeArgs added in v3.118.0

type ParameterizeArgs struct {
	// The arguments passed on the command line following the provider name.
	Args []string
}

ParameterizeArgs is used when parameterizing a provider from command line arguments.

func (*ParameterizeArgs) Empty added in v3.191.0

func (p *ParameterizeArgs) Empty() bool

Empty returns true if the parameterization is empty or nil.

type ParameterizeParameters added in v3.118.0

type ParameterizeParameters interface {

	// Empty returns true if the parameterization is empty or nil.
	Empty() bool
	// contains filtered or unexported methods
}

ParameterizeParameters can either be of concrete type ParameterizeArgs or ParameterizeValue, for when parameterizing a provider from either the command line or from within a Pulumi program, respectively.

type ParameterizeRequest added in v3.118.0

type ParameterizeRequest struct {
	// The parameters to use when parameterizing the provider instance.
	Parameters ParameterizeParameters
}

The type of requests sent as part of a Parameterize call.

type ParameterizeResponse added in v3.118.0

type ParameterizeResponse struct {
	// The name of the parameterization. This must be unique in the context of a program.
	// If the request parameter was a ParameterizeValue, then this field must match the input name.
	Name string
	// The version of the parameterization. This is required to be set by the provider. It does not have to match the
	// version of the provider itself, but can be used however the provider sees fit. If the request parameter was a
	// ParameterizeValue, then this field must match the input version.
	Version semver.Version
}

The type of responses sent as part of a Parameterize call.

type ParameterizeValue added in v3.118.0

type ParameterizeValue struct {
	// The name of the parameterization.
	Name string
	// The version of the parameterization.
	Version semver.Version
	// The binary parameterization value as returned from a previous parameterization call.
	// This can be any data the provider needs to parameterize itself - such as the data needed to turn resource
	// requests into API calls.
	Value []byte
}

ParameterizeValue is used when parameterizing a provider from within a Pulumi program.

func (*ParameterizeValue) Empty added in v3.191.0

func (p *ParameterizeValue) Empty() bool

Empty returns true if the parameterization is empty or nil.

type Plugin added in v3.174.0

type Plugin struct {
	Bin  string
	Args []string
	// Env specifies the environment of the plugin in the same format as go's os/exec.Cmd.Env
	// https://golang.org/pkg/os/exec/#Cmd (each entry is of the form "key=value").
	Env  []string
	Conn *grpc.ClientConn
	// Function to trigger the plugin to be killed. If the plugin is a process this will just SIGKILL it.
	Kill   func() error
	Stdin  io.WriteCloser
	Stdout io.ReadCloser
	Stderr io.ReadCloser
	// Function to wait for the plugin to exit, this will either return the exitcode from the process or an
	// error if we didn't get a normal process exit.
	Wait func(context.Context) (int, error)
	// contains filtered or unexported fields
}

func ExecPlugin added in v3.174.0

func ExecPlugin(ctx *Context, bin, prefix string, kind apitype.PluginKind,
	pluginArgs []string, pwd string, e env.Env, attachDebugger bool,
) (*Plugin, error)

ExecPlugin starts a plugin executable either via a direct exec or via a language runtime.

func (*Plugin) Close added in v3.174.0

func (p *Plugin) Close() error

type PluginInfo added in v3.214.0

type PluginInfo struct {
	// The semver for this plugin.
	Version *semver.Version
}

PluginInfo is meta-information about a plugin that is used by the system.

type PolicyAnalyzerOptions

type PolicyAnalyzerOptions struct {
	Organization     string
	Project          string
	Stack            string
	Config           map[config.Key]string
	ConfigSecretKeys []config.Key
	DryRun           bool
	Tags             map[string]string // Tags for the current stack.
	AdditionalEnv    map[string]string // Per-pack environment variables (e.g., from ESC).
}

PolicyAnalyzerOptions includes a bag of options to pass along to a policy analyzer.

type PolicyNotApplicable added in v3.196.0

type PolicyNotApplicable struct {
	// The name of the policy that was not applicable.
	PolicyName string
	// An optional reason why the policy was not applicable.
	Reason string
}

PolicyNotApplicable describes a policy that was not applicable, including an optional reason why.

type PolicySummary added in v3.196.0

type PolicySummary struct {
	// The URN of the resource. This will be empty for AnalyzeStack.
	URN resource.URN
	// The name of the policy pack.
	PolicyPackName string
	// The version of the policy pack.
	PolicyPackVersion string
	// The names of policies that passed (i.e. did not produce any violations).
	Passed []string
	// The names of policies that failed (i.e. produced violations).
	Failed []string
}

type ProgramInfo added in v3.104.0

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

ProgramInfo contains minimal information about the program to be run.

func NewProgramInfo added in v3.104.0

func NewProgramInfo(rootDirectory, programDirectory, entryPoint string, options map[string]any) ProgramInfo

func (ProgramInfo) EntryPoint added in v3.104.0

func (info ProgramInfo) EntryPoint() string

The programs main entrypoint, either a file path relative to the program directory or "." for the program directory.

func (ProgramInfo) Marshal added in v3.104.0

func (info ProgramInfo) Marshal() (*pulumirpc.ProgramInfo, error)

func (ProgramInfo) Options added in v3.104.0

func (info ProgramInfo) Options() map[string]any

Runtime plugin options for the program

func (ProgramInfo) ProgramDirectory added in v3.104.0

func (info ProgramInfo) ProgramDirectory() string

The programs directory, generally the same as or a subdirectory of the root directory.

func (ProgramInfo) RootDirectory added in v3.104.0

func (info ProgramInfo) RootDirectory() string

The programs root directory, i.e. where the Pulumi.yaml file is.

func (ProgramInfo) String added in v3.104.0

func (info ProgramInfo) String() string

type PropertyDiff

type PropertyDiff struct {
	Kind      DiffKind // The kind of diff.
	InputDiff bool     // True if this is a diff between old and new inputs rather than old state and new inputs.
}

PropertyDiff records the difference between a single property's old and new values.

func (PropertyDiff) ToReplace added in v3.6.1

func (p PropertyDiff) ToReplace() PropertyDiff

ToReplace converts the kind of a PropertyDiff into the equivalent replacement if it not already a replacement.

type Provider

type Provider interface {

	// Closer closes any underlying OS resources associated with this provider (like processes, RPC channels, etc).
	io.Closer

	// Handshake is the first call made by the engine to a provider. It is used to pass the engine's address to the
	// provider so that it may establish its own connections back, and to establish protocol configuration that will be
	// used to communicate between the two parties. Providers that support Handshake should return a response consistent
	// with those returned in response to Configure calls where there is overlap due to the use of Configure prior to
	// Handshake's introduction.
	Handshake(context.Context, ProviderHandshakeRequest) (*ProviderHandshakeResponse, error)

	// Parameterize adds a sub-package to this provider instance.
	Parameterize(context.Context, ParameterizeRequest) (ParameterizeResponse, error)

	// GetSchema returns the schema for the provider.
	GetSchema(context.Context, GetSchemaRequest) (GetSchemaResponse, error)

	// CheckConfig validates the configuration for this resource provider.
	CheckConfig(context.Context, CheckConfigRequest) (CheckConfigResponse, error)
	// DiffConfig checks what impacts a hypothetical change to this provider's configuration will have on the provider.
	DiffConfig(context.Context, DiffConfigRequest) (DiffConfigResponse, error)
	// Configure configures the resource provider with "globals" that control its behavior.
	Configure(context.Context, ConfigureRequest) (ConfigureResponse, error)

	// Check validates that the given property bag is valid for a resource of the given type and returns the inputs
	// that should be passed to successive calls to Diff, Create, or Update for this resource.
	Check(context.Context, CheckRequest) (CheckResponse, error)
	// Diff checks what impacts a hypothetical update will have on the resource's properties.
	Diff(context.Context, DiffRequest) (DiffResponse, error)
	// Create allocates a new instance of the provided resource and returns its unique resource.ID.
	Create(context.Context, CreateRequest) (CreateResponse, error)
	// Read the current live state associated with a resource.  Enough state must be include in the inputs to uniquely
	// identify the resource; this is typically just the resource ID, but may also include some properties.  If the
	// resource is missing (for instance, because it has been deleted), the resulting property map will be nil.
	Read(context.Context, ReadRequest) (ReadResponse, error)
	// Update updates an existing resource with new values.
	Update(context.Context, UpdateRequest) (UpdateResponse, error)
	// Delete tears down an existing resource. The inputs and outputs are the last recorded ones from state.
	Delete(context.Context, DeleteRequest) (DeleteResponse, error)
	// List enumerates resources of the given type managed by this provider. The returned ListStream yields each
	// resource one at a time; after Items has finished iterating, ContinuationToken (if non-empty) can be passed
	// back in a follow-up ListRequest to fetch the next page, and Computed reports whether the provider could not
	// compute the list (typically because the query contained unknown values).
	List(context.Context, ListRequest) (*ListStream, error)

	// Construct creates a new component resource.
	Construct(context.Context, ConstructRequest) (ConstructResponse, error)

	// Invoke dynamically executes a built-in function in the provider.
	Invoke(context.Context, InvokeRequest) (InvokeResponse, error)
	// Call dynamically executes a method in the provider associated with a component resource.
	Call(context.Context, CallRequest) (CallResponse, error)

	// GetPluginInfo returns this plugin's information.
	GetPluginInfo(context.Context) (PluginInfo, error)

	// SignalCancellation asks all resource providers to gracefully shut down and abort any ongoing
	// operations. Operation aborted in this way will return an error (e.g., `Update` and `Create`
	// will either a creation error or an initialization error. SignalCancellation is advisory and
	// non-blocking; it is up to the host to decide how long to wait after SignalCancellation is
	// called before (e.g.) hard-closing any gRPC connection.
	SignalCancellation(context.Context) error

	// GetMapping returns the mapping (if any) for the provider. A provider should return an empty response
	// (not an error) if it doesn't have a mapping for the given key.
	GetMapping(context.Context, GetMappingRequest) (GetMappingResponse, error)

	// GetMappings returns the mappings (if any) for the providers. A provider should return an empty list (not an
	// error) if it doesn't have any mappings for the given key.
	// If a provider implements this method GetMapping will be called using the results from this method.
	GetMappings(context.Context, GetMappingsRequest) (GetMappingsResponse, error)
	// contains filtered or unexported methods
}

Provider presents a simple interface for orchestrating resource create, read, update, and delete operations. Each provider understands how to handle all of the resource types within a single package.

This interface hides some of the messiness of the underlying machinery, since providers are behind an RPC boundary.

It is important to note that provider operations are not transactional. (Some providers might decide to offer transactional semantics, but such a provider is a rare treat.) As a result, failures in the operations below can range from benign to catastrophic (possibly leaving behind a corrupt resource). It is up to the provider to make a best effort to ensure catastrophes do not occur. The errors returned from mutating operations indicate both the underlying error condition in addition to a bit indicating whether the operation was successfully rolled back.

func NewProvider

func NewProvider(host Host, ctx *Context, spec workspace.PluginDescriptor,
	options map[string]any, disableProviderPreview bool, jsonConfig string,
	projectName tokens.PackageName, e env.Env,
) (Provider, error)

NewProvider attempts to bind to a given package's resource plugin and then creates a gRPC connection to it. If the plugin could not be found, or an error occurs while creating the child process, an error is returned.

func NewProviderFromPath added in v3.40.1

func NewProviderFromPath(host Host, ctx *Context, path string) (Provider, error)

NewProviderFromPath creates a new provider by loading the plugin binary located at `path`.

func NewProviderWithClient

func NewProviderWithClient(ctx *Context, client pulumirpc.ResourceProviderClient,
	disableProviderPreview bool,
) Provider

func NewProviderWithVersionOverride added in v3.159.0

func NewProviderWithVersionOverride(ctx *Context, client pulumirpc.ResourceProviderClient,
	disableProviderPreview bool, version *semver.Version,
) Provider

type ProviderHandshakeRequest added in v3.143.0

type ProviderHandshakeRequest struct {
	// The gRPC address of the engine handshaking with the provider. At a minimum, this address will expose an instance of
	// the Engine service.
	EngineAddress string

	// A *root directory* where the provider's binary, `PulumiPlugin.yaml`, or other identifying source code is located.
	// In the event that the provider is *not* being booted by the engine (e.g. in the case that the engine has been asked
	// to attach to an existing running provider instance via a host/port number), this field will be empty.
	RootDirectory *string

	// A *program directory* in which the provider should execute. This is generally a subdirectory of the root directory,
	// though this is not required. In the event that the provider is *not* being booted by the engine (e.g. in the case
	// that the engine has been asked to attach to an existing running provider instance via a host/port number), this
	// field will be empty.
	ProgramDirectory *string

	// If true the engine will send URN, Name, Type and ID to the provider as part of the configuration.
	ConfigureWithUrn bool

	// If true the engine supports views and can send an address of the resource status service that
	// can be used to create or update view resources.
	SupportsViews bool

	// If true the engine supports letting the provider mark resource states as requiring refresh before update.
	SupportsRefreshBeforeUpdate bool

	// If true the engine will send `Preview` to `Invoke` methods to let them know if the current operation is a preview
	// or up.
	InvokeWithPreview bool
}

The type of requests sent as part of a Handshake call.

type ProviderHandshakeResponse added in v3.143.0

type ProviderHandshakeResponse struct {
	// True if and only if the provider supports secrets. If true, the caller should pass secrets as strongly typed
	// values to the provider.
	AcceptSecrets bool

	// True if and only if the provider supports strongly typed resources. If true, the caller should pass resources as
	// strongly typed values to the provider.
	AcceptResources bool

	// True if and only if the provider supports output values as inputs. If true, the engine should pass output values
	// to the provider where possible.
	AcceptOutputs bool

	// True if the provider accepts and respects autonaming configuration that the engine provides on behalf of the
	// user.
	SupportsAutonamingConfiguration bool
}

The type of responses sent as part of a Handshake call.

type PulumiParameterizationJSON added in v3.143.0

type PulumiParameterizationJSON struct {
	// The name of the parameterized package.
	Name string `json:"name"`
	// The version of the parameterized package.
	Version string `json:"version"`
	// The parameter value of the parameterized package.
	Value []byte `json:"value"`
}

type PulumiPluginJSON

type PulumiPluginJSON struct {
	// Indicates whether the package has an associated resource plugin. Set to false to indicate no plugin.
	Resource bool `json:"resource"`
	// Optional plugin name. If not set, the plugin name is derived from the package name.
	Name string `json:"name,omitempty"`
	// Optional plugin version. If not set, the version is derived from the package version (if possible).
	Version string `json:"version,omitempty"`
	// Optional plugin server. If not set, the default server is used when installing the plugin.
	Server string `json:"server,omitempty"`
	// Parameterization information for the package.
	Parameterization *PulumiParameterizationJSON `json:"parameterization,omitempty"`
}

PulumiPluginJSON represents additional information about a package's associated Pulumi plugin. For Python, the content is inside a pulumi-plugin.json file inside the package. For Node.js, the content is within the package.json file, under the "pulumi" node. For .NET, the content is inside a pulumi-plugin.json file inside the NuGet package. For Go, the content is inside a pulumi-plugin.json file inside the module.

func LoadPulumiPluginJSON

func LoadPulumiPluginJSON(path string) (*PulumiPluginJSON, error)

func (*PulumiPluginJSON) JSON

func (plugin *PulumiPluginJSON) JSON() ([]byte, error)

type ReadRequest added in v3.120.0

type ReadRequest struct {
	URN           resource.URN
	Name          string
	Type          tokens.Type
	ID            resource.ID
	Inputs, State resource.PropertyMap
	// The gRPC address of the ResourceStatus service which can be used to read view resources.
	ResourceStatusAddress string
	// The ResourceStatus service token to pass when calling methods on the service.
	ResourceStatusToken string
	// The old views for the resource being read. These will only be populated when the Read call is being made as part
	// of a refresh operation.
	OldViews []View
}

type ReadResponse added in v3.120.0

type ReadResponse struct {
	ReadResult
	Status resource.Status
}

type ReadResult

type ReadResult struct {
	// This is the ID for the resource. This ID will always be populated and will ensure we get the most up-to-date
	// resource ID.
	ID resource.ID
	// Inputs contains the new inputs for the resource, if any. If this field is nil, the provider does not support
	// returning inputs from a call to Read and the old inputs (if any) should be preserved.
	Inputs resource.PropertyMap
	// Outputs contains the new outputs/state for the resource, if any. If this field is nil, the resource does not
	// exist.
	Outputs resource.PropertyMap
	// Indicates that this resource should always be refreshed prior to updates.
	RefreshBeforeUpdate bool
}

ReadResult is the result of a call to Read.

type RemediateResponse added in v3.197.0

type RemediateResponse struct {
	// The remediations that were applied.
	Remediations []Remediation
	// Information about policies that were not applicable.
	NotApplicable []PolicyNotApplicable
}

RemediateResponse is the response from the Remediate method, containing a sequence of remediations applied, in order.

type Remediation added in v3.88.0

type Remediation struct {
	PolicyName        string
	Description       string
	PolicyPackName    string
	PolicyPackVersion string
	URN               resource.URN
	Properties        resource.PropertyMap
	Diagnostic        string
}

Remediation indicates that a resource remediation took place, and contains the resulting transformed properties and associated metadata.

type ResourceImport added in v3.58.0

type ResourceImport struct {
	Type        string
	Name        string
	ID          string
	LogicalName string
	IsComponent bool
	IsRemote    bool

	Version           string
	PluginDownloadURL string
}

type RunInfo

type RunInfo struct {
	Info             ProgramInfo           // the information about the program to run.
	MonitorAddress   string                // the RPC address to the host resource monitor.
	Project          string                // the project name housing the program being run.
	Stack            string                // the stack name being evaluated.
	Pwd              string                // the program's working directory.
	Args             []string              // any arguments to pass to the program.
	Config           map[config.Key]string // the configuration variables to apply before running.
	ConfigSecretKeys []config.Key          // the configuration keys that have secret values.
	DryRun           bool                  // true if we are performing a dry-run (preview).
	QueryMode        bool                  // true if we're only doing a query.
	Parallel         int32                 // the degree of parallelism for resource operations (<=1 for serial).
	Organization     string                // the organization name housing the program being run (might be empty).
	LoaderAddress    string                // the RPC address of the host's schema loader.
	MapperAddress    string                // the RPC address of the host's mapping service.
	AttachDebugger   bool                  // true if we are starting the program under a debugger.
}

RunInfo contains all of the information required to perform a plan or deployment operation.

type RunPluginInfo added in v3.47.0

type RunPluginInfo struct {
	Info             ProgramInfo
	WorkingDirectory string
	Args             []string
	Env              []string
	Kind             string
	AttachDebugger   bool
	LoaderAddress    string
}

type RuntimeOptionPrompt added in v3.121.0

type RuntimeOptionPrompt struct {
	Key         string
	Description string
	Choices     []RuntimeOptionValue
	Default     *RuntimeOptionValue
	PromptType  RuntimeOptionType
}

RuntimeOptionPrompt is a prompt for a runtime option. The prompt can have multiple choices or be free-form if Choices is empty. Key is the key as used in runtime.options.<Key> in the Pulumi.yaml file.

func UnmarshallRuntimeOptionPrompt added in v3.121.0

func UnmarshallRuntimeOptionPrompt(p *pulumirpc.RuntimeOptionPrompt) (RuntimeOptionPrompt, error)

type RuntimeOptionType added in v3.121.0

type RuntimeOptionType int
const (
	PromptTypeString RuntimeOptionType = iota
	PromptTypeInt32
)

type RuntimeOptionValue added in v3.121.0

type RuntimeOptionValue struct {
	PromptType  RuntimeOptionType
	StringValue string
	Int32Value  int32
	DisplayName string
}

RuntimeOptionValue represents a single value that can be selected for a runtime option. The value can be either a string or an int32.

func RuntimeOptionValueFromString added in v3.121.0

func RuntimeOptionValueFromString(promptType RuntimeOptionType, value string) (RuntimeOptionValue, error)

func (RuntimeOptionValue) String added in v3.121.0

func (v RuntimeOptionValue) String() string

func (RuntimeOptionValue) Value added in v3.121.0

func (v RuntimeOptionValue) Value() any

type UnimplementedProvider added in v3.50.0

type UnimplementedProvider struct{ NotForwardCompatibleProvider }

UnimplementedProvider can be embedded to have a forward compatible implementation of Provider.

Either NotForwardCompatibleProvider or UnimplementedProvider must be embedded to implement Provider.

func (*UnimplementedProvider) Call added in v3.50.0

func (*UnimplementedProvider) Check added in v3.50.0

func (*UnimplementedProvider) CheckConfig added in v3.50.0

func (*UnimplementedProvider) Close added in v3.50.0

func (p *UnimplementedProvider) Close() error

func (*UnimplementedProvider) Configure added in v3.50.0

func (*UnimplementedProvider) Construct added in v3.50.0

func (*UnimplementedProvider) Create added in v3.50.0

func (*UnimplementedProvider) Delete added in v3.50.0

func (*UnimplementedProvider) Diff added in v3.50.0

func (*UnimplementedProvider) DiffConfig added in v3.50.0

func (*UnimplementedProvider) GetMapping added in v3.50.0

func (*UnimplementedProvider) GetMappings added in v3.85.0

func (*UnimplementedProvider) GetPluginInfo added in v3.50.0

func (p *UnimplementedProvider) GetPluginInfo(context.Context) (PluginInfo, error)

func (*UnimplementedProvider) GetSchema added in v3.50.0

func (*UnimplementedProvider) Handshake added in v3.143.0

func (*UnimplementedProvider) Invoke added in v3.50.0

func (*UnimplementedProvider) List added in v3.243.0

func (*UnimplementedProvider) Parameterize added in v3.117.0

func (*UnimplementedProvider) Read added in v3.50.0

func (*UnimplementedProvider) SignalCancellation added in v3.50.0

func (p *UnimplementedProvider) SignalCancellation(context.Context) error

func (*UnimplementedProvider) Update added in v3.50.0

type UpdateRequest added in v3.120.0

type UpdateRequest struct {
	URN                              resource.URN
	Name                             string
	Type                             tokens.Type
	ID                               resource.ID
	OldInputs, OldOutputs, NewInputs resource.PropertyMap
	Timeout                          float64
	IgnoreChanges                    []string
	Preview                          bool
	// The gRPC address of the ResourceStatus service which can be used to update view resources.
	ResourceStatusAddress string
	// The ResourceStatus service token to pass when calling methods on the service.
	ResourceStatusToken string
	// The old views for the resource being updated.
	OldViews []View
}

type UpdateResponse added in v3.120.0

type UpdateResponse struct {
	Properties resource.PropertyMap
	Status     resource.Status
	// Indicates that this resource should always be refreshed prior to updates.
	RefreshBeforeUpdate bool
}

type View added in v3.169.0

type View struct {
	// The type of the view resource.
	Type tokens.Type

	// The name of the view resource.
	Name string

	// An optional type of the parent view resource.
	ParentType tokens.Type

	// An optional name of the parent view resource.
	ParentName string

	// The view resource's inputs.
	Inputs resource.PropertyMap

	// The view resource's outputs.
	Outputs resource.PropertyMap
}

View represents the state of a view resource.

Jump to

Keyboard shortcuts

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