2022-09-21 19:42:24 +00:00
// Copyright 2016-2022, Pulumi Corporation.
2022-06-11 07:52:24 +00:00
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
2018-06-26 18:14:03 +00:00
// Code generated by protoc-gen-go. DO NOT EDIT.
2022-06-11 07:52:24 +00:00
// versions:
2022-12-14 19:17:27 +00:00
// protoc-gen-go v1.28.1
2022-06-11 07:52:24 +00:00
// protoc v3.20.1
2022-07-12 13:45:03 +00:00
// source: pulumi/resource.proto
2017-11-17 02:21:41 +00:00
2018-07-12 01:07:50 +00:00
package pulumirpc
2017-11-17 02:21:41 +00:00
import (
2022-06-11 07:52:24 +00:00
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
2024-01-24 17:15:30 +00:00
emptypb "google.golang.org/protobuf/types/known/emptypb"
structpb "google.golang.org/protobuf/types/known/structpb"
2023-03-04 22:11:52 +00:00
reflect "reflect"
sync "sync"
2017-11-17 02:21:41 +00:00
)
2022-06-11 07:52:24 +00:00
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl . EnforceVersion ( 20 - protoimpl . MinVersion )
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl . EnforceVersion ( protoimpl . MaxVersion - 20 )
)
2018-07-12 01:07:50 +00:00
2019-04-12 18:27:18 +00:00
// SupportsFeatureRequest allows a client to test if the resource monitor supports a certain feature, which it may use
// to control the format or types of messages it sends.
type SupportsFeatureRequest struct {
2022-06-11 07:52:24 +00:00
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
2019-04-12 18:27:18 +00:00
2022-06-11 07:52:24 +00:00
Id string ` protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" ` // the ID of the feature to test support for.
2019-04-12 18:27:18 +00:00
}
2020-02-28 11:53:47 +00:00
2022-06-11 07:52:24 +00:00
func ( x * SupportsFeatureRequest ) Reset ( ) {
* x = SupportsFeatureRequest { }
if protoimpl . UnsafeEnabled {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 0 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
2019-04-12 18:27:18 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * SupportsFeatureRequest ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
2019-04-12 18:27:18 +00:00
}
2022-06-11 07:52:24 +00:00
func ( * SupportsFeatureRequest ) ProtoMessage ( ) { }
func ( x * SupportsFeatureRequest ) ProtoReflect ( ) protoreflect . Message {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 0 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
}
return mi . MessageOf ( x )
2019-04-12 18:27:18 +00:00
}
2022-06-11 07:52:24 +00:00
// Deprecated: Use SupportsFeatureRequest.ProtoReflect.Descriptor instead.
func ( * SupportsFeatureRequest ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 0 }
2022-06-11 07:52:24 +00:00
}
2019-04-12 18:27:18 +00:00
2022-06-11 07:52:24 +00:00
func ( x * SupportsFeatureRequest ) GetId ( ) string {
if x != nil {
return x . Id
2019-04-12 18:27:18 +00:00
}
return ""
}
type SupportsFeatureResponse struct {
2022-06-11 07:52:24 +00:00
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
2019-04-12 18:27:18 +00:00
2022-06-11 07:52:24 +00:00
HasSupport bool ` protobuf:"varint,1,opt,name=hasSupport,proto3" json:"hasSupport,omitempty" ` // true when the resource monitor supports this feature.
2019-04-12 18:27:18 +00:00
}
2020-02-28 11:53:47 +00:00
2022-06-11 07:52:24 +00:00
func ( x * SupportsFeatureResponse ) Reset ( ) {
* x = SupportsFeatureResponse { }
if protoimpl . UnsafeEnabled {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 1 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
2019-04-12 18:27:18 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * SupportsFeatureResponse ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
2019-04-12 18:27:18 +00:00
}
2022-06-11 07:52:24 +00:00
func ( * SupportsFeatureResponse ) ProtoMessage ( ) { }
func ( x * SupportsFeatureResponse ) ProtoReflect ( ) protoreflect . Message {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 1 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
}
return mi . MessageOf ( x )
2019-04-12 18:27:18 +00:00
}
2022-06-11 07:52:24 +00:00
// Deprecated: Use SupportsFeatureResponse.ProtoReflect.Descriptor instead.
func ( * SupportsFeatureResponse ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 1 }
2022-06-11 07:52:24 +00:00
}
2019-04-12 18:27:18 +00:00
2022-06-11 07:52:24 +00:00
func ( x * SupportsFeatureResponse ) GetHasSupport ( ) bool {
if x != nil {
return x . HasSupport
2019-04-12 18:27:18 +00:00
}
return false
}
2018-04-05 16:48:09 +00:00
// ReadResourceRequest contains enough information to uniquely qualify and read a resource's state.
type ReadResourceRequest struct {
2022-06-11 07:52:24 +00:00
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
2020-02-28 11:53:47 +00:00
2023-09-11 15:54:07 +00:00
Id string ` protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" ` // the ID of the resource to read.
Type string ` protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty" ` // the type of the resource object.
Name string ` protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty" ` // the name, for URN purposes, of the object.
Parent string ` protobuf:"bytes,4,opt,name=parent,proto3" json:"parent,omitempty" ` // an optional parent URN that this child resource belongs to.
Properties * structpb . Struct ` protobuf:"bytes,5,opt,name=properties,proto3" json:"properties,omitempty" ` // optional state sufficient to uniquely identify the resource.
Dependencies [ ] string ` protobuf:"bytes,6,rep,name=dependencies,proto3" json:"dependencies,omitempty" ` // a list of URNs that this read depends on, as observed by the language host.
Provider string ` protobuf:"bytes,7,opt,name=provider,proto3" json:"provider,omitempty" ` // an optional reference to the provider to use for this read.
Version string ` protobuf:"bytes,8,opt,name=version,proto3" json:"version,omitempty" ` // the version of the provider to use when servicing this request.
AcceptSecrets bool ` protobuf:"varint,9,opt,name=acceptSecrets,proto3" json:"acceptSecrets,omitempty" ` // when true operations should return secrets as strongly typed.
AdditionalSecretOutputs [ ] string ` protobuf:"bytes,10,rep,name=additionalSecretOutputs,proto3" json:"additionalSecretOutputs,omitempty" ` // a list of output properties that should also be treated as secret, in addition to ones we detect.
AcceptResources bool ` protobuf:"varint,12,opt,name=acceptResources,proto3" json:"acceptResources,omitempty" ` // when true operations should return resource references as strongly typed.
PluginDownloadURL string ` protobuf:"bytes,13,opt,name=pluginDownloadURL,proto3" json:"pluginDownloadURL,omitempty" ` // the server url of the provider to use when servicing this request.
PluginChecksums map [ string ] [ ] byte ` protobuf:"bytes,15,rep,name=pluginChecksums,proto3" json:"pluginChecksums,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" ` // a map of checksums of the provider to use when servicing this request.
SourcePosition * SourcePosition ` protobuf:"bytes,14,opt,name=sourcePosition,proto3" json:"sourcePosition,omitempty" ` // the optional source position of the user code that initiated the read.
2018-07-12 01:07:50 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) Reset ( ) {
* x = ReadResourceRequest { }
if protoimpl . UnsafeEnabled {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 2 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
2018-07-12 01:07:50 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
2018-07-12 01:07:50 +00:00
}
2022-06-11 07:52:24 +00:00
func ( * ReadResourceRequest ) ProtoMessage ( ) { }
func ( x * ReadResourceRequest ) ProtoReflect ( ) protoreflect . Message {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 2 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
}
return mi . MessageOf ( x )
2018-04-05 16:48:09 +00:00
}
2022-06-11 07:52:24 +00:00
// Deprecated: Use ReadResourceRequest.ProtoReflect.Descriptor instead.
func ( * ReadResourceRequest ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 2 }
2022-06-11 07:52:24 +00:00
}
2018-04-05 16:48:09 +00:00
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetId ( ) string {
if x != nil {
return x . Id
2018-04-05 16:48:09 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetType ( ) string {
if x != nil {
return x . Type
2018-04-05 16:48:09 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetName ( ) string {
if x != nil {
return x . Name
2018-04-05 16:48:09 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetParent ( ) string {
if x != nil {
return x . Parent
2018-04-05 16:48:09 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetProperties ( ) * structpb . Struct {
if x != nil {
return x . Properties
2018-04-05 16:48:09 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetDependencies ( ) [ ] string {
if x != nil {
return x . Dependencies
2018-08-03 21:06:00 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetProvider ( ) string {
if x != nil {
return x . Provider
Implement first-class providers. (#1695)
### First-Class Providers
These changes implement support for first-class providers. First-class
providers are provider plugins that are exposed as resources via the
Pulumi programming model so that they may be explicitly and multiply
instantiated. Each instance of a provider resource may be configured
differently, and configuration parameters may be source from the
outputs of other resources.
### Provider Plugin Changes
In order to accommodate the need to verify and diff provider
configuration and configure providers without complete configuration
information, these changes adjust the high-level provider plugin
interface. Two new methods for validating a provider's configuration
and diffing changes to the same have been added (`CheckConfig` and
`DiffConfig`, respectively), and the type of the configuration bag
accepted by `Configure` has been changed to a `PropertyMap`.
These changes have not yet been reflected in the provider plugin gRPC
interface. We will do this in a set of follow-up changes. Until then,
these methods are implemented by adapters:
- `CheckConfig` validates that all configuration parameters are string
or unknown properties. This is necessary because existing plugins
only accept string-typed configuration values.
- `DiffConfig` either returns "never replace" if all configuration
values are known or "must replace" if any configuration value is
unknown. The justification for this behavior is given
[here](https://github.com/pulumi/pulumi/pull/1695/files#diff-a6cd5c7f337665f5bb22e92ca5f07537R106)
- `Configure` converts the config bag to a legacy config map and
configures the provider plugin if all config values are known. If any
config value is unknown, the underlying plugin is not configured and
the provider may only perform `Check`, `Read`, and `Invoke`, all of
which return empty results. We justify this behavior becuase it is
only possible during a preview and provides the best experience we
can manage with the existing gRPC interface.
### Resource Model Changes
Providers are now exposed as resources that participate in a stack's
dependency graph. Like other resources, they are explicitly created,
may have multiple instances, and may have dependencies on other
resources. Providers are referred to using provider references, which
are a combination of the provider's URN and its ID. This design
addresses the need during a preview to refer to providers that have not
yet been physically created and therefore have no ID.
All custom resources that are not themselves providers must specify a
single provider via a provider reference. The named provider will be
used to manage that resource's CRUD operations. If a resource's
provider reference changes, the resource must be replaced. Though its
URN is not present in the resource's dependency list, the provider
should be treated as a dependency of the resource when topologically
sorting the dependency graph.
Finally, `Invoke` operations must now specify a provider to use for the
invocation via a provider reference.
### Engine Changes
First-class providers support requires a few changes to the engine:
- The engine must have some way to map from provider references to
provider plugins. It must be possible to add providers from a stack's
checkpoint to this map and to register new/updated providers during
the execution of a plan in response to CRUD operations on provider
resources.
- In order to support updating existing stacks using existing Pulumi
programs that may not explicitly instantiate providers, the engine
must be able to manage the "default" providers for each package
referenced by a checkpoint or Pulumi program. The configuration for
a "default" provider is taken from the stack's configuration data.
The former need is addressed by adding a provider registry type that is
responsible for managing all of the plugins required by a plan. In
addition to loading plugins froma checkpoint and providing the ability
to map from a provider reference to a provider plugin, this type serves
as the provider plugin for providers themselves (i.e. it is the
"provider provider").
The latter need is solved via two relatively self-contained changes to
plan setup and the eval source.
During plan setup, the old checkpoint is scanned for custom resources
that do not have a provider reference in order to compute the set of
packages that require a default provider. Once this set has been
computed, the required default provider definitions are conjured and
prepended to the checkpoint's resource list. Each resource that
requires a default provider is then updated to refer to the default
provider for its package.
While an eval source is running, each custom resource registration,
resource read, and invoke that does not name a provider is trapped
before being returned by the source iterator. If no default provider
for the appropriate package has been registered, the eval source
synthesizes an appropriate registration, waits for it to complete, and
records the registered provider's reference. This reference is injected
into the original request, which is then processed as usual. If a
default provider was already registered, the recorded reference is
used and no new registration occurs.
### SDK Changes
These changes only expose first-class providers from the Node.JS SDK.
- A new abstract class, `ProviderResource`, can be subclassed and used
to instantiate first-class providers.
- A new field in `ResourceOptions`, `provider`, can be used to supply
a particular provider instance to manage a `CustomResource`'s CRUD
operations.
- A new type, `InvokeOptions`, can be used to specify options that
control the behavior of a call to `pulumi.runtime.invoke`. This type
includes a `provider` field that is analogous to
`ResourceOptions.provider`.
2018-08-07 00:50:29 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetVersion ( ) string {
if x != nil {
return x . Version
2019-04-16 17:06:43 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetAcceptSecrets ( ) bool {
if x != nil {
return x . AcceptSecrets
2019-04-12 18:27:18 +00:00
}
return false
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetAdditionalSecretOutputs ( ) [ ] string {
if x != nil {
return x . AdditionalSecretOutputs
2019-04-23 00:03:08 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetAcceptResources ( ) bool {
if x != nil {
return x . AcceptResources
2020-10-27 17:12:12 +00:00
}
return false
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceRequest ) GetPluginDownloadURL ( ) string {
if x != nil {
return x . PluginDownloadURL
2021-12-17 22:52:01 +00:00
}
return ""
}
2023-09-11 15:54:07 +00:00
func ( x * ReadResourceRequest ) GetPluginChecksums ( ) map [ string ] [ ] byte {
if x != nil {
return x . PluginChecksums
}
return nil
}
[engine] Add support for source positions
These changes add support for passing source position information in
gRPC metadata and recording the source position that corresponds to a
resource registration in the statefile.
Enabling source position information in the resource model can provide
substantial benefits, including but not limited to:
- Better errors from the Pulumi CLI
- Go-to-defintion for resources in state
- Editor integration for errors, etc. from `pulumi preview`
Source positions are (file, line) or (file, line, column) tuples
represented as URIs. The line and column are stored in the fragment
portion of the URI as "line(,column)?". The scheme of the URI and the
form of its path component depends on the context in which it is
generated or used:
- During an active update, the URI's scheme is `file` and paths are
absolute filesystem paths. This allows consumers to easily access
arbitrary files that are available on the host.
- In a statefile, the URI's scheme is `project` and paths are relative
to the project root. This allows consumers to resolve source positions
relative to the project file in different contexts irrespective of the
location of the project itself (e.g. given a project-relative path and
the URL of the project's root on GitHub, one can build a GitHub URL for
the source position).
During an update, source position information may be attached to gRPC
calls as "source-position" metadata. This allows arbitrary calls to be
associated with source positions without changes to their protobuf
payloads. Modifying the protobuf payloads is also a viable approach, but
is somewhat more invasive than attaching metadata, and requires changes
to every call signature.
Source positions should reflect the position in user code that initiated
a resource model operation (e.g. the source position passed with
`RegisterResource` for `pet` in the example above should be the source
position in `index.ts`, _not_ the source position in the Pulumi SDK). In
general, the Pulumi SDK should be able to infer the source position of
the resource registration, as the relationship between a resource
registration and its corresponding user code should be static per SDK.
Source positions in state files will be stored as a new `registeredAt`
property on each resource. This property is optional.
2023-06-29 18:41:19 +00:00
func ( x * ReadResourceRequest ) GetSourcePosition ( ) * SourcePosition {
if x != nil {
return x . SourcePosition
}
return nil
}
2018-04-05 16:48:09 +00:00
// ReadResourceResponse contains the result of reading a resource's state.
type ReadResourceResponse struct {
2022-06-11 07:52:24 +00:00
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
2018-04-05 16:48:09 +00:00
2022-06-11 07:52:24 +00:00
Urn string ` protobuf:"bytes,1,opt,name=urn,proto3" json:"urn,omitempty" ` // the URN for this resource.
Properties * structpb . Struct ` protobuf:"bytes,2,opt,name=properties,proto3" json:"properties,omitempty" ` // the state of the resource read from the live environment.
2018-07-12 01:07:50 +00:00
}
2020-02-28 11:53:47 +00:00
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceResponse ) Reset ( ) {
* x = ReadResourceResponse { }
if protoimpl . UnsafeEnabled {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 3 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
2018-07-12 01:07:50 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceResponse ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
2018-07-12 01:07:50 +00:00
}
2022-06-11 07:52:24 +00:00
func ( * ReadResourceResponse ) ProtoMessage ( ) { }
func ( x * ReadResourceResponse ) ProtoReflect ( ) protoreflect . Message {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 3 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
}
return mi . MessageOf ( x )
2018-07-12 01:07:50 +00:00
}
2022-06-11 07:52:24 +00:00
// Deprecated: Use ReadResourceResponse.ProtoReflect.Descriptor instead.
func ( * ReadResourceResponse ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 3 }
2022-06-11 07:52:24 +00:00
}
2018-04-05 16:48:09 +00:00
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceResponse ) GetUrn ( ) string {
if x != nil {
return x . Urn
2018-04-05 16:48:09 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * ReadResourceResponse ) GetProperties ( ) * structpb . Struct {
if x != nil {
return x . Properties
2018-04-05 16:48:09 +00:00
}
return nil
}
2017-11-29 19:27:32 +00:00
// RegisterResourceRequest contains information about a resource object that was newly allocated.
type RegisterResourceRequest struct {
2022-06-11 07:52:24 +00:00
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
2022-06-29 12:18:14 +00:00
Type string ` protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty" ` // the type of the object allocated.
Name string ` protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" ` // the name, for URN purposes, of the object.
Parent string ` protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty" ` // an optional parent URN that this child resource belongs to.
Custom bool ` protobuf:"varint,4,opt,name=custom,proto3" json:"custom,omitempty" ` // true if the resource is a custom, managed by a plugin's CRUD operations.
Object * structpb . Struct ` protobuf:"bytes,5,opt,name=object,proto3" json:"object,omitempty" ` // an object produced by the interpreter/source.
Protect bool ` protobuf:"varint,6,opt,name=protect,proto3" json:"protect,omitempty" ` // true if the resource should be marked protected.
Dependencies [ ] string ` protobuf:"bytes,7,rep,name=dependencies,proto3" json:"dependencies,omitempty" ` // a list of URNs that this resource depends on, as observed by the language host.
Provider string ` protobuf:"bytes,8,opt,name=provider,proto3" json:"provider,omitempty" ` // an optional reference to the provider to manage this resource's CRUD operations.
PropertyDependencies map [ string ] * RegisterResourceRequest_PropertyDependencies ` protobuf:"bytes,9,rep,name=propertyDependencies,proto3" json:"propertyDependencies,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" ` // a map from property keys to the dependencies of the property.
DeleteBeforeReplace bool ` protobuf:"varint,10,opt,name=deleteBeforeReplace,proto3" json:"deleteBeforeReplace,omitempty" ` // true if this resource should be deleted before replacement.
Version string ` protobuf:"bytes,11,opt,name=version,proto3" json:"version,omitempty" ` // the version of the provider to use when servicing this request.
IgnoreChanges [ ] string ` protobuf:"bytes,12,rep,name=ignoreChanges,proto3" json:"ignoreChanges,omitempty" ` // a list of property selectors to ignore during updates.
AcceptSecrets bool ` protobuf:"varint,13,opt,name=acceptSecrets,proto3" json:"acceptSecrets,omitempty" ` // when true operations should return secrets as strongly typed.
AdditionalSecretOutputs [ ] string ` protobuf:"bytes,14,rep,name=additionalSecretOutputs,proto3" json:"additionalSecretOutputs,omitempty" ` // a list of output properties that should also be treated as secret, in addition to ones we detect.
2022-09-21 19:42:24 +00:00
AliasURNs [ ] string ` protobuf:"bytes,15,rep,name=aliasURNs,proto3" json:"aliasURNs,omitempty" ` // a list of additional URNs that should be considered the same.
2022-06-29 12:18:14 +00:00
ImportId string ` protobuf:"bytes,16,opt,name=importId,proto3" json:"importId,omitempty" ` // if set, this resource's state should be imported from the given ID.
CustomTimeouts * RegisterResourceRequest_CustomTimeouts ` protobuf:"bytes,17,opt,name=customTimeouts,proto3" json:"customTimeouts,omitempty" ` // ability to pass a custom Timeout block.
DeleteBeforeReplaceDefined bool ` protobuf:"varint,18,opt,name=deleteBeforeReplaceDefined,proto3" json:"deleteBeforeReplaceDefined,omitempty" ` // true if the deleteBeforeReplace property should be treated as defined even if it is false.
SupportsPartialValues bool ` protobuf:"varint,19,opt,name=supportsPartialValues,proto3" json:"supportsPartialValues,omitempty" ` // true if the request is from an SDK that supports partially-known properties during preview.
Remote bool ` protobuf:"varint,20,opt,name=remote,proto3" json:"remote,omitempty" ` // true if the resource is a plugin-managed component resource.
AcceptResources bool ` protobuf:"varint,21,opt,name=acceptResources,proto3" json:"acceptResources,omitempty" ` // when true operations should return resource references as strongly typed.
Providers map [ string ] string ` protobuf:"bytes,22,rep,name=providers,proto3" json:"providers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" ` // an optional reference to the provider map to manage this resource's CRUD operations.
ReplaceOnChanges [ ] string ` protobuf:"bytes,23,rep,name=replaceOnChanges,proto3" json:"replaceOnChanges,omitempty" ` // a list of properties that if changed should force a replacement.
PluginDownloadURL string ` protobuf:"bytes,24,opt,name=pluginDownloadURL,proto3" json:"pluginDownloadURL,omitempty" ` // the server URL of the provider to use when servicing this request.
2023-09-11 15:54:07 +00:00
PluginChecksums map [ string ] [ ] byte ` protobuf:"bytes,30,rep,name=pluginChecksums,proto3" json:"pluginChecksums,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" ` // a map of checksums expected for the provider plugin.
2022-06-29 12:18:14 +00:00
RetainOnDelete bool ` protobuf:"varint,25,opt,name=retainOnDelete,proto3" json:"retainOnDelete,omitempty" ` // if true the engine will not call the resource providers delete method for this resource.
2022-09-21 19:42:24 +00:00
Aliases [ ] * Alias ` protobuf:"bytes,26,rep,name=aliases,proto3" json:"aliases,omitempty" ` // a list of additional aliases that should be considered the same.
2022-10-20 06:15:43 +00:00
DeletedWith string ` protobuf:"bytes,27,opt,name=deletedWith,proto3" json:"deletedWith,omitempty" ` // if set the engine will not call the resource providers delete method for this resource when specified resource is deleted.
Maintain alias compat for older Node.js SDKs on new CLIs
This change updates the engine to detect if a `RegisterResource` request
is coming from an older Node.js SDK that is using incorrect alias specs
and, if so, transforms the aliases to be correct. This allows us to
maintain compatibility for users who have upgraded their CLI but are
still using an older version of the Node.js SDK with incorrect alias
specs.
We detect if the request is from a Node.js SDK by looking at the gRPC
request's metadata headers, specifically looking at the "pulumi-runtime"
and "user-agent" headers.
First, if the request has a "pulumi-runtime" header with a value of
"nodejs", we know it's coming from the Node.js plugin. The Node.js
language plugin proxies gRPC calls from the Node.js SDK to the resource
monitor and the proxy now sets the "pulumi-runtime" header to "nodejs"
for `RegisterResource` calls.
Second, if the request has a "user-agent" header that starts with
"grpc-node-js/", we know it's coming from the Node.js SDK. This is the
case for inline programs in the automation API, which connects directly
to the resource monitor, rather than going through the language plugin's
proxy.
We can't just look at "user-agent", because in the proxy case it will
have a Go-specific "user-agent".
Updated Node.js SDKs set a new `aliasSpecs` field on the
`RegisterResource` request, which indicates that the alias specs are
correct, and no transforms are needed.
2023-05-31 22:37:59 +00:00
// Indicates that alias specs are specified correctly according to the spec.
// Older versions of the Node.js SDK did not send alias specs correctly.
// If this is not set to true and the engine detects the request is from the
// Node.js runtime, the engine will transform incorrect alias specs into
// correct ones.
// Other SDKs that are correctly specifying alias specs could set this to
// true, but it's not necessary.
[engine] Add support for source positions
These changes add support for passing source position information in
gRPC metadata and recording the source position that corresponds to a
resource registration in the statefile.
Enabling source position information in the resource model can provide
substantial benefits, including but not limited to:
- Better errors from the Pulumi CLI
- Go-to-defintion for resources in state
- Editor integration for errors, etc. from `pulumi preview`
Source positions are (file, line) or (file, line, column) tuples
represented as URIs. The line and column are stored in the fragment
portion of the URI as "line(,column)?". The scheme of the URI and the
form of its path component depends on the context in which it is
generated or used:
- During an active update, the URI's scheme is `file` and paths are
absolute filesystem paths. This allows consumers to easily access
arbitrary files that are available on the host.
- In a statefile, the URI's scheme is `project` and paths are relative
to the project root. This allows consumers to resolve source positions
relative to the project file in different contexts irrespective of the
location of the project itself (e.g. given a project-relative path and
the URL of the project's root on GitHub, one can build a GitHub URL for
the source position).
During an update, source position information may be attached to gRPC
calls as "source-position" metadata. This allows arbitrary calls to be
associated with source positions without changes to their protobuf
payloads. Modifying the protobuf payloads is also a viable approach, but
is somewhat more invasive than attaching metadata, and requires changes
to every call signature.
Source positions should reflect the position in user code that initiated
a resource model operation (e.g. the source position passed with
`RegisterResource` for `pet` in the example above should be the source
position in `index.ts`, _not_ the source position in the Pulumi SDK). In
general, the Pulumi SDK should be able to infer the source position of
the resource registration, as the relationship between a resource
registration and its corresponding user code should be static per SDK.
Source positions in state files will be stored as a new `registeredAt`
property on each resource. This property is optional.
2023-06-29 18:41:19 +00:00
AliasSpecs bool ` protobuf:"varint,28,opt,name=aliasSpecs,proto3" json:"aliasSpecs,omitempty" `
SourcePosition * SourcePosition ` protobuf:"bytes,29,opt,name=sourcePosition,proto3" json:"sourcePosition,omitempty" ` // the optional source position of the user code that initiated the register.
2022-06-11 07:52:24 +00:00
}
func ( x * RegisterResourceRequest ) Reset ( ) {
* x = RegisterResourceRequest { }
if protoimpl . UnsafeEnabled {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 4 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
}
func ( x * RegisterResourceRequest ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
}
func ( * RegisterResourceRequest ) ProtoMessage ( ) { }
func ( x * RegisterResourceRequest ) ProtoReflect ( ) protoreflect . Message {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 4 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
}
return mi . MessageOf ( x )
}
// Deprecated: Use RegisterResourceRequest.ProtoReflect.Descriptor instead.
2018-07-12 01:07:50 +00:00
func ( * RegisterResourceRequest ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 4 }
2018-07-12 01:07:50 +00:00
}
2017-11-17 02:21:41 +00:00
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetType ( ) string {
if x != nil {
return x . Type
2017-11-17 02:21:41 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetName ( ) string {
if x != nil {
return x . Name
2017-11-17 02:21:41 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetParent ( ) string {
if x != nil {
return x . Parent
2017-11-17 02:21:41 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetCustom ( ) bool {
if x != nil {
return x . Custom
2017-11-17 02:21:41 +00:00
}
return false
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetObject ( ) * structpb . Struct {
if x != nil {
return x . Object
2017-11-17 02:21:41 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetProtect ( ) bool {
if x != nil {
return x . Protect
Implement resource protection (#751)
This change implements resource protection, as per pulumi/pulumi#689.
The overall idea is that a resource can be marked as "protect: true",
which will prevent deletion of that resource for any reason whatsoever
(straight deletion, replacement, etc). This is expressed in the
program. To "unprotect" a resource, one must perform an update setting
"protect: false", and then afterwards, they can delete the resource.
For example:
let res = new MyResource("precious", { .. }, { protect: true });
Afterwards, the resource will display in the CLI with a lock icon, and
any attempts to remove it will fail in the usual ways (in planning or,
worst case, during an actual update).
This was done by adding a new ResourceOptions bag parameter to the
base Resource types. This is unfortunately a breaking change, but now
is the right time to take this one. We had been adding new settings
one by one -- like parent and dependsOn -- and this new approach will
set us up to add any number of additional settings down the road,
without needing to worry about breaking anything ever again.
This is related to protected stacks, as described in
pulumi/pulumi-service#399. Most likely this will serve as a foundational
building block that enables the coarser grained policy management.
2017-12-20 22:31:07 +00:00
}
return false
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetDependencies ( ) [ ] string {
if x != nil {
return x . Dependencies
2018-02-21 23:11:21 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetProvider ( ) string {
if x != nil {
return x . Provider
Implement first-class providers. (#1695)
### First-Class Providers
These changes implement support for first-class providers. First-class
providers are provider plugins that are exposed as resources via the
Pulumi programming model so that they may be explicitly and multiply
instantiated. Each instance of a provider resource may be configured
differently, and configuration parameters may be source from the
outputs of other resources.
### Provider Plugin Changes
In order to accommodate the need to verify and diff provider
configuration and configure providers without complete configuration
information, these changes adjust the high-level provider plugin
interface. Two new methods for validating a provider's configuration
and diffing changes to the same have been added (`CheckConfig` and
`DiffConfig`, respectively), and the type of the configuration bag
accepted by `Configure` has been changed to a `PropertyMap`.
These changes have not yet been reflected in the provider plugin gRPC
interface. We will do this in a set of follow-up changes. Until then,
these methods are implemented by adapters:
- `CheckConfig` validates that all configuration parameters are string
or unknown properties. This is necessary because existing plugins
only accept string-typed configuration values.
- `DiffConfig` either returns "never replace" if all configuration
values are known or "must replace" if any configuration value is
unknown. The justification for this behavior is given
[here](https://github.com/pulumi/pulumi/pull/1695/files#diff-a6cd5c7f337665f5bb22e92ca5f07537R106)
- `Configure` converts the config bag to a legacy config map and
configures the provider plugin if all config values are known. If any
config value is unknown, the underlying plugin is not configured and
the provider may only perform `Check`, `Read`, and `Invoke`, all of
which return empty results. We justify this behavior becuase it is
only possible during a preview and provides the best experience we
can manage with the existing gRPC interface.
### Resource Model Changes
Providers are now exposed as resources that participate in a stack's
dependency graph. Like other resources, they are explicitly created,
may have multiple instances, and may have dependencies on other
resources. Providers are referred to using provider references, which
are a combination of the provider's URN and its ID. This design
addresses the need during a preview to refer to providers that have not
yet been physically created and therefore have no ID.
All custom resources that are not themselves providers must specify a
single provider via a provider reference. The named provider will be
used to manage that resource's CRUD operations. If a resource's
provider reference changes, the resource must be replaced. Though its
URN is not present in the resource's dependency list, the provider
should be treated as a dependency of the resource when topologically
sorting the dependency graph.
Finally, `Invoke` operations must now specify a provider to use for the
invocation via a provider reference.
### Engine Changes
First-class providers support requires a few changes to the engine:
- The engine must have some way to map from provider references to
provider plugins. It must be possible to add providers from a stack's
checkpoint to this map and to register new/updated providers during
the execution of a plan in response to CRUD operations on provider
resources.
- In order to support updating existing stacks using existing Pulumi
programs that may not explicitly instantiate providers, the engine
must be able to manage the "default" providers for each package
referenced by a checkpoint or Pulumi program. The configuration for
a "default" provider is taken from the stack's configuration data.
The former need is addressed by adding a provider registry type that is
responsible for managing all of the plugins required by a plan. In
addition to loading plugins froma checkpoint and providing the ability
to map from a provider reference to a provider plugin, this type serves
as the provider plugin for providers themselves (i.e. it is the
"provider provider").
The latter need is solved via two relatively self-contained changes to
plan setup and the eval source.
During plan setup, the old checkpoint is scanned for custom resources
that do not have a provider reference in order to compute the set of
packages that require a default provider. Once this set has been
computed, the required default provider definitions are conjured and
prepended to the checkpoint's resource list. Each resource that
requires a default provider is then updated to refer to the default
provider for its package.
While an eval source is running, each custom resource registration,
resource read, and invoke that does not name a provider is trapped
before being returned by the source iterator. If no default provider
for the appropriate package has been registered, the eval source
synthesizes an appropriate registration, waits for it to complete, and
records the registered provider's reference. This reference is injected
into the original request, which is then processed as usual. If a
default provider was already registered, the recorded reference is
used and no new registration occurs.
### SDK Changes
These changes only expose first-class providers from the Node.JS SDK.
- A new abstract class, `ProviderResource`, can be subclassed and used
to instantiate first-class providers.
- A new field in `ResourceOptions`, `provider`, can be used to supply
a particular provider instance to manage a `CustomResource`'s CRUD
operations.
- A new type, `InvokeOptions`, can be used to specify options that
control the behavior of a call to `pulumi.runtime.invoke`. This type
includes a `provider` field that is analogous to
`ResourceOptions.provider`.
2018-08-07 00:50:29 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetPropertyDependencies ( ) map [ string ] * RegisterResourceRequest_PropertyDependencies {
if x != nil {
return x . PropertyDependencies
Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.
We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.
This is perhaps clearer when described by example. Consider the
following dependency graph:
A
__|__
B C
| _|_
D E F
In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.
In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 17:46:30 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetDeleteBeforeReplace ( ) bool {
if x != nil {
return x . DeleteBeforeReplace
2019-01-31 22:27:53 +00:00
}
return false
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetVersion ( ) string {
if x != nil {
return x . Version
2019-04-16 17:06:43 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetIgnoreChanges ( ) [ ] string {
if x != nil {
return x . IgnoreChanges
2019-04-22 20:54:48 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetAcceptSecrets ( ) bool {
if x != nil {
return x . AcceptSecrets
2019-04-12 18:27:18 +00:00
}
return false
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetAdditionalSecretOutputs ( ) [ ] string {
if x != nil {
return x . AdditionalSecretOutputs
2019-04-23 00:03:08 +00:00
}
return nil
}
2022-09-21 19:42:24 +00:00
func ( x * RegisterResourceRequest ) GetAliasURNs ( ) [ ] string {
2022-06-11 07:52:24 +00:00
if x != nil {
2022-09-21 19:42:24 +00:00
return x . AliasURNs
2019-06-01 06:01:01 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetImportId ( ) string {
if x != nil {
return x . ImportId
2019-07-12 18:12:01 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetCustomTimeouts ( ) * RegisterResourceRequest_CustomTimeouts {
if x != nil {
return x . CustomTimeouts
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetDeleteBeforeReplaceDefined ( ) bool {
if x != nil {
return x . DeleteBeforeReplaceDefined
2019-08-20 22:51:02 +00:00
}
return false
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetSupportsPartialValues ( ) bool {
if x != nil {
return x . SupportsPartialValues
Propagate inputs to outputs during preview. (#3327)
These changes restore a more-correct version of the behavior that was
disabled with #3014. The original implementation of this behavior was
done in the SDKs, which do not have access to the complete inputs for a
resource (in particular, default values filled in by the provider during
`Check` are not exposed to the SDK). This lack of information meant that
the resolved output values could disagree with the typings present in
a provider SDK. Exacerbating this problem was the fact that unknown
values were dropped entirely, causing `undefined` values to appear in
unexpected places.
By doing this in the engine and allowing unknown values to be
represented in a first-class manner in the SDK, we can attack both of
these issues.
Although this behavior is not _strictly_ consistent with respect to the
resource model--in an update, a resource's output properties will come
from its provider and may differ from its input properties--this
behavior was present in the product for a fairly long time without
significant issues. In the future, we may be able to improve the
accuracy of resource outputs during a preview by allowing the provider
to dry-run CRUD operations and return partially-known values where
possible.
These changes also introduce new APIs in the Node and Python SDKs
that work with unknown values in a first-class fashion:
- A new parameter to the `apply` function that indicates that the
callback should be run even if the result of the apply contains
unknown values
- `containsUnknowns` and `isUnknown`, which return true if a value
either contains nested unknown values or is exactly an unknown value
- The `Unknown` type, which represents unknown values
The primary use case for these APIs is to allow nested, properties with
known values to be accessed via the lifted property accessor even when
the containing property is not fully know. A common example of this
pattern is the `metadata.name` property of a Kubernetes `Namespace`
object: while other properties of the `metadata` bag may be unknown,
`name` is often known. These APIs allow `ns.metadata.name` to return a
known value in this case.
In order to avoid exposing downlevel SDKs to unknown values--a change
which could break user code by exposing it to unexpected values--a
language SDK must indicate whether or not it supports first-class
unknown values as part of each `RegisterResourceRequest`.
These changes also allow us to avoid breaking user code with the new
behavior introduced by the prior commit.
Fixes #3190.
2019-11-11 20:09:34 +00:00
}
return false
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetRemote ( ) bool {
if x != nil {
return x . Remote
Initial support for remote component construction. (#5280)
These changes add initial support for the construction of remote
components. For now, this support is limited to the NodeJS SDK;
follow-up changes will implement support for the other SDKs.
Remote components are component resources that are constructed and
managed by plugins rather than by Pulumi programs. In this sense, they
are a bit like cloud resources, and are supported by the same
distribution and plugin loading mechanisms and described by the same
schema system.
The construction of a remote component is initiated by a
`RegisterResourceRequest` with the new `remote` field set to `true`.
When the resource monitor receives such a request, it loads the plugin
that implements the component resource and calls the `Construct`
method added to the resource provider interface as part of these
changes. This method accepts the information necessary to construct the
component and its children: the component's name, type, resource
options, inputs, and input dependencies. It is responsible for
dispatching to the appropriate component factory to create the
component, then returning its URN, resolved output properties, and
output property dependencies. The dependency information is necessary to
support features such as delete-before-replace, which rely on precise
dependency information for custom resources.
These changes also add initial support for more conveniently
implementing resource providers in NodeJS. The interface used to
implement such a provider is similar to the dynamic provider interface
(and may be unified with that interface in the future).
An example of a NodeJS program constructing a remote component resource
also implemented in NodeJS can be found in
`tests/construct_component/nodejs`.
This is the core of #2430.
2020-09-08 02:33:55 +00:00
}
return false
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetAcceptResources ( ) bool {
if x != nil {
return x . AcceptResources
2020-10-27 17:12:12 +00:00
}
return false
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetProviders ( ) map [ string ] string {
if x != nil {
return x . Providers
2021-04-13 21:19:24 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetReplaceOnChanges ( ) [ ] string {
if x != nil {
return x . ReplaceOnChanges
2021-07-01 19:32:08 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetPluginDownloadURL ( ) string {
if x != nil {
return x . PluginDownloadURL
2021-12-17 22:52:01 +00:00
}
return ""
}
2023-09-11 15:54:07 +00:00
func ( x * RegisterResourceRequest ) GetPluginChecksums ( ) map [ string ] [ ] byte {
if x != nil {
return x . PluginChecksums
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest ) GetRetainOnDelete ( ) bool {
if x != nil {
return x . RetainOnDelete
2022-02-16 22:11:12 +00:00
}
return false
}
2022-09-21 19:42:24 +00:00
func ( x * RegisterResourceRequest ) GetAliases ( ) [ ] * Alias {
if x != nil {
return x . Aliases
}
return nil
}
2022-10-20 06:15:43 +00:00
func ( x * RegisterResourceRequest ) GetDeletedWith ( ) string {
if x != nil {
return x . DeletedWith
}
return ""
}
Maintain alias compat for older Node.js SDKs on new CLIs
This change updates the engine to detect if a `RegisterResource` request
is coming from an older Node.js SDK that is using incorrect alias specs
and, if so, transforms the aliases to be correct. This allows us to
maintain compatibility for users who have upgraded their CLI but are
still using an older version of the Node.js SDK with incorrect alias
specs.
We detect if the request is from a Node.js SDK by looking at the gRPC
request's metadata headers, specifically looking at the "pulumi-runtime"
and "user-agent" headers.
First, if the request has a "pulumi-runtime" header with a value of
"nodejs", we know it's coming from the Node.js plugin. The Node.js
language plugin proxies gRPC calls from the Node.js SDK to the resource
monitor and the proxy now sets the "pulumi-runtime" header to "nodejs"
for `RegisterResource` calls.
Second, if the request has a "user-agent" header that starts with
"grpc-node-js/", we know it's coming from the Node.js SDK. This is the
case for inline programs in the automation API, which connects directly
to the resource monitor, rather than going through the language plugin's
proxy.
We can't just look at "user-agent", because in the proxy case it will
have a Go-specific "user-agent".
Updated Node.js SDKs set a new `aliasSpecs` field on the
`RegisterResource` request, which indicates that the alias specs are
correct, and no transforms are needed.
2023-05-31 22:37:59 +00:00
func ( x * RegisterResourceRequest ) GetAliasSpecs ( ) bool {
if x != nil {
return x . AliasSpecs
}
return false
}
[engine] Add support for source positions
These changes add support for passing source position information in
gRPC metadata and recording the source position that corresponds to a
resource registration in the statefile.
Enabling source position information in the resource model can provide
substantial benefits, including but not limited to:
- Better errors from the Pulumi CLI
- Go-to-defintion for resources in state
- Editor integration for errors, etc. from `pulumi preview`
Source positions are (file, line) or (file, line, column) tuples
represented as URIs. The line and column are stored in the fragment
portion of the URI as "line(,column)?". The scheme of the URI and the
form of its path component depends on the context in which it is
generated or used:
- During an active update, the URI's scheme is `file` and paths are
absolute filesystem paths. This allows consumers to easily access
arbitrary files that are available on the host.
- In a statefile, the URI's scheme is `project` and paths are relative
to the project root. This allows consumers to resolve source positions
relative to the project file in different contexts irrespective of the
location of the project itself (e.g. given a project-relative path and
the URL of the project's root on GitHub, one can build a GitHub URL for
the source position).
During an update, source position information may be attached to gRPC
calls as "source-position" metadata. This allows arbitrary calls to be
associated with source positions without changes to their protobuf
payloads. Modifying the protobuf payloads is also a viable approach, but
is somewhat more invasive than attaching metadata, and requires changes
to every call signature.
Source positions should reflect the position in user code that initiated
a resource model operation (e.g. the source position passed with
`RegisterResource` for `pet` in the example above should be the source
position in `index.ts`, _not_ the source position in the Pulumi SDK). In
general, the Pulumi SDK should be able to infer the source position of
the resource registration, as the relationship between a resource
registration and its corresponding user code should be static per SDK.
Source positions in state files will be stored as a new `registeredAt`
property on each resource. This property is optional.
2023-06-29 18:41:19 +00:00
func ( x * RegisterResourceRequest ) GetSourcePosition ( ) * SourcePosition {
if x != nil {
return x . SourcePosition
}
return nil
}
2022-06-11 07:52:24 +00:00
// RegisterResourceResponse is returned by the engine after a resource has finished being initialized. It includes the
// auto-assigned URN, the provider-assigned ID, and any other properties initialized by the engine.
type RegisterResourceResponse struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.
We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.
This is perhaps clearer when described by example. Consider the
following dependency graph:
A
__|__
B C
| _|_
D E F
In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.
In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 17:46:30 +00:00
2022-06-11 07:52:24 +00:00
Urn string ` protobuf:"bytes,1,opt,name=urn,proto3" json:"urn,omitempty" ` // the URN assigned by the engine.
Id string ` protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty" ` // the unique ID assigned by the provider.
Object * structpb . Struct ` protobuf:"bytes,3,opt,name=object,proto3" json:"object,omitempty" ` // the resulting object properties, including provider defaults.
Stable bool ` protobuf:"varint,4,opt,name=stable,proto3" json:"stable,omitempty" ` // if true, the object's state is stable and may be trusted not to change.
Stables [ ] string ` protobuf:"bytes,5,rep,name=stables,proto3" json:"stables,omitempty" ` // an optional list of guaranteed-stable properties.
PropertyDependencies map [ string ] * RegisterResourceResponse_PropertyDependencies ` protobuf:"bytes,6,rep,name=propertyDependencies,proto3" json:"propertyDependencies,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" ` // a map from property keys to the dependencies of the property.
Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.
We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.
This is perhaps clearer when described by example. Consider the
following dependency graph:
A
__|__
B C
| _|_
D E F
In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.
In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 17:46:30 +00:00
}
2020-02-28 11:53:47 +00:00
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceResponse ) Reset ( ) {
* x = RegisterResourceResponse { }
if protoimpl . UnsafeEnabled {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 5 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.
We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.
This is perhaps clearer when described by example. Consider the
following dependency graph:
A
__|__
B C
| _|_
D E F
In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.
In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 17:46:30 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceResponse ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.
We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.
This is perhaps clearer when described by example. Consider the
following dependency graph:
A
__|__
B C
| _|_
D E F
In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.
In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 17:46:30 +00:00
}
2022-06-11 07:52:24 +00:00
func ( * RegisterResourceResponse ) ProtoMessage ( ) { }
func ( x * RegisterResourceResponse ) ProtoReflect ( ) protoreflect . Message {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 5 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
}
return mi . MessageOf ( x )
Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.
We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.
This is perhaps clearer when described by example. Consider the
following dependency graph:
A
__|__
B C
| _|_
D E F
In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.
In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 17:46:30 +00:00
}
2022-06-11 07:52:24 +00:00
// Deprecated: Use RegisterResourceResponse.ProtoReflect.Descriptor instead.
func ( * RegisterResourceResponse ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 5 }
Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.
We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.
This is perhaps clearer when described by example. Consider the
following dependency graph:
A
__|__
B C
| _|_
D E F
In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.
In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 17:46:30 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceResponse ) GetUrn ( ) string {
if x != nil {
return x . Urn
}
return ""
Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.
We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.
This is perhaps clearer when described by example. Consider the
following dependency graph:
A
__|__
B C
| _|_
D E F
In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.
In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 17:46:30 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceResponse ) GetId ( ) string {
if x != nil {
return x . Id
}
return ""
}
Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.
We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.
This is perhaps clearer when described by example. Consider the
following dependency graph:
A
__|__
B C
| _|_
D E F
In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.
In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 17:46:30 +00:00
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceResponse ) GetObject ( ) * structpb . Struct {
if x != nil {
return x . Object
Implement more precise delete-before-replace semantics. (#2369)
This implements the new algorithm for deciding which resources must be
deleted due to a delete-before-replace operation.
We need to compute the set of resources that may be replaced by a
change to the resource under consideration. We do this by taking the
complete set of transitive dependents on the resource under
consideration and removing any resources that would not be replaced by
changes to their dependencies. We determine whether or not a resource
may be replaced by substituting unknowns for input properties that may
change due to deletion of the resources their value depends on and
calling the resource provider's Diff method.
This is perhaps clearer when described by example. Consider the
following dependency graph:
A
__|__
B C
| _|_
D E F
In this graph, all of B, C, D, E, and F transitively depend on A. It may
be the case, however, that changes to the specific properties of any of
those resources R that would occur if a resource on the path to A were
deleted and recreated may not cause R to be replaced. For example, the
edge from B to A may be a simple dependsOn edge such that a change to
B does not actually influence any of B's input properties. In that case,
neither B nor D would need to be deleted before A could be deleted.
In order to make the above algorithm a reality, the resource monitor
interface has been updated to include a map that associates an input
property key with the list of resources that input property depends on.
Older clients of the resource monitor will leave this map empty, in
which case all input properties will be treated as depending on all
dependencies of the resource. This is probably overly conservative, but
it is less conservative than what we currently implement, and is
certainly correct.
2019-01-28 17:46:30 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceResponse ) GetStable ( ) bool {
if x != nil {
return x . Stable
}
return false
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceResponse ) GetStables ( ) [ ] string {
if x != nil {
return x . Stables
}
return nil
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
2020-02-28 11:53:47 +00:00
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceResponse ) GetPropertyDependencies ( ) map [ string ] * RegisterResourceResponse_PropertyDependencies {
if x != nil {
return x . PropertyDependencies
}
return nil
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
2022-06-11 07:52:24 +00:00
// RegisterResourceOutputsRequest adds extra resource outputs created by the program after registration has occurred.
type RegisterResourceOutputsRequest struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
Urn string ` protobuf:"bytes,1,opt,name=urn,proto3" json:"urn,omitempty" ` // the URN for the resource to attach output properties to.
Outputs * structpb . Struct ` protobuf:"bytes,2,opt,name=outputs,proto3" json:"outputs,omitempty" ` // additional output properties to add to the existing resource.
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceOutputsRequest ) Reset ( ) {
* x = RegisterResourceOutputsRequest { }
if protoimpl . UnsafeEnabled {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 6 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceOutputsRequest ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
2022-06-11 07:52:24 +00:00
func ( * RegisterResourceOutputsRequest ) ProtoMessage ( ) { }
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceOutputsRequest ) ProtoReflect ( ) protoreflect . Message {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 6 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
2022-06-11 07:52:24 +00:00
return mi . MessageOf ( x )
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
2022-06-11 07:52:24 +00:00
// Deprecated: Use RegisterResourceOutputsRequest.ProtoReflect.Descriptor instead.
func ( * RegisterResourceOutputsRequest ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 6 }
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceOutputsRequest ) GetUrn ( ) string {
if x != nil {
return x . Urn
Addition of Custom Timeouts (#2885)
* Plumbing the custom timeouts from the engine to the providers
* Plumbing the CustomTimeouts through to the engine and adding test to show this
* Change the provider proto to include individual timeouts
* Plumbing the CustomTimeouts from the engine through to the Provider RPC interface
* Change how the CustomTimeouts are sent across RPC
These errors were spotted in testing. We can now see that the timeout
information is arriving in the RegisterResourceRequest
```
req=&pulumirpc.RegisterResourceRequest{
Type: "aws:s3/bucket:Bucket",
Name: "my-bucket",
Parent: "urn:pulumi:dev::aws-vpc::pulumi:pulumi:Stack::aws-vpc-dev",
Custom: true,
Object: &structpb.Struct{},
Protect: false,
Dependencies: nil,
Provider: "",
PropertyDependencies: {},
DeleteBeforeReplace: false,
Version: "",
IgnoreChanges: nil,
AcceptSecrets: true,
AdditionalSecretOutputs: nil,
Aliases: nil,
CustomTimeouts: &pulumirpc.RegisterResourceRequest_CustomTimeouts{
Create: 300,
Update: 400,
Delete: 500,
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
},
XXX_NoUnkeyedLiteral: struct {}{},
XXX_unrecognized: nil,
XXX_sizecache: 0,
}
```
* Changing the design to use strings
* CHANGELOG entry to include the CustomTimeouts work
* Changing custom timeouts to be passed around the engine as converted value
We don't want to pass around strings - the user can provide it but we want
to make the engine aware of the timeout in seconds as a float64
2019-07-15 21:26:28 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceOutputsRequest ) GetOutputs ( ) * structpb . Struct {
if x != nil {
return x . Outputs
}
return nil
2018-07-12 01:07:50 +00:00
}
2020-02-28 11:53:47 +00:00
2022-06-11 07:52:24 +00:00
type ResourceInvokeRequest struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
2023-09-11 15:54:07 +00:00
Tok string ` protobuf:"bytes,1,opt,name=tok,proto3" json:"tok,omitempty" ` // the function token to invoke.
Args * structpb . Struct ` protobuf:"bytes,2,opt,name=args,proto3" json:"args,omitempty" ` // the arguments for the function invocation.
Provider string ` protobuf:"bytes,3,opt,name=provider,proto3" json:"provider,omitempty" ` // an optional reference to the provider version to use for this invoke.
Version string ` protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty" ` // the version of the provider to use when servicing this request.
AcceptResources bool ` protobuf:"varint,5,opt,name=acceptResources,proto3" json:"acceptResources,omitempty" ` // when true operations should return resource references as strongly typed.
PluginDownloadURL string ` protobuf:"bytes,6,opt,name=pluginDownloadURL,proto3" json:"pluginDownloadURL,omitempty" ` // an optional reference to the provider url to use for this invoke.
PluginChecksums map [ string ] [ ] byte ` protobuf:"bytes,8,rep,name=pluginChecksums,proto3" json:"pluginChecksums,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" ` // a map of checksums expected for the provider plugin.
SourcePosition * SourcePosition ` protobuf:"bytes,7,opt,name=sourcePosition,proto3" json:"sourcePosition,omitempty" ` // the optional source position of the user code that initiated the invoke.
2018-07-12 01:07:50 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * ResourceInvokeRequest ) Reset ( ) {
* x = ResourceInvokeRequest { }
if protoimpl . UnsafeEnabled {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 7 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
2018-07-12 01:07:50 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * ResourceInvokeRequest ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
2017-11-17 02:21:41 +00:00
}
2022-06-11 07:52:24 +00:00
func ( * ResourceInvokeRequest ) ProtoMessage ( ) { }
2017-11-17 02:21:41 +00:00
2022-06-11 07:52:24 +00:00
func ( x * ResourceInvokeRequest ) ProtoReflect ( ) protoreflect . Message {
2022-07-12 13:45:03 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 7 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
2017-11-17 02:21:41 +00:00
}
2022-06-11 07:52:24 +00:00
return mi . MessageOf ( x )
}
// Deprecated: Use ResourceInvokeRequest.ProtoReflect.Descriptor instead.
func ( * ResourceInvokeRequest ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 7 }
2017-11-17 02:21:41 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * ResourceInvokeRequest ) GetTok ( ) string {
if x != nil {
return x . Tok
2017-11-17 02:21:41 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * ResourceInvokeRequest ) GetArgs ( ) * structpb . Struct {
if x != nil {
return x . Args
2017-11-21 01:38:09 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
func ( x * ResourceInvokeRequest ) GetProvider ( ) string {
if x != nil {
return x . Provider
2017-11-21 01:38:09 +00:00
}
2022-06-11 07:52:24 +00:00
return ""
2017-11-21 01:38:09 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * ResourceInvokeRequest ) GetVersion ( ) string {
if x != nil {
return x . Version
2017-11-17 02:21:41 +00:00
}
2022-06-11 07:52:24 +00:00
return ""
2017-11-17 02:21:41 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * ResourceInvokeRequest ) GetAcceptResources ( ) bool {
if x != nil {
return x . AcceptResources
Initial support for remote component construction. (#5280)
These changes add initial support for the construction of remote
components. For now, this support is limited to the NodeJS SDK;
follow-up changes will implement support for the other SDKs.
Remote components are component resources that are constructed and
managed by plugins rather than by Pulumi programs. In this sense, they
are a bit like cloud resources, and are supported by the same
distribution and plugin loading mechanisms and described by the same
schema system.
The construction of a remote component is initiated by a
`RegisterResourceRequest` with the new `remote` field set to `true`.
When the resource monitor receives such a request, it loads the plugin
that implements the component resource and calls the `Construct`
method added to the resource provider interface as part of these
changes. This method accepts the information necessary to construct the
component and its children: the component's name, type, resource
options, inputs, and input dependencies. It is responsible for
dispatching to the appropriate component factory to create the
component, then returning its URN, resolved output properties, and
output property dependencies. The dependency information is necessary to
support features such as delete-before-replace, which rely on precise
dependency information for custom resources.
These changes also add initial support for more conveniently
implementing resource providers in NodeJS. The interface used to
implement such a provider is similar to the dynamic provider interface
(and may be unified with that interface in the future).
An example of a NodeJS program constructing a remote component resource
also implemented in NodeJS can be found in
`tests/construct_component/nodejs`.
This is the core of #2430.
2020-09-08 02:33:55 +00:00
}
2022-06-11 07:52:24 +00:00
return false
Initial support for remote component construction. (#5280)
These changes add initial support for the construction of remote
components. For now, this support is limited to the NodeJS SDK;
follow-up changes will implement support for the other SDKs.
Remote components are component resources that are constructed and
managed by plugins rather than by Pulumi programs. In this sense, they
are a bit like cloud resources, and are supported by the same
distribution and plugin loading mechanisms and described by the same
schema system.
The construction of a remote component is initiated by a
`RegisterResourceRequest` with the new `remote` field set to `true`.
When the resource monitor receives such a request, it loads the plugin
that implements the component resource and calls the `Construct`
method added to the resource provider interface as part of these
changes. This method accepts the information necessary to construct the
component and its children: the component's name, type, resource
options, inputs, and input dependencies. It is responsible for
dispatching to the appropriate component factory to create the
component, then returning its URN, resolved output properties, and
output property dependencies. The dependency information is necessary to
support features such as delete-before-replace, which rely on precise
dependency information for custom resources.
These changes also add initial support for more conveniently
implementing resource providers in NodeJS. The interface used to
implement such a provider is similar to the dynamic provider interface
(and may be unified with that interface in the future).
An example of a NodeJS program constructing a remote component resource
also implemented in NodeJS can be found in
`tests/construct_component/nodejs`.
This is the core of #2430.
2020-09-08 02:33:55 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * ResourceInvokeRequest ) GetPluginDownloadURL ( ) string {
if x != nil {
return x . PluginDownloadURL
}
return ""
Initial support for remote component construction. (#5280)
These changes add initial support for the construction of remote
components. For now, this support is limited to the NodeJS SDK;
follow-up changes will implement support for the other SDKs.
Remote components are component resources that are constructed and
managed by plugins rather than by Pulumi programs. In this sense, they
are a bit like cloud resources, and are supported by the same
distribution and plugin loading mechanisms and described by the same
schema system.
The construction of a remote component is initiated by a
`RegisterResourceRequest` with the new `remote` field set to `true`.
When the resource monitor receives such a request, it loads the plugin
that implements the component resource and calls the `Construct`
method added to the resource provider interface as part of these
changes. This method accepts the information necessary to construct the
component and its children: the component's name, type, resource
options, inputs, and input dependencies. It is responsible for
dispatching to the appropriate component factory to create the
component, then returning its URN, resolved output properties, and
output property dependencies. The dependency information is necessary to
support features such as delete-before-replace, which rely on precise
dependency information for custom resources.
These changes also add initial support for more conveniently
implementing resource providers in NodeJS. The interface used to
implement such a provider is similar to the dynamic provider interface
(and may be unified with that interface in the future).
An example of a NodeJS program constructing a remote component resource
also implemented in NodeJS can be found in
`tests/construct_component/nodejs`.
This is the core of #2430.
2020-09-08 02:33:55 +00:00
}
2023-09-11 15:54:07 +00:00
func ( x * ResourceInvokeRequest ) GetPluginChecksums ( ) map [ string ] [ ] byte {
if x != nil {
return x . PluginChecksums
}
return nil
}
[engine] Add support for source positions
These changes add support for passing source position information in
gRPC metadata and recording the source position that corresponds to a
resource registration in the statefile.
Enabling source position information in the resource model can provide
substantial benefits, including but not limited to:
- Better errors from the Pulumi CLI
- Go-to-defintion for resources in state
- Editor integration for errors, etc. from `pulumi preview`
Source positions are (file, line) or (file, line, column) tuples
represented as URIs. The line and column are stored in the fragment
portion of the URI as "line(,column)?". The scheme of the URI and the
form of its path component depends on the context in which it is
generated or used:
- During an active update, the URI's scheme is `file` and paths are
absolute filesystem paths. This allows consumers to easily access
arbitrary files that are available on the host.
- In a statefile, the URI's scheme is `project` and paths are relative
to the project root. This allows consumers to resolve source positions
relative to the project file in different contexts irrespective of the
location of the project itself (e.g. given a project-relative path and
the URL of the project's root on GitHub, one can build a GitHub URL for
the source position).
During an update, source position information may be attached to gRPC
calls as "source-position" metadata. This allows arbitrary calls to be
associated with source positions without changes to their protobuf
payloads. Modifying the protobuf payloads is also a viable approach, but
is somewhat more invasive than attaching metadata, and requires changes
to every call signature.
Source positions should reflect the position in user code that initiated
a resource model operation (e.g. the source position passed with
`RegisterResource` for `pet` in the example above should be the source
position in `index.ts`, _not_ the source position in the Pulumi SDK). In
general, the Pulumi SDK should be able to infer the source position of
the resource registration, as the relationship between a resource
registration and its corresponding user code should be static per SDK.
Source positions in state files will be stored as a new `registeredAt`
property on each resource. This property is optional.
2023-06-29 18:41:19 +00:00
func ( x * ResourceInvokeRequest ) GetSourcePosition ( ) * SourcePosition {
if x != nil {
return x . SourcePosition
}
return nil
}
2024-02-08 13:16:23 +00:00
type ResourceCallRequest struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
Tok string ` protobuf:"bytes,1,opt,name=tok,proto3" json:"tok,omitempty" ` // the function token to invoke.
Args * structpb . Struct ` protobuf:"bytes,2,opt,name=args,proto3" json:"args,omitempty" ` // the arguments for the function invocation.
ArgDependencies map [ string ] * ResourceCallRequest_ArgumentDependencies ` protobuf:"bytes,3,rep,name=argDependencies,proto3" json:"argDependencies,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" ` // a map from argument keys to the dependencies of the argument.
Provider string ` protobuf:"bytes,4,opt,name=provider,proto3" json:"provider,omitempty" ` // an optional reference to the provider to use for this invoke.
Version string ` protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty" ` // the version of the provider to use when servicing this request.
PluginDownloadURL string ` protobuf:"bytes,13,opt,name=pluginDownloadURL,proto3" json:"pluginDownloadURL,omitempty" ` // the pluginDownloadURL of the provider to use when servicing this request.
PluginChecksums map [ string ] [ ] byte ` protobuf:"bytes,16,rep,name=pluginChecksums,proto3" json:"pluginChecksums,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3" ` // a map of checksums of the provider to use when servicing this request.
SourcePosition * SourcePosition ` protobuf:"bytes,15,opt,name=sourcePosition,proto3" json:"sourcePosition,omitempty" ` // the optional source position of the user code that initiated the call.
}
func ( x * ResourceCallRequest ) Reset ( ) {
* x = ResourceCallRequest { }
if protoimpl . UnsafeEnabled {
mi := & file_pulumi_resource_proto_msgTypes [ 8 ]
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
}
func ( x * ResourceCallRequest ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
}
func ( * ResourceCallRequest ) ProtoMessage ( ) { }
func ( x * ResourceCallRequest ) ProtoReflect ( ) protoreflect . Message {
mi := & file_pulumi_resource_proto_msgTypes [ 8 ]
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
}
return mi . MessageOf ( x )
}
// Deprecated: Use ResourceCallRequest.ProtoReflect.Descriptor instead.
func ( * ResourceCallRequest ) Descriptor ( ) ( [ ] byte , [ ] int ) {
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 8 }
}
func ( x * ResourceCallRequest ) GetTok ( ) string {
if x != nil {
return x . Tok
}
return ""
}
func ( x * ResourceCallRequest ) GetArgs ( ) * structpb . Struct {
if x != nil {
return x . Args
}
return nil
}
func ( x * ResourceCallRequest ) GetArgDependencies ( ) map [ string ] * ResourceCallRequest_ArgumentDependencies {
if x != nil {
return x . ArgDependencies
}
return nil
}
func ( x * ResourceCallRequest ) GetProvider ( ) string {
if x != nil {
return x . Provider
}
return ""
}
func ( x * ResourceCallRequest ) GetVersion ( ) string {
if x != nil {
return x . Version
}
return ""
}
func ( x * ResourceCallRequest ) GetPluginDownloadURL ( ) string {
if x != nil {
return x . PluginDownloadURL
}
return ""
}
func ( x * ResourceCallRequest ) GetPluginChecksums ( ) map [ string ] [ ] byte {
if x != nil {
return x . PluginChecksums
}
return nil
}
func ( x * ResourceCallRequest ) GetSourcePosition ( ) * SourcePosition {
if x != nil {
return x . SourcePosition
}
return nil
}
2022-06-11 07:52:24 +00:00
// PropertyDependencies describes the resources that a particular property depends on.
type RegisterResourceRequest_PropertyDependencies struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
Initial support for remote component construction. (#5280)
These changes add initial support for the construction of remote
components. For now, this support is limited to the NodeJS SDK;
follow-up changes will implement support for the other SDKs.
Remote components are component resources that are constructed and
managed by plugins rather than by Pulumi programs. In this sense, they
are a bit like cloud resources, and are supported by the same
distribution and plugin loading mechanisms and described by the same
schema system.
The construction of a remote component is initiated by a
`RegisterResourceRequest` with the new `remote` field set to `true`.
When the resource monitor receives such a request, it loads the plugin
that implements the component resource and calls the `Construct`
method added to the resource provider interface as part of these
changes. This method accepts the information necessary to construct the
component and its children: the component's name, type, resource
options, inputs, and input dependencies. It is responsible for
dispatching to the appropriate component factory to create the
component, then returning its URN, resolved output properties, and
output property dependencies. The dependency information is necessary to
support features such as delete-before-replace, which rely on precise
dependency information for custom resources.
These changes also add initial support for more conveniently
implementing resource providers in NodeJS. The interface used to
implement such a provider is similar to the dynamic provider interface
(and may be unified with that interface in the future).
An example of a NodeJS program constructing a remote component resource
also implemented in NodeJS can be found in
`tests/construct_component/nodejs`.
This is the core of #2430.
2020-09-08 02:33:55 +00:00
2022-06-11 07:52:24 +00:00
Urns [ ] string ` protobuf:"bytes,1,rep,name=urns,proto3" json:"urns,omitempty" ` // A list of URNs this property depends on.
Initial support for remote component construction. (#5280)
These changes add initial support for the construction of remote
components. For now, this support is limited to the NodeJS SDK;
follow-up changes will implement support for the other SDKs.
Remote components are component resources that are constructed and
managed by plugins rather than by Pulumi programs. In this sense, they
are a bit like cloud resources, and are supported by the same
distribution and plugin loading mechanisms and described by the same
schema system.
The construction of a remote component is initiated by a
`RegisterResourceRequest` with the new `remote` field set to `true`.
When the resource monitor receives such a request, it loads the plugin
that implements the component resource and calls the `Construct`
method added to the resource provider interface as part of these
changes. This method accepts the information necessary to construct the
component and its children: the component's name, type, resource
options, inputs, and input dependencies. It is responsible for
dispatching to the appropriate component factory to create the
component, then returning its URN, resolved output properties, and
output property dependencies. The dependency information is necessary to
support features such as delete-before-replace, which rely on precise
dependency information for custom resources.
These changes also add initial support for more conveniently
implementing resource providers in NodeJS. The interface used to
implement such a provider is similar to the dynamic provider interface
(and may be unified with that interface in the future).
An example of a NodeJS program constructing a remote component resource
also implemented in NodeJS can be found in
`tests/construct_component/nodejs`.
This is the core of #2430.
2020-09-08 02:33:55 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest_PropertyDependencies ) Reset ( ) {
* x = RegisterResourceRequest_PropertyDependencies { }
if protoimpl . UnsafeEnabled {
2024-02-08 13:16:23 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 10 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
Initial support for remote component construction. (#5280)
These changes add initial support for the construction of remote
components. For now, this support is limited to the NodeJS SDK;
follow-up changes will implement support for the other SDKs.
Remote components are component resources that are constructed and
managed by plugins rather than by Pulumi programs. In this sense, they
are a bit like cloud resources, and are supported by the same
distribution and plugin loading mechanisms and described by the same
schema system.
The construction of a remote component is initiated by a
`RegisterResourceRequest` with the new `remote` field set to `true`.
When the resource monitor receives such a request, it loads the plugin
that implements the component resource and calls the `Construct`
method added to the resource provider interface as part of these
changes. This method accepts the information necessary to construct the
component and its children: the component's name, type, resource
options, inputs, and input dependencies. It is responsible for
dispatching to the appropriate component factory to create the
component, then returning its URN, resolved output properties, and
output property dependencies. The dependency information is necessary to
support features such as delete-before-replace, which rely on precise
dependency information for custom resources.
These changes also add initial support for more conveniently
implementing resource providers in NodeJS. The interface used to
implement such a provider is similar to the dynamic provider interface
(and may be unified with that interface in the future).
An example of a NodeJS program constructing a remote component resource
also implemented in NodeJS can be found in
`tests/construct_component/nodejs`.
This is the core of #2430.
2020-09-08 02:33:55 +00:00
}
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest_PropertyDependencies ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
2018-07-12 01:07:50 +00:00
}
2022-06-11 07:52:24 +00:00
func ( * RegisterResourceRequest_PropertyDependencies ) ProtoMessage ( ) { }
2020-02-28 11:53:47 +00:00
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest_PropertyDependencies ) ProtoReflect ( ) protoreflect . Message {
2024-02-08 13:16:23 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 10 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
}
return mi . MessageOf ( x )
2017-11-29 19:27:32 +00:00
}
2022-06-11 07:52:24 +00:00
// Deprecated: Use RegisterResourceRequest_PropertyDependencies.ProtoReflect.Descriptor instead.
func ( * RegisterResourceRequest_PropertyDependencies ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 4 , 0 }
2017-11-17 02:21:41 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest_PropertyDependencies ) GetUrns ( ) [ ] string {
if x != nil {
return x . Urns
2017-11-17 02:21:41 +00:00
}
return nil
}
2022-06-11 07:52:24 +00:00
// CustomTimeouts allows a user to be able to create a set of custom timeout parameters.
type RegisterResourceRequest_CustomTimeouts struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
2022-04-14 09:59:46 +00:00
2022-06-11 07:52:24 +00:00
Create string ` protobuf:"bytes,1,opt,name=create,proto3" json:"create,omitempty" ` // The create resource timeout represented as a string e.g. 5m.
Update string ` protobuf:"bytes,2,opt,name=update,proto3" json:"update,omitempty" ` // The update resource timeout represented as a string e.g. 5m.
Delete string ` protobuf:"bytes,3,opt,name=delete,proto3" json:"delete,omitempty" ` // The delete resource timeout represented as a string e.g. 5m.
2022-04-14 09:59:46 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest_CustomTimeouts ) Reset ( ) {
* x = RegisterResourceRequest_CustomTimeouts { }
if protoimpl . UnsafeEnabled {
2024-02-08 13:16:23 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 11 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
2022-04-14 09:59:46 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest_CustomTimeouts ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
2022-04-14 09:59:46 +00:00
}
2022-06-11 07:52:24 +00:00
func ( * RegisterResourceRequest_CustomTimeouts ) ProtoMessage ( ) { }
func ( x * RegisterResourceRequest_CustomTimeouts ) ProtoReflect ( ) protoreflect . Message {
2024-02-08 13:16:23 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 11 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
}
return mi . MessageOf ( x )
2022-04-14 09:59:46 +00:00
}
2022-06-11 07:52:24 +00:00
// Deprecated: Use RegisterResourceRequest_CustomTimeouts.ProtoReflect.Descriptor instead.
func ( * RegisterResourceRequest_CustomTimeouts ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 4 , 1 }
2022-06-11 07:52:24 +00:00
}
2022-04-14 09:59:46 +00:00
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest_CustomTimeouts ) GetCreate ( ) string {
if x != nil {
return x . Create
2022-04-14 09:59:46 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest_CustomTimeouts ) GetUpdate ( ) string {
if x != nil {
return x . Update
2022-04-14 09:59:46 +00:00
}
2022-06-11 07:52:24 +00:00
return ""
2022-04-14 09:59:46 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceRequest_CustomTimeouts ) GetDelete ( ) string {
if x != nil {
return x . Delete
2022-04-14 09:59:46 +00:00
}
return ""
}
2022-06-11 07:52:24 +00:00
// PropertyDependencies describes the resources that a particular property depends on.
type RegisterResourceResponse_PropertyDependencies struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
Urns [ ] string ` protobuf:"bytes,1,rep,name=urns,proto3" json:"urns,omitempty" ` // A list of URNs this property depends on.
}
func ( x * RegisterResourceResponse_PropertyDependencies ) Reset ( ) {
* x = RegisterResourceResponse_PropertyDependencies { }
if protoimpl . UnsafeEnabled {
2024-02-08 13:16:23 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 15 ]
2022-06-11 07:52:24 +00:00
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
2022-04-14 09:59:46 +00:00
}
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceResponse_PropertyDependencies ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
}
func ( * RegisterResourceResponse_PropertyDependencies ) ProtoMessage ( ) { }
func ( x * RegisterResourceResponse_PropertyDependencies ) ProtoReflect ( ) protoreflect . Message {
2024-02-08 13:16:23 +00:00
mi := & file_pulumi_resource_proto_msgTypes [ 15 ]
2022-06-11 07:52:24 +00:00
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
2022-04-14 09:59:46 +00:00
}
2022-06-11 07:52:24 +00:00
return mi . MessageOf ( x )
}
// Deprecated: Use RegisterResourceResponse_PropertyDependencies.ProtoReflect.Descriptor instead.
func ( * RegisterResourceResponse_PropertyDependencies ) Descriptor ( ) ( [ ] byte , [ ] int ) {
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 5 , 0 }
2022-04-14 09:59:46 +00:00
}
2022-06-11 07:52:24 +00:00
func ( x * RegisterResourceResponse_PropertyDependencies ) GetUrns ( ) [ ] string {
if x != nil {
return x . Urns
2022-04-14 09:59:46 +00:00
}
2022-06-11 07:52:24 +00:00
return nil
2022-04-14 09:59:46 +00:00
}
2024-02-08 13:16:23 +00:00
// ArgumentDependencies describes the resources that a particular argument depends on.
type ResourceCallRequest_ArgumentDependencies struct {
state protoimpl . MessageState
sizeCache protoimpl . SizeCache
unknownFields protoimpl . UnknownFields
Urns [ ] string ` protobuf:"bytes,1,rep,name=urns,proto3" json:"urns,omitempty" ` // A list of URNs this argument depends on.
}
func ( x * ResourceCallRequest_ArgumentDependencies ) Reset ( ) {
* x = ResourceCallRequest_ArgumentDependencies { }
if protoimpl . UnsafeEnabled {
mi := & file_pulumi_resource_proto_msgTypes [ 18 ]
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
ms . StoreMessageInfo ( mi )
}
}
func ( x * ResourceCallRequest_ArgumentDependencies ) String ( ) string {
return protoimpl . X . MessageStringOf ( x )
}
func ( * ResourceCallRequest_ArgumentDependencies ) ProtoMessage ( ) { }
func ( x * ResourceCallRequest_ArgumentDependencies ) ProtoReflect ( ) protoreflect . Message {
mi := & file_pulumi_resource_proto_msgTypes [ 18 ]
if protoimpl . UnsafeEnabled && x != nil {
ms := protoimpl . X . MessageStateOf ( protoimpl . Pointer ( x ) )
if ms . LoadMessageInfo ( ) == nil {
ms . StoreMessageInfo ( mi )
}
return ms
}
return mi . MessageOf ( x )
}
// Deprecated: Use ResourceCallRequest_ArgumentDependencies.ProtoReflect.Descriptor instead.
func ( * ResourceCallRequest_ArgumentDependencies ) Descriptor ( ) ( [ ] byte , [ ] int ) {
return file_pulumi_resource_proto_rawDescGZIP ( ) , [ ] int { 8 , 0 }
}
func ( x * ResourceCallRequest_ArgumentDependencies ) GetUrns ( ) [ ] string {
if x != nil {
return x . Urns
}
return nil
}
2022-07-12 13:45:03 +00:00
var File_pulumi_resource_proto protoreflect . FileDescriptor
var file_pulumi_resource_proto_rawDesc = [ ] byte {
0x0a , 0x15 , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x2f , 0x72 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 ,
0x65 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x12 , 0x09 , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 ,
0x70 , 0x63 , 0x1a , 0x1b , 0x67 , 0x6f , 0x6f , 0x67 , 0x6c , 0x65 , 0x2f , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f ,
0x62 , 0x75 , 0x66 , 0x2f , 0x65 , 0x6d , 0x70 , 0x74 , 0x79 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x1a ,
0x1c , 0x67 , 0x6f , 0x6f , 0x67 , 0x6c , 0x65 , 0x2f , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x62 , 0x75 , 0x66 ,
0x2f , 0x73 , 0x74 , 0x72 , 0x75 , 0x63 , 0x74 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x1a , 0x15 , 0x70 ,
0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x2f , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 , 0x2e , 0x70 ,
2022-09-22 17:13:55 +00:00
0x72 , 0x6f , 0x74 , 0x6f , 0x1a , 0x12 , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x2f , 0x61 , 0x6c , 0x69 ,
[engine] Add support for source positions
These changes add support for passing source position information in
gRPC metadata and recording the source position that corresponds to a
resource registration in the statefile.
Enabling source position information in the resource model can provide
substantial benefits, including but not limited to:
- Better errors from the Pulumi CLI
- Go-to-defintion for resources in state
- Editor integration for errors, etc. from `pulumi preview`
Source positions are (file, line) or (file, line, column) tuples
represented as URIs. The line and column are stored in the fragment
portion of the URI as "line(,column)?". The scheme of the URI and the
form of its path component depends on the context in which it is
generated or used:
- During an active update, the URI's scheme is `file` and paths are
absolute filesystem paths. This allows consumers to easily access
arbitrary files that are available on the host.
- In a statefile, the URI's scheme is `project` and paths are relative
to the project root. This allows consumers to resolve source positions
relative to the project file in different contexts irrespective of the
location of the project itself (e.g. given a project-relative path and
the URL of the project's root on GitHub, one can build a GitHub URL for
the source position).
During an update, source position information may be attached to gRPC
calls as "source-position" metadata. This allows arbitrary calls to be
associated with source positions without changes to their protobuf
payloads. Modifying the protobuf payloads is also a viable approach, but
is somewhat more invasive than attaching metadata, and requires changes
to every call signature.
Source positions should reflect the position in user code that initiated
a resource model operation (e.g. the source position passed with
`RegisterResource` for `pet` in the example above should be the source
position in `index.ts`, _not_ the source position in the Pulumi SDK). In
general, the Pulumi SDK should be able to infer the source position of
the resource registration, as the relationship between a resource
registration and its corresponding user code should be static per SDK.
Source positions in state files will be stored as a new `registeredAt`
property on each resource. This property is optional.
2023-06-29 18:41:19 +00:00
0x61 , 0x73 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x1a , 0x13 , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 ,
0x2f , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x22 , 0x28 , 0x0a ,
0x16 , 0x53 , 0x75 , 0x70 , 0x70 , 0x6f , 0x72 , 0x74 , 0x73 , 0x46 , 0x65 , 0x61 , 0x74 , 0x75 , 0x72 , 0x65 ,
0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x12 , 0x0e , 0x0a , 0x02 , 0x69 , 0x64 , 0x18 , 0x01 , 0x20 ,
0x01 , 0x28 , 0x09 , 0x52 , 0x02 , 0x69 , 0x64 , 0x22 , 0x39 , 0x0a , 0x17 , 0x53 , 0x75 , 0x70 , 0x70 , 0x6f ,
0x72 , 0x74 , 0x73 , 0x46 , 0x65 , 0x61 , 0x74 , 0x75 , 0x72 , 0x65 , 0x52 , 0x65 , 0x73 , 0x70 , 0x6f , 0x6e ,
0x73 , 0x65 , 0x12 , 0x1e , 0x0a , 0x0a , 0x68 , 0x61 , 0x73 , 0x53 , 0x75 , 0x70 , 0x70 , 0x6f , 0x72 , 0x74 ,
0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x0a , 0x68 , 0x61 , 0x73 , 0x53 , 0x75 , 0x70 , 0x70 , 0x6f ,
2023-09-11 15:54:07 +00:00
0x72 , 0x74 , 0x22 , 0xa5 , 0x05 , 0x0a , 0x13 , 0x52 , 0x65 , 0x61 , 0x64 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 ,
[engine] Add support for source positions
These changes add support for passing source position information in
gRPC metadata and recording the source position that corresponds to a
resource registration in the statefile.
Enabling source position information in the resource model can provide
substantial benefits, including but not limited to:
- Better errors from the Pulumi CLI
- Go-to-defintion for resources in state
- Editor integration for errors, etc. from `pulumi preview`
Source positions are (file, line) or (file, line, column) tuples
represented as URIs. The line and column are stored in the fragment
portion of the URI as "line(,column)?". The scheme of the URI and the
form of its path component depends on the context in which it is
generated or used:
- During an active update, the URI's scheme is `file` and paths are
absolute filesystem paths. This allows consumers to easily access
arbitrary files that are available on the host.
- In a statefile, the URI's scheme is `project` and paths are relative
to the project root. This allows consumers to resolve source positions
relative to the project file in different contexts irrespective of the
location of the project itself (e.g. given a project-relative path and
the URL of the project's root on GitHub, one can build a GitHub URL for
the source position).
During an update, source position information may be attached to gRPC
calls as "source-position" metadata. This allows arbitrary calls to be
associated with source positions without changes to their protobuf
payloads. Modifying the protobuf payloads is also a viable approach, but
is somewhat more invasive than attaching metadata, and requires changes
to every call signature.
Source positions should reflect the position in user code that initiated
a resource model operation (e.g. the source position passed with
`RegisterResource` for `pet` in the example above should be the source
position in `index.ts`, _not_ the source position in the Pulumi SDK). In
general, the Pulumi SDK should be able to infer the source position of
the resource registration, as the relationship between a resource
registration and its corresponding user code should be static per SDK.
Source positions in state files will be stored as a new `registeredAt`
property on each resource. This property is optional.
2023-06-29 18:41:19 +00:00
0x72 , 0x63 , 0x65 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x12 , 0x0e , 0x0a , 0x02 , 0x69 , 0x64 ,
0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x02 , 0x69 , 0x64 , 0x12 , 0x12 , 0x0a , 0x04 , 0x74 , 0x79 ,
0x70 , 0x65 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x04 , 0x74 , 0x79 , 0x70 , 0x65 , 0x12 , 0x12 ,
0x0a , 0x04 , 0x6e , 0x61 , 0x6d , 0x65 , 0x18 , 0x03 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x04 , 0x6e , 0x61 ,
0x6d , 0x65 , 0x12 , 0x16 , 0x0a , 0x06 , 0x70 , 0x61 , 0x72 , 0x65 , 0x6e , 0x74 , 0x18 , 0x04 , 0x20 , 0x01 ,
0x28 , 0x09 , 0x52 , 0x06 , 0x70 , 0x61 , 0x72 , 0x65 , 0x6e , 0x74 , 0x12 , 0x37 , 0x0a , 0x0a , 0x70 , 0x72 ,
0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x69 , 0x65 , 0x73 , 0x18 , 0x05 , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x17 ,
0x2e , 0x67 , 0x6f , 0x6f , 0x67 , 0x6c , 0x65 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x62 , 0x75 , 0x66 ,
0x2e , 0x53 , 0x74 , 0x72 , 0x75 , 0x63 , 0x74 , 0x52 , 0x0a , 0x70 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 ,
0x69 , 0x65 , 0x73 , 0x12 , 0x22 , 0x0a , 0x0c , 0x64 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 ,
0x69 , 0x65 , 0x73 , 0x18 , 0x06 , 0x20 , 0x03 , 0x28 , 0x09 , 0x52 , 0x0c , 0x64 , 0x65 , 0x70 , 0x65 , 0x6e ,
0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x12 , 0x1a , 0x0a , 0x08 , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 ,
0x64 , 0x65 , 0x72 , 0x18 , 0x07 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x08 , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 ,
0x64 , 0x65 , 0x72 , 0x12 , 0x18 , 0x0a , 0x07 , 0x76 , 0x65 , 0x72 , 0x73 , 0x69 , 0x6f , 0x6e , 0x18 , 0x08 ,
0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x07 , 0x76 , 0x65 , 0x72 , 0x73 , 0x69 , 0x6f , 0x6e , 0x12 , 0x24 , 0x0a ,
0x0d , 0x61 , 0x63 , 0x63 , 0x65 , 0x70 , 0x74 , 0x53 , 0x65 , 0x63 , 0x72 , 0x65 , 0x74 , 0x73 , 0x18 , 0x09 ,
0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x0d , 0x61 , 0x63 , 0x63 , 0x65 , 0x70 , 0x74 , 0x53 , 0x65 , 0x63 , 0x72 ,
0x65 , 0x74 , 0x73 , 0x12 , 0x38 , 0x0a , 0x17 , 0x61 , 0x64 , 0x64 , 0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x61 ,
0x6c , 0x53 , 0x65 , 0x63 , 0x72 , 0x65 , 0x74 , 0x4f , 0x75 , 0x74 , 0x70 , 0x75 , 0x74 , 0x73 , 0x18 , 0x0a ,
0x20 , 0x03 , 0x28 , 0x09 , 0x52 , 0x17 , 0x61 , 0x64 , 0x64 , 0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x61 , 0x6c ,
0x53 , 0x65 , 0x63 , 0x72 , 0x65 , 0x74 , 0x4f , 0x75 , 0x74 , 0x70 , 0x75 , 0x74 , 0x73 , 0x12 , 0x28 , 0x0a ,
0x0f , 0x61 , 0x63 , 0x63 , 0x65 , 0x70 , 0x74 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x73 ,
0x18 , 0x0c , 0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x0f , 0x61 , 0x63 , 0x63 , 0x65 , 0x70 , 0x74 , 0x52 , 0x65 ,
0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x73 , 0x12 , 0x2c , 0x0a , 0x11 , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 ,
0x6e , 0x44 , 0x6f , 0x77 , 0x6e , 0x6c , 0x6f , 0x61 , 0x64 , 0x55 , 0x52 , 0x4c , 0x18 , 0x0d , 0x20 , 0x01 ,
0x28 , 0x09 , 0x52 , 0x11 , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x44 , 0x6f , 0x77 , 0x6e , 0x6c , 0x6f ,
2023-09-11 15:54:07 +00:00
0x61 , 0x64 , 0x55 , 0x52 , 0x4c , 0x12 , 0x5d , 0x0a , 0x0f , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x43 ,
0x68 , 0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x18 , 0x0f , 0x20 , 0x03 , 0x28 , 0x0b , 0x32 , 0x33 ,
0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x61 , 0x64 , 0x52 ,
0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x2e , 0x50 ,
0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x45 , 0x6e ,
0x74 , 0x72 , 0x79 , 0x52 , 0x0f , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b ,
0x73 , 0x75 , 0x6d , 0x73 , 0x12 , 0x41 , 0x0a , 0x0e , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 , 0x6f ,
0x73 , 0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x18 , 0x0e , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x19 , 0x2e , 0x70 ,
0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x53 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 ,
0x6f , 0x73 , 0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x52 , 0x0e , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 ,
0x6f , 0x73 , 0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x1a , 0x42 , 0x0a , 0x14 , 0x50 , 0x6c , 0x75 , 0x67 , 0x69 ,
0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x45 , 0x6e , 0x74 , 0x72 , 0x79 , 0x12 ,
0x10 , 0x0a , 0x03 , 0x6b , 0x65 , 0x79 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x03 , 0x6b , 0x65 ,
0x79 , 0x12 , 0x14 , 0x0a , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x0c ,
0x52 , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x3a , 0x02 , 0x38 , 0x01 , 0x4a , 0x04 , 0x08 , 0x0b , 0x10 ,
0x0c , 0x52 , 0x07 , 0x61 , 0x6c , 0x69 , 0x61 , 0x73 , 0x65 , 0x73 , 0x22 , 0x61 , 0x0a , 0x14 , 0x52 , 0x65 ,
0x61 , 0x64 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 , 0x65 , 0x73 , 0x70 , 0x6f , 0x6e ,
0x73 , 0x65 , 0x12 , 0x10 , 0x0a , 0x03 , 0x75 , 0x72 , 0x6e , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 ,
0x03 , 0x75 , 0x72 , 0x6e , 0x12 , 0x37 , 0x0a , 0x0a , 0x70 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x69 ,
0x65 , 0x73 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x17 , 0x2e , 0x67 , 0x6f , 0x6f , 0x67 , 0x6c ,
0x65 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x62 , 0x75 , 0x66 , 0x2e , 0x53 , 0x74 , 0x72 , 0x75 , 0x63 ,
0x74 , 0x52 , 0x0a , 0x70 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x69 , 0x65 , 0x73 , 0x22 , 0xff , 0x0d ,
0x0a , 0x17 , 0x52 , 0x65 , 0x67 , 0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 ,
0x63 , 0x65 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x12 , 0x12 , 0x0a , 0x04 , 0x74 , 0x79 , 0x70 ,
0x65 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x04 , 0x74 , 0x79 , 0x70 , 0x65 , 0x12 , 0x12 , 0x0a ,
0x04 , 0x6e , 0x61 , 0x6d , 0x65 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x04 , 0x6e , 0x61 , 0x6d ,
0x65 , 0x12 , 0x16 , 0x0a , 0x06 , 0x70 , 0x61 , 0x72 , 0x65 , 0x6e , 0x74 , 0x18 , 0x03 , 0x20 , 0x01 , 0x28 ,
0x09 , 0x52 , 0x06 , 0x70 , 0x61 , 0x72 , 0x65 , 0x6e , 0x74 , 0x12 , 0x16 , 0x0a , 0x06 , 0x63 , 0x75 , 0x73 ,
0x74 , 0x6f , 0x6d , 0x18 , 0x04 , 0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x06 , 0x63 , 0x75 , 0x73 , 0x74 , 0x6f ,
0x6d , 0x12 , 0x2f , 0x0a , 0x06 , 0x6f , 0x62 , 0x6a , 0x65 , 0x63 , 0x74 , 0x18 , 0x05 , 0x20 , 0x01 , 0x28 ,
0x0b , 0x32 , 0x17 , 0x2e , 0x67 , 0x6f , 0x6f , 0x67 , 0x6c , 0x65 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f ,
0x62 , 0x75 , 0x66 , 0x2e , 0x53 , 0x74 , 0x72 , 0x75 , 0x63 , 0x74 , 0x52 , 0x06 , 0x6f , 0x62 , 0x6a , 0x65 ,
0x63 , 0x74 , 0x12 , 0x18 , 0x0a , 0x07 , 0x70 , 0x72 , 0x6f , 0x74 , 0x65 , 0x63 , 0x74 , 0x18 , 0x06 , 0x20 ,
0x01 , 0x28 , 0x08 , 0x52 , 0x07 , 0x70 , 0x72 , 0x6f , 0x74 , 0x65 , 0x63 , 0x74 , 0x12 , 0x22 , 0x0a , 0x0c ,
0x64 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x18 , 0x07 , 0x20 , 0x03 ,
0x28 , 0x09 , 0x52 , 0x0c , 0x64 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 ,
0x12 , 0x1a , 0x0a , 0x08 , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 , 0x18 , 0x08 , 0x20 , 0x01 ,
0x28 , 0x09 , 0x52 , 0x08 , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 , 0x12 , 0x70 , 0x0a , 0x14 ,
0x70 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e ,
0x63 , 0x69 , 0x65 , 0x73 , 0x18 , 0x09 , 0x20 , 0x03 , 0x28 , 0x0b , 0x32 , 0x3c , 0x2e , 0x70 , 0x75 , 0x6c ,
0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x67 , 0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 ,
0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x2e , 0x50 ,
0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 ,
0x69 , 0x65 , 0x73 , 0x45 , 0x6e , 0x74 , 0x72 , 0x79 , 0x52 , 0x14 , 0x70 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 ,
0x74 , 0x79 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x12 , 0x30 ,
0x0a , 0x13 , 0x64 , 0x65 , 0x6c , 0x65 , 0x74 , 0x65 , 0x42 , 0x65 , 0x66 , 0x6f , 0x72 , 0x65 , 0x52 , 0x65 ,
0x70 , 0x6c , 0x61 , 0x63 , 0x65 , 0x18 , 0x0a , 0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x13 , 0x64 , 0x65 , 0x6c ,
0x65 , 0x74 , 0x65 , 0x42 , 0x65 , 0x66 , 0x6f , 0x72 , 0x65 , 0x52 , 0x65 , 0x70 , 0x6c , 0x61 , 0x63 , 0x65 ,
0x12 , 0x18 , 0x0a , 0x07 , 0x76 , 0x65 , 0x72 , 0x73 , 0x69 , 0x6f , 0x6e , 0x18 , 0x0b , 0x20 , 0x01 , 0x28 ,
0x09 , 0x52 , 0x07 , 0x76 , 0x65 , 0x72 , 0x73 , 0x69 , 0x6f , 0x6e , 0x12 , 0x24 , 0x0a , 0x0d , 0x69 , 0x67 ,
0x6e , 0x6f , 0x72 , 0x65 , 0x43 , 0x68 , 0x61 , 0x6e , 0x67 , 0x65 , 0x73 , 0x18 , 0x0c , 0x20 , 0x03 , 0x28 ,
0x09 , 0x52 , 0x0d , 0x69 , 0x67 , 0x6e , 0x6f , 0x72 , 0x65 , 0x43 , 0x68 , 0x61 , 0x6e , 0x67 , 0x65 , 0x73 ,
0x12 , 0x24 , 0x0a , 0x0d , 0x61 , 0x63 , 0x63 , 0x65 , 0x70 , 0x74 , 0x53 , 0x65 , 0x63 , 0x72 , 0x65 , 0x74 ,
0x73 , 0x18 , 0x0d , 0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x0d , 0x61 , 0x63 , 0x63 , 0x65 , 0x70 , 0x74 , 0x53 ,
0x65 , 0x63 , 0x72 , 0x65 , 0x74 , 0x73 , 0x12 , 0x38 , 0x0a , 0x17 , 0x61 , 0x64 , 0x64 , 0x69 , 0x74 , 0x69 ,
0x6f , 0x6e , 0x61 , 0x6c , 0x53 , 0x65 , 0x63 , 0x72 , 0x65 , 0x74 , 0x4f , 0x75 , 0x74 , 0x70 , 0x75 , 0x74 ,
0x73 , 0x18 , 0x0e , 0x20 , 0x03 , 0x28 , 0x09 , 0x52 , 0x17 , 0x61 , 0x64 , 0x64 , 0x69 , 0x74 , 0x69 , 0x6f ,
0x6e , 0x61 , 0x6c , 0x53 , 0x65 , 0x63 , 0x72 , 0x65 , 0x74 , 0x4f , 0x75 , 0x74 , 0x70 , 0x75 , 0x74 , 0x73 ,
0x12 , 0x1c , 0x0a , 0x09 , 0x61 , 0x6c , 0x69 , 0x61 , 0x73 , 0x55 , 0x52 , 0x4e , 0x73 , 0x18 , 0x0f , 0x20 ,
0x03 , 0x28 , 0x09 , 0x52 , 0x09 , 0x61 , 0x6c , 0x69 , 0x61 , 0x73 , 0x55 , 0x52 , 0x4e , 0x73 , 0x12 , 0x1a ,
0x0a , 0x08 , 0x69 , 0x6d , 0x70 , 0x6f , 0x72 , 0x74 , 0x49 , 0x64 , 0x18 , 0x10 , 0x20 , 0x01 , 0x28 , 0x09 ,
0x52 , 0x08 , 0x69 , 0x6d , 0x70 , 0x6f , 0x72 , 0x74 , 0x49 , 0x64 , 0x12 , 0x59 , 0x0a , 0x0e , 0x63 , 0x75 ,
0x73 , 0x74 , 0x6f , 0x6d , 0x54 , 0x69 , 0x6d , 0x65 , 0x6f , 0x75 , 0x74 , 0x73 , 0x18 , 0x11 , 0x20 , 0x01 ,
0x28 , 0x0b , 0x32 , 0x31 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 ,
[engine] Add support for source positions
These changes add support for passing source position information in
gRPC metadata and recording the source position that corresponds to a
resource registration in the statefile.
Enabling source position information in the resource model can provide
substantial benefits, including but not limited to:
- Better errors from the Pulumi CLI
- Go-to-defintion for resources in state
- Editor integration for errors, etc. from `pulumi preview`
Source positions are (file, line) or (file, line, column) tuples
represented as URIs. The line and column are stored in the fragment
portion of the URI as "line(,column)?". The scheme of the URI and the
form of its path component depends on the context in which it is
generated or used:
- During an active update, the URI's scheme is `file` and paths are
absolute filesystem paths. This allows consumers to easily access
arbitrary files that are available on the host.
- In a statefile, the URI's scheme is `project` and paths are relative
to the project root. This allows consumers to resolve source positions
relative to the project file in different contexts irrespective of the
location of the project itself (e.g. given a project-relative path and
the URL of the project's root on GitHub, one can build a GitHub URL for
the source position).
During an update, source position information may be attached to gRPC
calls as "source-position" metadata. This allows arbitrary calls to be
associated with source positions without changes to their protobuf
payloads. Modifying the protobuf payloads is also a viable approach, but
is somewhat more invasive than attaching metadata, and requires changes
to every call signature.
Source positions should reflect the position in user code that initiated
a resource model operation (e.g. the source position passed with
`RegisterResource` for `pet` in the example above should be the source
position in `index.ts`, _not_ the source position in the Pulumi SDK). In
general, the Pulumi SDK should be able to infer the source position of
the resource registration, as the relationship between a resource
registration and its corresponding user code should be static per SDK.
Source positions in state files will be stored as a new `registeredAt`
property on each resource. This property is optional.
2023-06-29 18:41:19 +00:00
0x65 , 0x67 , 0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 ,
2023-09-11 15:54:07 +00:00
0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x2e , 0x43 , 0x75 , 0x73 , 0x74 , 0x6f , 0x6d , 0x54 , 0x69 , 0x6d ,
0x65 , 0x6f , 0x75 , 0x74 , 0x73 , 0x52 , 0x0e , 0x63 , 0x75 , 0x73 , 0x74 , 0x6f , 0x6d , 0x54 , 0x69 , 0x6d ,
0x65 , 0x6f , 0x75 , 0x74 , 0x73 , 0x12 , 0x3e , 0x0a , 0x1a , 0x64 , 0x65 , 0x6c , 0x65 , 0x74 , 0x65 , 0x42 ,
0x65 , 0x66 , 0x6f , 0x72 , 0x65 , 0x52 , 0x65 , 0x70 , 0x6c , 0x61 , 0x63 , 0x65 , 0x44 , 0x65 , 0x66 , 0x69 ,
0x6e , 0x65 , 0x64 , 0x18 , 0x12 , 0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x1a , 0x64 , 0x65 , 0x6c , 0x65 , 0x74 ,
0x65 , 0x42 , 0x65 , 0x66 , 0x6f , 0x72 , 0x65 , 0x52 , 0x65 , 0x70 , 0x6c , 0x61 , 0x63 , 0x65 , 0x44 , 0x65 ,
0x66 , 0x69 , 0x6e , 0x65 , 0x64 , 0x12 , 0x34 , 0x0a , 0x15 , 0x73 , 0x75 , 0x70 , 0x70 , 0x6f , 0x72 , 0x74 ,
0x73 , 0x50 , 0x61 , 0x72 , 0x74 , 0x69 , 0x61 , 0x6c , 0x56 , 0x61 , 0x6c , 0x75 , 0x65 , 0x73 , 0x18 , 0x13 ,
0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x15 , 0x73 , 0x75 , 0x70 , 0x70 , 0x6f , 0x72 , 0x74 , 0x73 , 0x50 , 0x61 ,
0x72 , 0x74 , 0x69 , 0x61 , 0x6c , 0x56 , 0x61 , 0x6c , 0x75 , 0x65 , 0x73 , 0x12 , 0x16 , 0x0a , 0x06 , 0x72 ,
0x65 , 0x6d , 0x6f , 0x74 , 0x65 , 0x18 , 0x14 , 0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x06 , 0x72 , 0x65 , 0x6d ,
0x6f , 0x74 , 0x65 , 0x12 , 0x28 , 0x0a , 0x0f , 0x61 , 0x63 , 0x63 , 0x65 , 0x70 , 0x74 , 0x52 , 0x65 , 0x73 ,
0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x73 , 0x18 , 0x15 , 0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x0f , 0x61 , 0x63 ,
0x63 , 0x65 , 0x70 , 0x74 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x73 , 0x12 , 0x4f , 0x0a ,
0x09 , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 , 0x73 , 0x18 , 0x16 , 0x20 , 0x03 , 0x28 , 0x0b ,
0x32 , 0x31 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x67 ,
0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 , 0x65 , 0x71 ,
0x75 , 0x65 , 0x73 , 0x74 , 0x2e , 0x50 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 , 0x73 , 0x45 , 0x6e ,
0x74 , 0x72 , 0x79 , 0x52 , 0x09 , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 , 0x73 , 0x12 , 0x2a ,
0x0a , 0x10 , 0x72 , 0x65 , 0x70 , 0x6c , 0x61 , 0x63 , 0x65 , 0x4f , 0x6e , 0x43 , 0x68 , 0x61 , 0x6e , 0x67 ,
0x65 , 0x73 , 0x18 , 0x17 , 0x20 , 0x03 , 0x28 , 0x09 , 0x52 , 0x10 , 0x72 , 0x65 , 0x70 , 0x6c , 0x61 , 0x63 ,
0x65 , 0x4f , 0x6e , 0x43 , 0x68 , 0x61 , 0x6e , 0x67 , 0x65 , 0x73 , 0x12 , 0x2c , 0x0a , 0x11 , 0x70 , 0x6c ,
0x75 , 0x67 , 0x69 , 0x6e , 0x44 , 0x6f , 0x77 , 0x6e , 0x6c , 0x6f , 0x61 , 0x64 , 0x55 , 0x52 , 0x4c , 0x18 ,
0x18 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x11 , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x44 , 0x6f , 0x77 ,
0x6e , 0x6c , 0x6f , 0x61 , 0x64 , 0x55 , 0x52 , 0x4c , 0x12 , 0x61 , 0x0a , 0x0f , 0x70 , 0x6c , 0x75 , 0x67 ,
0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x18 , 0x1e , 0x20 , 0x03 , 0x28 ,
0x0b , 0x32 , 0x37 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 ,
0x67 , 0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 , 0x65 ,
0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x2e , 0x50 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 ,
0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x45 , 0x6e , 0x74 , 0x72 , 0x79 , 0x52 , 0x0f , 0x70 , 0x6c , 0x75 , 0x67 ,
0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x12 , 0x26 , 0x0a , 0x0e , 0x72 ,
0x65 , 0x74 , 0x61 , 0x69 , 0x6e , 0x4f , 0x6e , 0x44 , 0x65 , 0x6c , 0x65 , 0x74 , 0x65 , 0x18 , 0x19 , 0x20 ,
0x01 , 0x28 , 0x08 , 0x52 , 0x0e , 0x72 , 0x65 , 0x74 , 0x61 , 0x69 , 0x6e , 0x4f , 0x6e , 0x44 , 0x65 , 0x6c ,
0x65 , 0x74 , 0x65 , 0x12 , 0x2a , 0x0a , 0x07 , 0x61 , 0x6c , 0x69 , 0x61 , 0x73 , 0x65 , 0x73 , 0x18 , 0x1a ,
0x20 , 0x03 , 0x28 , 0x0b , 0x32 , 0x10 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 ,
0x2e , 0x41 , 0x6c , 0x69 , 0x61 , 0x73 , 0x52 , 0x07 , 0x61 , 0x6c , 0x69 , 0x61 , 0x73 , 0x65 , 0x73 , 0x12 ,
0x20 , 0x0a , 0x0b , 0x64 , 0x65 , 0x6c , 0x65 , 0x74 , 0x65 , 0x64 , 0x57 , 0x69 , 0x74 , 0x68 , 0x18 , 0x1b ,
0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x0b , 0x64 , 0x65 , 0x6c , 0x65 , 0x74 , 0x65 , 0x64 , 0x57 , 0x69 , 0x74 ,
0x68 , 0x12 , 0x1e , 0x0a , 0x0a , 0x61 , 0x6c , 0x69 , 0x61 , 0x73 , 0x53 , 0x70 , 0x65 , 0x63 , 0x73 , 0x18 ,
0x1c , 0x20 , 0x01 , 0x28 , 0x08 , 0x52 , 0x0a , 0x61 , 0x6c , 0x69 , 0x61 , 0x73 , 0x53 , 0x70 , 0x65 , 0x63 ,
0x73 , 0x12 , 0x41 , 0x0a , 0x0e , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 , 0x6f , 0x73 , 0x69 , 0x74 ,
0x69 , 0x6f , 0x6e , 0x18 , 0x1d , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x19 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 ,
0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x53 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 , 0x6f , 0x73 , 0x69 ,
0x74 , 0x69 , 0x6f , 0x6e , 0x52 , 0x0e , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 , 0x6f , 0x73 , 0x69 ,
0x74 , 0x69 , 0x6f , 0x6e , 0x1a , 0x2a , 0x0a , 0x14 , 0x50 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 ,
0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x12 , 0x12 , 0x0a , 0x04 ,
0x75 , 0x72 , 0x6e , 0x73 , 0x18 , 0x01 , 0x20 , 0x03 , 0x28 , 0x09 , 0x52 , 0x04 , 0x75 , 0x72 , 0x6e , 0x73 ,
0x1a , 0x58 , 0x0a , 0x0e , 0x43 , 0x75 , 0x73 , 0x74 , 0x6f , 0x6d , 0x54 , 0x69 , 0x6d , 0x65 , 0x6f , 0x75 ,
0x74 , 0x73 , 0x12 , 0x16 , 0x0a , 0x06 , 0x63 , 0x72 , 0x65 , 0x61 , 0x74 , 0x65 , 0x18 , 0x01 , 0x20 , 0x01 ,
0x28 , 0x09 , 0x52 , 0x06 , 0x63 , 0x72 , 0x65 , 0x61 , 0x74 , 0x65 , 0x12 , 0x16 , 0x0a , 0x06 , 0x75 , 0x70 ,
0x64 , 0x61 , 0x74 , 0x65 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x06 , 0x75 , 0x70 , 0x64 , 0x61 ,
0x74 , 0x65 , 0x12 , 0x16 , 0x0a , 0x06 , 0x64 , 0x65 , 0x6c , 0x65 , 0x74 , 0x65 , 0x18 , 0x03 , 0x20 , 0x01 ,
0x28 , 0x09 , 0x52 , 0x06 , 0x64 , 0x65 , 0x6c , 0x65 , 0x74 , 0x65 , 0x1a , 0x80 , 0x01 , 0x0a , 0x19 , 0x50 ,
0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 ,
0x69 , 0x65 , 0x73 , 0x45 , 0x6e , 0x74 , 0x72 , 0x79 , 0x12 , 0x10 , 0x0a , 0x03 , 0x6b , 0x65 , 0x79 , 0x18 ,
0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x03 , 0x6b , 0x65 , 0x79 , 0x12 , 0x4d , 0x0a , 0x05 , 0x76 , 0x61 ,
0x6c , 0x75 , 0x65 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x37 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 ,
0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x67 , 0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 ,
0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x2e , 0x50 , 0x72 ,
0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 ,
0x65 , 0x73 , 0x52 , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x3a , 0x02 , 0x38 , 0x01 , 0x1a , 0x3c , 0x0a ,
0x0e , 0x50 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 , 0x73 , 0x45 , 0x6e , 0x74 , 0x72 , 0x79 , 0x12 ,
0x10 , 0x0a , 0x03 , 0x6b , 0x65 , 0x79 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x03 , 0x6b , 0x65 ,
0x79 , 0x12 , 0x14 , 0x0a , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x09 ,
0x52 , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x3a , 0x02 , 0x38 , 0x01 , 0x1a , 0x42 , 0x0a , 0x14 , 0x50 ,
0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x45 , 0x6e ,
0x74 , 0x72 , 0x79 , 0x12 , 0x10 , 0x0a , 0x03 , 0x6b , 0x65 , 0x79 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 ,
0x52 , 0x03 , 0x6b , 0x65 , 0x79 , 0x12 , 0x14 , 0x0a , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x18 , 0x02 ,
0x20 , 0x01 , 0x28 , 0x0c , 0x52 , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x3a , 0x02 , 0x38 , 0x01 , 0x22 ,
0xc2 , 0x03 , 0x0a , 0x18 , 0x52 , 0x65 , 0x67 , 0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f ,
0x75 , 0x72 , 0x63 , 0x65 , 0x52 , 0x65 , 0x73 , 0x70 , 0x6f , 0x6e , 0x73 , 0x65 , 0x12 , 0x10 , 0x0a , 0x03 ,
0x75 , 0x72 , 0x6e , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x03 , 0x75 , 0x72 , 0x6e , 0x12 , 0x0e ,
0x0a , 0x02 , 0x69 , 0x64 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x02 , 0x69 , 0x64 , 0x12 , 0x2f ,
0x0a , 0x06 , 0x6f , 0x62 , 0x6a , 0x65 , 0x63 , 0x74 , 0x18 , 0x03 , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x17 ,
[engine] Add support for source positions
These changes add support for passing source position information in
gRPC metadata and recording the source position that corresponds to a
resource registration in the statefile.
Enabling source position information in the resource model can provide
substantial benefits, including but not limited to:
- Better errors from the Pulumi CLI
- Go-to-defintion for resources in state
- Editor integration for errors, etc. from `pulumi preview`
Source positions are (file, line) or (file, line, column) tuples
represented as URIs. The line and column are stored in the fragment
portion of the URI as "line(,column)?". The scheme of the URI and the
form of its path component depends on the context in which it is
generated or used:
- During an active update, the URI's scheme is `file` and paths are
absolute filesystem paths. This allows consumers to easily access
arbitrary files that are available on the host.
- In a statefile, the URI's scheme is `project` and paths are relative
to the project root. This allows consumers to resolve source positions
relative to the project file in different contexts irrespective of the
location of the project itself (e.g. given a project-relative path and
the URL of the project's root on GitHub, one can build a GitHub URL for
the source position).
During an update, source position information may be attached to gRPC
calls as "source-position" metadata. This allows arbitrary calls to be
associated with source positions without changes to their protobuf
payloads. Modifying the protobuf payloads is also a viable approach, but
is somewhat more invasive than attaching metadata, and requires changes
to every call signature.
Source positions should reflect the position in user code that initiated
a resource model operation (e.g. the source position passed with
`RegisterResource` for `pet` in the example above should be the source
position in `index.ts`, _not_ the source position in the Pulumi SDK). In
general, the Pulumi SDK should be able to infer the source position of
the resource registration, as the relationship between a resource
registration and its corresponding user code should be static per SDK.
Source positions in state files will be stored as a new `registeredAt`
property on each resource. This property is optional.
2023-06-29 18:41:19 +00:00
0x2e , 0x67 , 0x6f , 0x6f , 0x67 , 0x6c , 0x65 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x62 , 0x75 , 0x66 ,
0x2e , 0x53 , 0x74 , 0x72 , 0x75 , 0x63 , 0x74 , 0x52 , 0x06 , 0x6f , 0x62 , 0x6a , 0x65 , 0x63 , 0x74 , 0x12 ,
2023-09-11 15:54:07 +00:00
0x16 , 0x0a , 0x06 , 0x73 , 0x74 , 0x61 , 0x62 , 0x6c , 0x65 , 0x18 , 0x04 , 0x20 , 0x01 , 0x28 , 0x08 , 0x52 ,
0x06 , 0x73 , 0x74 , 0x61 , 0x62 , 0x6c , 0x65 , 0x12 , 0x18 , 0x0a , 0x07 , 0x73 , 0x74 , 0x61 , 0x62 , 0x6c ,
0x65 , 0x73 , 0x18 , 0x05 , 0x20 , 0x03 , 0x28 , 0x09 , 0x52 , 0x07 , 0x73 , 0x74 , 0x61 , 0x62 , 0x6c , 0x65 ,
0x73 , 0x12 , 0x71 , 0x0a , 0x14 , 0x70 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 , 0x44 , 0x65 , 0x70 ,
0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x18 , 0x06 , 0x20 , 0x03 , 0x28 , 0x0b , 0x32 ,
0x3d , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x67 , 0x69 ,
0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 , 0x65 , 0x73 , 0x70 ,
0x6f , 0x6e , 0x73 , 0x65 , 0x2e , 0x50 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 , 0x44 , 0x65 , 0x70 ,
0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x45 , 0x6e , 0x74 , 0x72 , 0x79 , 0x52 , 0x14 ,
0x70 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e ,
0x63 , 0x69 , 0x65 , 0x73 , 0x1a , 0x2a , 0x0a , 0x14 , 0x50 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 ,
0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x12 , 0x12 , 0x0a , 0x04 ,
0x75 , 0x72 , 0x6e , 0x73 , 0x18 , 0x01 , 0x20 , 0x03 , 0x28 , 0x09 , 0x52 , 0x04 , 0x75 , 0x72 , 0x6e , 0x73 ,
0x1a , 0x81 , 0x01 , 0x0a , 0x19 , 0x50 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 , 0x44 , 0x65 , 0x70 ,
0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x45 , 0x6e , 0x74 , 0x72 , 0x79 , 0x12 , 0x10 ,
0x0a , 0x03 , 0x6b , 0x65 , 0x79 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x03 , 0x6b , 0x65 , 0x79 ,
0x12 , 0x4e , 0x0a , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 ,
0x38 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x67 , 0x69 ,
0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 , 0x65 , 0x73 , 0x70 ,
0x6f , 0x6e , 0x73 , 0x65 , 0x2e , 0x50 , 0x72 , 0x6f , 0x70 , 0x65 , 0x72 , 0x74 , 0x79 , 0x44 , 0x65 , 0x70 ,
0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x52 , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 ,
0x3a , 0x02 , 0x38 , 0x01 , 0x22 , 0x65 , 0x0a , 0x1e , 0x52 , 0x65 , 0x67 , 0x69 , 0x73 , 0x74 , 0x65 , 0x72 ,
0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x4f , 0x75 , 0x74 , 0x70 , 0x75 , 0x74 , 0x73 , 0x52 ,
0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x12 , 0x10 , 0x0a , 0x03 , 0x75 , 0x72 , 0x6e , 0x18 , 0x01 , 0x20 ,
0x01 , 0x28 , 0x09 , 0x52 , 0x03 , 0x75 , 0x72 , 0x6e , 0x12 , 0x31 , 0x0a , 0x07 , 0x6f , 0x75 , 0x74 , 0x70 ,
0x75 , 0x74 , 0x73 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x17 , 0x2e , 0x67 , 0x6f , 0x6f , 0x67 ,
0x6c , 0x65 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x62 , 0x75 , 0x66 , 0x2e , 0x53 , 0x74 , 0x72 , 0x75 ,
0x63 , 0x74 , 0x52 , 0x07 , 0x6f , 0x75 , 0x74 , 0x70 , 0x75 , 0x74 , 0x73 , 0x22 , 0xcc , 0x03 , 0x0a , 0x15 ,
0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x49 , 0x6e , 0x76 , 0x6f , 0x6b , 0x65 , 0x52 , 0x65 ,
0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x12 , 0x10 , 0x0a , 0x03 , 0x74 , 0x6f , 0x6b , 0x18 , 0x01 , 0x20 , 0x01 ,
0x28 , 0x09 , 0x52 , 0x03 , 0x74 , 0x6f , 0x6b , 0x12 , 0x2b , 0x0a , 0x04 , 0x61 , 0x72 , 0x67 , 0x73 , 0x18 ,
0x02 , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x17 , 0x2e , 0x67 , 0x6f , 0x6f , 0x67 , 0x6c , 0x65 , 0x2e , 0x70 ,
0x72 , 0x6f , 0x74 , 0x6f , 0x62 , 0x75 , 0x66 , 0x2e , 0x53 , 0x74 , 0x72 , 0x75 , 0x63 , 0x74 , 0x52 , 0x04 ,
0x61 , 0x72 , 0x67 , 0x73 , 0x12 , 0x1a , 0x0a , 0x08 , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 ,
0x18 , 0x03 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x08 , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 ,
0x12 , 0x18 , 0x0a , 0x07 , 0x76 , 0x65 , 0x72 , 0x73 , 0x69 , 0x6f , 0x6e , 0x18 , 0x04 , 0x20 , 0x01 , 0x28 ,
0x09 , 0x52 , 0x07 , 0x76 , 0x65 , 0x72 , 0x73 , 0x69 , 0x6f , 0x6e , 0x12 , 0x28 , 0x0a , 0x0f , 0x61 , 0x63 ,
0x63 , 0x65 , 0x70 , 0x74 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x73 , 0x18 , 0x05 , 0x20 ,
0x01 , 0x28 , 0x08 , 0x52 , 0x0f , 0x61 , 0x63 , 0x63 , 0x65 , 0x70 , 0x74 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 ,
0x72 , 0x63 , 0x65 , 0x73 , 0x12 , 0x2c , 0x0a , 0x11 , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x44 , 0x6f ,
0x77 , 0x6e , 0x6c , 0x6f , 0x61 , 0x64 , 0x55 , 0x52 , 0x4c , 0x18 , 0x06 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 ,
0x11 , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x44 , 0x6f , 0x77 , 0x6e , 0x6c , 0x6f , 0x61 , 0x64 , 0x55 ,
0x52 , 0x4c , 0x12 , 0x5f , 0x0a , 0x0f , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 ,
0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x18 , 0x08 , 0x20 , 0x03 , 0x28 , 0x0b , 0x32 , 0x35 , 0x2e , 0x70 , 0x75 ,
0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 ,
0x49 , 0x6e , 0x76 , 0x6f , 0x6b , 0x65 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x2e , 0x50 , 0x6c ,
0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x45 , 0x6e , 0x74 ,
0x72 , 0x79 , 0x52 , 0x0f , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 ,
0x75 , 0x6d , 0x73 , 0x12 , 0x41 , 0x0a , 0x0e , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 , 0x6f , 0x73 ,
0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x18 , 0x07 , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x19 , 0x2e , 0x70 , 0x75 ,
0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x53 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 , 0x6f ,
0x73 , 0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x52 , 0x0e , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 , 0x6f ,
0x73 , 0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x1a , 0x42 , 0x0a , 0x14 , 0x50 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e ,
0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x45 , 0x6e , 0x74 , 0x72 , 0x79 , 0x12 , 0x10 ,
0x0a , 0x03 , 0x6b , 0x65 , 0x79 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x03 , 0x6b , 0x65 , 0x79 ,
0x12 , 0x14 , 0x0a , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x0c , 0x52 ,
2024-02-08 13:16:23 +00:00
0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x3a , 0x02 , 0x38 , 0x01 , 0x22 , 0xad , 0x06 , 0x0a , 0x13 , 0x52 ,
0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x43 , 0x61 , 0x6c , 0x6c , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 ,
0x73 , 0x74 , 0x12 , 0x10 , 0x0a , 0x03 , 0x74 , 0x6f , 0x6b , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 ,
0x03 , 0x74 , 0x6f , 0x6b , 0x12 , 0x2b , 0x0a , 0x04 , 0x61 , 0x72 , 0x67 , 0x73 , 0x18 , 0x02 , 0x20 , 0x01 ,
0x28 , 0x0b , 0x32 , 0x17 , 0x2e , 0x67 , 0x6f , 0x6f , 0x67 , 0x6c , 0x65 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 ,
0x6f , 0x62 , 0x75 , 0x66 , 0x2e , 0x53 , 0x74 , 0x72 , 0x75 , 0x63 , 0x74 , 0x52 , 0x04 , 0x61 , 0x72 , 0x67 ,
0x73 , 0x12 , 0x5d , 0x0a , 0x0f , 0x61 , 0x72 , 0x67 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e ,
0x63 , 0x69 , 0x65 , 0x73 , 0x18 , 0x03 , 0x20 , 0x03 , 0x28 , 0x0b , 0x32 , 0x33 , 0x2e , 0x70 , 0x75 , 0x6c ,
0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x43 ,
0x61 , 0x6c , 0x6c , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x2e , 0x41 , 0x72 , 0x67 , 0x44 , 0x65 ,
0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x45 , 0x6e , 0x74 , 0x72 , 0x79 , 0x52 ,
0x0f , 0x61 , 0x72 , 0x67 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 ,
0x12 , 0x1a , 0x0a , 0x08 , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 , 0x18 , 0x04 , 0x20 , 0x01 ,
0x28 , 0x09 , 0x52 , 0x08 , 0x70 , 0x72 , 0x6f , 0x76 , 0x69 , 0x64 , 0x65 , 0x72 , 0x12 , 0x18 , 0x0a , 0x07 ,
0x76 , 0x65 , 0x72 , 0x73 , 0x69 , 0x6f , 0x6e , 0x18 , 0x05 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x07 , 0x76 ,
0x65 , 0x72 , 0x73 , 0x69 , 0x6f , 0x6e , 0x12 , 0x2c , 0x0a , 0x11 , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e ,
0x44 , 0x6f , 0x77 , 0x6e , 0x6c , 0x6f , 0x61 , 0x64 , 0x55 , 0x52 , 0x4c , 0x18 , 0x0d , 0x20 , 0x01 , 0x28 ,
0x09 , 0x52 , 0x11 , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x44 , 0x6f , 0x77 , 0x6e , 0x6c , 0x6f , 0x61 ,
0x64 , 0x55 , 0x52 , 0x4c , 0x12 , 0x5d , 0x0a , 0x0f , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 ,
0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x18 , 0x10 , 0x20 , 0x03 , 0x28 , 0x0b , 0x32 , 0x33 , 0x2e ,
0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 ,
0x63 , 0x65 , 0x43 , 0x61 , 0x6c , 0x6c , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x2e , 0x50 , 0x6c ,
0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x45 , 0x6e , 0x74 ,
0x72 , 0x79 , 0x52 , 0x0f , 0x70 , 0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 ,
0x75 , 0x6d , 0x73 , 0x12 , 0x41 , 0x0a , 0x0e , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 , 0x6f , 0x73 ,
0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x18 , 0x0f , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x19 , 0x2e , 0x70 , 0x75 ,
0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x53 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 , 0x6f ,
0x73 , 0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x52 , 0x0e , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x50 , 0x6f ,
0x73 , 0x69 , 0x74 , 0x69 , 0x6f , 0x6e , 0x1a , 0x2a , 0x0a , 0x14 , 0x41 , 0x72 , 0x67 , 0x75 , 0x6d , 0x65 ,
0x6e , 0x74 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x12 , 0x12 ,
0x0a , 0x04 , 0x75 , 0x72 , 0x6e , 0x73 , 0x18 , 0x01 , 0x20 , 0x03 , 0x28 , 0x09 , 0x52 , 0x04 , 0x75 , 0x72 ,
0x6e , 0x73 , 0x1a , 0x77 , 0x0a , 0x14 , 0x41 , 0x72 , 0x67 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 ,
0x6e , 0x63 , 0x69 , 0x65 , 0x73 , 0x45 , 0x6e , 0x74 , 0x72 , 0x79 , 0x12 , 0x10 , 0x0a , 0x03 , 0x6b , 0x65 ,
0x79 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 , 0x52 , 0x03 , 0x6b , 0x65 , 0x79 , 0x12 , 0x49 , 0x0a , 0x05 ,
0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x18 , 0x02 , 0x20 , 0x01 , 0x28 , 0x0b , 0x32 , 0x33 , 0x2e , 0x70 , 0x75 ,
0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 ,
0x43 , 0x61 , 0x6c , 0x6c , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x2e , 0x41 , 0x72 , 0x67 , 0x75 ,
0x6d , 0x65 , 0x6e , 0x74 , 0x44 , 0x65 , 0x70 , 0x65 , 0x6e , 0x64 , 0x65 , 0x6e , 0x63 , 0x69 , 0x65 , 0x73 ,
0x52 , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x3a , 0x02 , 0x38 , 0x01 , 0x1a , 0x42 , 0x0a , 0x14 , 0x50 ,
0x6c , 0x75 , 0x67 , 0x69 , 0x6e , 0x43 , 0x68 , 0x65 , 0x63 , 0x6b , 0x73 , 0x75 , 0x6d , 0x73 , 0x45 , 0x6e ,
0x74 , 0x72 , 0x79 , 0x12 , 0x10 , 0x0a , 0x03 , 0x6b , 0x65 , 0x79 , 0x18 , 0x01 , 0x20 , 0x01 , 0x28 , 0x09 ,
0x52 , 0x03 , 0x6b , 0x65 , 0x79 , 0x12 , 0x14 , 0x0a , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x18 , 0x02 ,
0x20 , 0x01 , 0x28 , 0x0c , 0x52 , 0x05 , 0x76 , 0x61 , 0x6c , 0x75 , 0x65 , 0x3a , 0x02 , 0x38 , 0x01 , 0x4a ,
0x04 , 0x08 , 0x06 , 0x10 , 0x07 , 0x4a , 0x04 , 0x08 , 0x07 , 0x10 , 0x08 , 0x4a , 0x04 , 0x08 , 0x08 , 0x10 ,
0x09 , 0x4a , 0x04 , 0x08 , 0x09 , 0x10 , 0x0a , 0x4a , 0x04 , 0x08 , 0x0a , 0x10 , 0x0b , 0x4a , 0x04 , 0x08 ,
0x0b , 0x10 , 0x0c , 0x4a , 0x04 , 0x08 , 0x0c , 0x10 , 0x0d , 0x4a , 0x04 , 0x08 , 0x0e , 0x10 , 0x0f , 0x52 ,
0x07 , 0x70 , 0x72 , 0x6f , 0x6a , 0x65 , 0x63 , 0x74 , 0x52 , 0x05 , 0x73 , 0x74 , 0x61 , 0x63 , 0x6b , 0x52 ,
0x06 , 0x63 , 0x6f , 0x6e , 0x66 , 0x69 , 0x67 , 0x52 , 0x10 , 0x63 , 0x6f , 0x6e , 0x66 , 0x69 , 0x67 , 0x53 ,
0x65 , 0x63 , 0x72 , 0x65 , 0x74 , 0x4b , 0x65 , 0x79 , 0x73 , 0x52 , 0x06 , 0x64 , 0x72 , 0x79 , 0x52 , 0x75 ,
0x6e , 0x52 , 0x08 , 0x70 , 0x61 , 0x72 , 0x61 , 0x6c , 0x6c , 0x65 , 0x6c , 0x52 , 0x0f , 0x6d , 0x6f , 0x6e ,
0x69 , 0x74 , 0x6f , 0x72 , 0x45 , 0x6e , 0x64 , 0x70 , 0x6f , 0x69 , 0x6e , 0x74 , 0x52 , 0x0c , 0x6f , 0x72 ,
0x67 , 0x61 , 0x6e , 0x69 , 0x7a , 0x61 , 0x74 , 0x69 , 0x6f , 0x6e , 0x32 , 0xdc , 0x04 , 0x0a , 0x0f , 0x52 ,
2023-09-11 15:54:07 +00:00
0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x4d , 0x6f , 0x6e , 0x69 , 0x74 , 0x6f , 0x72 , 0x12 , 0x5a ,
0x0a , 0x0f , 0x53 , 0x75 , 0x70 , 0x70 , 0x6f , 0x72 , 0x74 , 0x73 , 0x46 , 0x65 , 0x61 , 0x74 , 0x75 , 0x72 ,
0x65 , 0x12 , 0x21 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x53 , 0x75 ,
0x70 , 0x70 , 0x6f , 0x72 , 0x74 , 0x73 , 0x46 , 0x65 , 0x61 , 0x74 , 0x75 , 0x72 , 0x65 , 0x52 , 0x65 , 0x71 ,
0x75 , 0x65 , 0x73 , 0x74 , 0x1a , 0x22 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 ,
0x2e , 0x53 , 0x75 , 0x70 , 0x70 , 0x6f , 0x72 , 0x74 , 0x73 , 0x46 , 0x65 , 0x61 , 0x74 , 0x75 , 0x72 , 0x65 ,
0x52 , 0x65 , 0x73 , 0x70 , 0x6f , 0x6e , 0x73 , 0x65 , 0x22 , 0x00 , 0x12 , 0x47 , 0x0a , 0x06 , 0x49 , 0x6e ,
[engine] Add support for source positions
These changes add support for passing source position information in
gRPC metadata and recording the source position that corresponds to a
resource registration in the statefile.
Enabling source position information in the resource model can provide
substantial benefits, including but not limited to:
- Better errors from the Pulumi CLI
- Go-to-defintion for resources in state
- Editor integration for errors, etc. from `pulumi preview`
Source positions are (file, line) or (file, line, column) tuples
represented as URIs. The line and column are stored in the fragment
portion of the URI as "line(,column)?". The scheme of the URI and the
form of its path component depends on the context in which it is
generated or used:
- During an active update, the URI's scheme is `file` and paths are
absolute filesystem paths. This allows consumers to easily access
arbitrary files that are available on the host.
- In a statefile, the URI's scheme is `project` and paths are relative
to the project root. This allows consumers to resolve source positions
relative to the project file in different contexts irrespective of the
location of the project itself (e.g. given a project-relative path and
the URL of the project's root on GitHub, one can build a GitHub URL for
the source position).
During an update, source position information may be attached to gRPC
calls as "source-position" metadata. This allows arbitrary calls to be
associated with source positions without changes to their protobuf
payloads. Modifying the protobuf payloads is also a viable approach, but
is somewhat more invasive than attaching metadata, and requires changes
to every call signature.
Source positions should reflect the position in user code that initiated
a resource model operation (e.g. the source position passed with
`RegisterResource` for `pet` in the example above should be the source
position in `index.ts`, _not_ the source position in the Pulumi SDK). In
general, the Pulumi SDK should be able to infer the source position of
the resource registration, as the relationship between a resource
registration and its corresponding user code should be static per SDK.
Source positions in state files will be stored as a new `registeredAt`
property on each resource. This property is optional.
2023-06-29 18:41:19 +00:00
0x76 , 0x6f , 0x6b , 0x65 , 0x12 , 0x20 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 ,
0x2e , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x49 , 0x6e , 0x76 , 0x6f , 0x6b , 0x65 , 0x52 ,
0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x1a , 0x19 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 ,
0x70 , 0x63 , 0x2e , 0x49 , 0x6e , 0x76 , 0x6f , 0x6b , 0x65 , 0x52 , 0x65 , 0x73 , 0x70 , 0x6f , 0x6e , 0x73 ,
2023-09-11 15:54:07 +00:00
0x65 , 0x22 , 0x00 , 0x12 , 0x4f , 0x0a , 0x0c , 0x53 , 0x74 , 0x72 , 0x65 , 0x61 , 0x6d , 0x49 , 0x6e , 0x76 ,
0x6f , 0x6b , 0x65 , 0x12 , 0x20 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e ,
0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x49 , 0x6e , 0x76 , 0x6f , 0x6b , 0x65 , 0x52 , 0x65 ,
0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x1a , 0x19 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 ,
0x63 , 0x2e , 0x49 , 0x6e , 0x76 , 0x6f , 0x6b , 0x65 , 0x52 , 0x65 , 0x73 , 0x70 , 0x6f , 0x6e , 0x73 , 0x65 ,
2024-02-08 13:16:23 +00:00
0x22 , 0x00 , 0x30 , 0x01 , 0x12 , 0x41 , 0x0a , 0x04 , 0x43 , 0x61 , 0x6c , 0x6c , 0x12 , 0x1e , 0x2e , 0x70 ,
0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 ,
0x65 , 0x43 , 0x61 , 0x6c , 0x6c , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x1a , 0x17 , 0x2e , 0x70 ,
0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x43 , 0x61 , 0x6c , 0x6c , 0x52 , 0x65 , 0x73 ,
0x70 , 0x6f , 0x6e , 0x73 , 0x65 , 0x22 , 0x00 , 0x12 , 0x51 , 0x0a , 0x0c , 0x52 , 0x65 , 0x61 , 0x64 , 0x52 ,
0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x12 , 0x1e , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 ,
0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x61 , 0x64 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 ,
0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x1a , 0x1f , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 ,
0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x61 , 0x64 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 ,
0x52 , 0x65 , 0x73 , 0x70 , 0x6f , 0x6e , 0x73 , 0x65 , 0x22 , 0x00 , 0x12 , 0x5d , 0x0a , 0x10 , 0x52 , 0x65 ,
0x67 , 0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x12 , 0x22 ,
0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 , 0x65 , 0x67 , 0x69 , 0x73 ,
0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 ,
0x73 , 0x74 , 0x1a , 0x23 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x2e , 0x52 ,
0x65 , 0x67 , 0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x52 ,
0x65 , 0x73 , 0x70 , 0x6f , 0x6e , 0x73 , 0x65 , 0x22 , 0x00 , 0x12 , 0x5e , 0x0a , 0x17 , 0x52 , 0x65 , 0x67 ,
0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 , 0x65 , 0x4f , 0x75 , 0x74 ,
0x70 , 0x75 , 0x74 , 0x73 , 0x12 , 0x29 , 0x2e , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 ,
0x2e , 0x52 , 0x65 , 0x67 , 0x69 , 0x73 , 0x74 , 0x65 , 0x72 , 0x52 , 0x65 , 0x73 , 0x6f , 0x75 , 0x72 , 0x63 ,
0x65 , 0x4f , 0x75 , 0x74 , 0x70 , 0x75 , 0x74 , 0x73 , 0x52 , 0x65 , 0x71 , 0x75 , 0x65 , 0x73 , 0x74 , 0x1a ,
0x16 , 0x2e , 0x67 , 0x6f , 0x6f , 0x67 , 0x6c , 0x65 , 0x2e , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x62 , 0x75 ,
0x66 , 0x2e , 0x45 , 0x6d , 0x70 , 0x74 , 0x79 , 0x22 , 0x00 , 0x42 , 0x34 , 0x5a , 0x32 , 0x67 , 0x69 , 0x74 ,
0x68 , 0x75 , 0x62 , 0x2e , 0x63 , 0x6f , 0x6d , 0x2f , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x2f , 0x70 ,
0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x2f , 0x73 , 0x64 , 0x6b , 0x2f , 0x76 , 0x33 , 0x2f , 0x70 , 0x72 , 0x6f ,
0x74 , 0x6f , 0x2f , 0x67 , 0x6f , 0x3b , 0x70 , 0x75 , 0x6c , 0x75 , 0x6d , 0x69 , 0x72 , 0x70 , 0x63 , 0x62 ,
0x06 , 0x70 , 0x72 , 0x6f , 0x74 , 0x6f , 0x33 ,
2022-06-11 07:52:24 +00:00
}
var (
2022-07-12 13:45:03 +00:00
file_pulumi_resource_proto_rawDescOnce sync . Once
file_pulumi_resource_proto_rawDescData = file_pulumi_resource_proto_rawDesc
2022-06-11 07:52:24 +00:00
)
2022-07-12 13:45:03 +00:00
func file_pulumi_resource_proto_rawDescGZIP ( ) [ ] byte {
file_pulumi_resource_proto_rawDescOnce . Do ( func ( ) {
file_pulumi_resource_proto_rawDescData = protoimpl . X . CompressGZIP ( file_pulumi_resource_proto_rawDescData )
2022-06-11 07:52:24 +00:00
} )
2022-07-12 13:45:03 +00:00
return file_pulumi_resource_proto_rawDescData
2022-06-11 07:52:24 +00:00
}
2024-02-08 13:16:23 +00:00
var file_pulumi_resource_proto_msgTypes = make ( [ ] protoimpl . MessageInfo , 21 )
2023-03-04 22:11:52 +00:00
var file_pulumi_resource_proto_goTypes = [ ] interface { } {
( * SupportsFeatureRequest ) ( nil ) , // 0: pulumirpc.SupportsFeatureRequest
( * SupportsFeatureResponse ) ( nil ) , // 1: pulumirpc.SupportsFeatureResponse
( * ReadResourceRequest ) ( nil ) , // 2: pulumirpc.ReadResourceRequest
( * ReadResourceResponse ) ( nil ) , // 3: pulumirpc.ReadResourceResponse
( * RegisterResourceRequest ) ( nil ) , // 4: pulumirpc.RegisterResourceRequest
( * RegisterResourceResponse ) ( nil ) , // 5: pulumirpc.RegisterResourceResponse
( * RegisterResourceOutputsRequest ) ( nil ) , // 6: pulumirpc.RegisterResourceOutputsRequest
( * ResourceInvokeRequest ) ( nil ) , // 7: pulumirpc.ResourceInvokeRequest
2024-02-08 13:16:23 +00:00
( * ResourceCallRequest ) ( nil ) , // 8: pulumirpc.ResourceCallRequest
nil , // 9: pulumirpc.ReadResourceRequest.PluginChecksumsEntry
( * RegisterResourceRequest_PropertyDependencies ) ( nil ) , // 10: pulumirpc.RegisterResourceRequest.PropertyDependencies
( * RegisterResourceRequest_CustomTimeouts ) ( nil ) , // 11: pulumirpc.RegisterResourceRequest.CustomTimeouts
nil , // 12: pulumirpc.RegisterResourceRequest.PropertyDependenciesEntry
nil , // 13: pulumirpc.RegisterResourceRequest.ProvidersEntry
nil , // 14: pulumirpc.RegisterResourceRequest.PluginChecksumsEntry
( * RegisterResourceResponse_PropertyDependencies ) ( nil ) , // 15: pulumirpc.RegisterResourceResponse.PropertyDependencies
nil , // 16: pulumirpc.RegisterResourceResponse.PropertyDependenciesEntry
nil , // 17: pulumirpc.ResourceInvokeRequest.PluginChecksumsEntry
( * ResourceCallRequest_ArgumentDependencies ) ( nil ) , // 18: pulumirpc.ResourceCallRequest.ArgumentDependencies
nil , // 19: pulumirpc.ResourceCallRequest.ArgDependenciesEntry
nil , // 20: pulumirpc.ResourceCallRequest.PluginChecksumsEntry
( * structpb . Struct ) ( nil ) , // 21: google.protobuf.Struct
( * SourcePosition ) ( nil ) , // 22: pulumirpc.SourcePosition
( * Alias ) ( nil ) , // 23: pulumirpc.Alias
( * InvokeResponse ) ( nil ) , // 24: pulumirpc.InvokeResponse
( * CallResponse ) ( nil ) , // 25: pulumirpc.CallResponse
( * emptypb . Empty ) ( nil ) , // 26: google.protobuf.Empty
2023-03-04 22:11:52 +00:00
}
2022-07-12 13:45:03 +00:00
var file_pulumi_resource_proto_depIdxs = [ ] int32 {
2024-02-08 13:16:23 +00:00
21 , // 0: pulumirpc.ReadResourceRequest.properties:type_name -> google.protobuf.Struct
9 , // 1: pulumirpc.ReadResourceRequest.pluginChecksums:type_name -> pulumirpc.ReadResourceRequest.PluginChecksumsEntry
22 , // 2: pulumirpc.ReadResourceRequest.sourcePosition:type_name -> pulumirpc.SourcePosition
21 , // 3: pulumirpc.ReadResourceResponse.properties:type_name -> google.protobuf.Struct
21 , // 4: pulumirpc.RegisterResourceRequest.object:type_name -> google.protobuf.Struct
12 , // 5: pulumirpc.RegisterResourceRequest.propertyDependencies:type_name -> pulumirpc.RegisterResourceRequest.PropertyDependenciesEntry
11 , // 6: pulumirpc.RegisterResourceRequest.customTimeouts:type_name -> pulumirpc.RegisterResourceRequest.CustomTimeouts
13 , // 7: pulumirpc.RegisterResourceRequest.providers:type_name -> pulumirpc.RegisterResourceRequest.ProvidersEntry
14 , // 8: pulumirpc.RegisterResourceRequest.pluginChecksums:type_name -> pulumirpc.RegisterResourceRequest.PluginChecksumsEntry
23 , // 9: pulumirpc.RegisterResourceRequest.aliases:type_name -> pulumirpc.Alias
22 , // 10: pulumirpc.RegisterResourceRequest.sourcePosition:type_name -> pulumirpc.SourcePosition
21 , // 11: pulumirpc.RegisterResourceResponse.object:type_name -> google.protobuf.Struct
16 , // 12: pulumirpc.RegisterResourceResponse.propertyDependencies:type_name -> pulumirpc.RegisterResourceResponse.PropertyDependenciesEntry
21 , // 13: pulumirpc.RegisterResourceOutputsRequest.outputs:type_name -> google.protobuf.Struct
21 , // 14: pulumirpc.ResourceInvokeRequest.args:type_name -> google.protobuf.Struct
17 , // 15: pulumirpc.ResourceInvokeRequest.pluginChecksums:type_name -> pulumirpc.ResourceInvokeRequest.PluginChecksumsEntry
22 , // 16: pulumirpc.ResourceInvokeRequest.sourcePosition:type_name -> pulumirpc.SourcePosition
21 , // 17: pulumirpc.ResourceCallRequest.args:type_name -> google.protobuf.Struct
19 , // 18: pulumirpc.ResourceCallRequest.argDependencies:type_name -> pulumirpc.ResourceCallRequest.ArgDependenciesEntry
20 , // 19: pulumirpc.ResourceCallRequest.pluginChecksums:type_name -> pulumirpc.ResourceCallRequest.PluginChecksumsEntry
22 , // 20: pulumirpc.ResourceCallRequest.sourcePosition:type_name -> pulumirpc.SourcePosition
10 , // 21: pulumirpc.RegisterResourceRequest.PropertyDependenciesEntry.value:type_name -> pulumirpc.RegisterResourceRequest.PropertyDependencies
15 , // 22: pulumirpc.RegisterResourceResponse.PropertyDependenciesEntry.value:type_name -> pulumirpc.RegisterResourceResponse.PropertyDependencies
18 , // 23: pulumirpc.ResourceCallRequest.ArgDependenciesEntry.value:type_name -> pulumirpc.ResourceCallRequest.ArgumentDependencies
0 , // 24: pulumirpc.ResourceMonitor.SupportsFeature:input_type -> pulumirpc.SupportsFeatureRequest
7 , // 25: pulumirpc.ResourceMonitor.Invoke:input_type -> pulumirpc.ResourceInvokeRequest
7 , // 26: pulumirpc.ResourceMonitor.StreamInvoke:input_type -> pulumirpc.ResourceInvokeRequest
8 , // 27: pulumirpc.ResourceMonitor.Call:input_type -> pulumirpc.ResourceCallRequest
2 , // 28: pulumirpc.ResourceMonitor.ReadResource:input_type -> pulumirpc.ReadResourceRequest
4 , // 29: pulumirpc.ResourceMonitor.RegisterResource:input_type -> pulumirpc.RegisterResourceRequest
6 , // 30: pulumirpc.ResourceMonitor.RegisterResourceOutputs:input_type -> pulumirpc.RegisterResourceOutputsRequest
1 , // 31: pulumirpc.ResourceMonitor.SupportsFeature:output_type -> pulumirpc.SupportsFeatureResponse
24 , // 32: pulumirpc.ResourceMonitor.Invoke:output_type -> pulumirpc.InvokeResponse
24 , // 33: pulumirpc.ResourceMonitor.StreamInvoke:output_type -> pulumirpc.InvokeResponse
25 , // 34: pulumirpc.ResourceMonitor.Call:output_type -> pulumirpc.CallResponse
3 , // 35: pulumirpc.ResourceMonitor.ReadResource:output_type -> pulumirpc.ReadResourceResponse
5 , // 36: pulumirpc.ResourceMonitor.RegisterResource:output_type -> pulumirpc.RegisterResourceResponse
26 , // 37: pulumirpc.ResourceMonitor.RegisterResourceOutputs:output_type -> google.protobuf.Empty
31 , // [31:38] is the sub-list for method output_type
24 , // [24:31] is the sub-list for method input_type
24 , // [24:24] is the sub-list for extension type_name
24 , // [24:24] is the sub-list for extension extendee
0 , // [0:24] is the sub-list for field type_name
2022-06-11 07:52:24 +00:00
}
2022-07-12 13:45:03 +00:00
func init ( ) { file_pulumi_resource_proto_init ( ) }
func file_pulumi_resource_proto_init ( ) {
if File_pulumi_resource_proto != nil {
2022-06-11 07:52:24 +00:00
return
}
2022-07-12 13:45:03 +00:00
file_pulumi_provider_proto_init ( )
2022-09-22 17:13:55 +00:00
file_pulumi_alias_proto_init ( )
[engine] Add support for source positions
These changes add support for passing source position information in
gRPC metadata and recording the source position that corresponds to a
resource registration in the statefile.
Enabling source position information in the resource model can provide
substantial benefits, including but not limited to:
- Better errors from the Pulumi CLI
- Go-to-defintion for resources in state
- Editor integration for errors, etc. from `pulumi preview`
Source positions are (file, line) or (file, line, column) tuples
represented as URIs. The line and column are stored in the fragment
portion of the URI as "line(,column)?". The scheme of the URI and the
form of its path component depends on the context in which it is
generated or used:
- During an active update, the URI's scheme is `file` and paths are
absolute filesystem paths. This allows consumers to easily access
arbitrary files that are available on the host.
- In a statefile, the URI's scheme is `project` and paths are relative
to the project root. This allows consumers to resolve source positions
relative to the project file in different contexts irrespective of the
location of the project itself (e.g. given a project-relative path and
the URL of the project's root on GitHub, one can build a GitHub URL for
the source position).
During an update, source position information may be attached to gRPC
calls as "source-position" metadata. This allows arbitrary calls to be
associated with source positions without changes to their protobuf
payloads. Modifying the protobuf payloads is also a viable approach, but
is somewhat more invasive than attaching metadata, and requires changes
to every call signature.
Source positions should reflect the position in user code that initiated
a resource model operation (e.g. the source position passed with
`RegisterResource` for `pet` in the example above should be the source
position in `index.ts`, _not_ the source position in the Pulumi SDK). In
general, the Pulumi SDK should be able to infer the source position of
the resource registration, as the relationship between a resource
registration and its corresponding user code should be static per SDK.
Source positions in state files will be stored as a new `registeredAt`
property on each resource. This property is optional.
2023-06-29 18:41:19 +00:00
file_pulumi_source_proto_init ( )
2022-06-11 07:52:24 +00:00
if ! protoimpl . UnsafeEnabled {
2022-07-12 13:45:03 +00:00
file_pulumi_resource_proto_msgTypes [ 0 ] . Exporter = func ( v interface { } , i int ) interface { } {
2022-06-11 07:52:24 +00:00
switch v := v . ( * SupportsFeatureRequest ) ; i {
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2022-07-12 13:45:03 +00:00
file_pulumi_resource_proto_msgTypes [ 1 ] . Exporter = func ( v interface { } , i int ) interface { } {
2022-06-11 07:52:24 +00:00
switch v := v . ( * SupportsFeatureResponse ) ; i {
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2022-07-12 13:45:03 +00:00
file_pulumi_resource_proto_msgTypes [ 2 ] . Exporter = func ( v interface { } , i int ) interface { } {
2022-06-16 21:07:28 +00:00
switch v := v . ( * ReadResourceRequest ) ; i {
2022-06-11 07:52:24 +00:00
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2022-07-12 13:45:03 +00:00
file_pulumi_resource_proto_msgTypes [ 3 ] . Exporter = func ( v interface { } , i int ) interface { } {
2022-06-16 21:07:28 +00:00
switch v := v . ( * ReadResourceResponse ) ; i {
2022-06-11 07:52:24 +00:00
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2022-07-12 13:45:03 +00:00
file_pulumi_resource_proto_msgTypes [ 4 ] . Exporter = func ( v interface { } , i int ) interface { } {
2022-06-16 21:07:28 +00:00
switch v := v . ( * RegisterResourceRequest ) ; i {
2022-06-11 07:52:24 +00:00
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2022-07-12 13:45:03 +00:00
file_pulumi_resource_proto_msgTypes [ 5 ] . Exporter = func ( v interface { } , i int ) interface { } {
2022-06-16 21:07:28 +00:00
switch v := v . ( * RegisterResourceResponse ) ; i {
2022-06-11 07:52:24 +00:00
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2022-07-12 13:45:03 +00:00
file_pulumi_resource_proto_msgTypes [ 6 ] . Exporter = func ( v interface { } , i int ) interface { } {
2022-06-16 21:07:28 +00:00
switch v := v . ( * RegisterResourceOutputsRequest ) ; i {
2022-06-11 07:52:24 +00:00
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2022-07-12 13:45:03 +00:00
file_pulumi_resource_proto_msgTypes [ 7 ] . Exporter = func ( v interface { } , i int ) interface { } {
2022-06-16 21:07:28 +00:00
switch v := v . ( * ResourceInvokeRequest ) ; i {
2022-06-11 07:52:24 +00:00
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2024-02-08 13:16:23 +00:00
file_pulumi_resource_proto_msgTypes [ 8 ] . Exporter = func ( v interface { } , i int ) interface { } {
switch v := v . ( * ResourceCallRequest ) ; i {
2022-09-21 19:42:24 +00:00
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2023-09-11 15:54:07 +00:00
file_pulumi_resource_proto_msgTypes [ 10 ] . Exporter = func ( v interface { } , i int ) interface { } {
2024-02-08 13:16:23 +00:00
switch v := v . ( * RegisterResourceRequest_PropertyDependencies ) ; i {
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
file_pulumi_resource_proto_msgTypes [ 11 ] . Exporter = func ( v interface { } , i int ) interface { } {
2022-06-11 07:52:24 +00:00
switch v := v . ( * RegisterResourceRequest_CustomTimeouts ) ; i {
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2024-02-08 13:16:23 +00:00
file_pulumi_resource_proto_msgTypes [ 15 ] . Exporter = func ( v interface { } , i int ) interface { } {
2022-06-11 07:52:24 +00:00
switch v := v . ( * RegisterResourceResponse_PropertyDependencies ) ; i {
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2024-02-08 13:16:23 +00:00
file_pulumi_resource_proto_msgTypes [ 18 ] . Exporter = func ( v interface { } , i int ) interface { } {
switch v := v . ( * ResourceCallRequest_ArgumentDependencies ) ; i {
case 0 :
return & v . state
case 1 :
return & v . sizeCache
case 2 :
return & v . unknownFields
default :
return nil
}
}
2022-06-11 07:52:24 +00:00
}
type x struct { }
out := protoimpl . TypeBuilder {
File : protoimpl . DescBuilder {
GoPackagePath : reflect . TypeOf ( x { } ) . PkgPath ( ) ,
2022-07-12 13:45:03 +00:00
RawDescriptor : file_pulumi_resource_proto_rawDesc ,
2022-06-11 07:52:24 +00:00
NumEnums : 0 ,
2024-02-08 13:16:23 +00:00
NumMessages : 21 ,
2022-06-11 07:52:24 +00:00
NumExtensions : 0 ,
NumServices : 1 ,
} ,
2022-07-12 13:45:03 +00:00
GoTypes : file_pulumi_resource_proto_goTypes ,
DependencyIndexes : file_pulumi_resource_proto_depIdxs ,
MessageInfos : file_pulumi_resource_proto_msgTypes ,
2022-06-11 07:52:24 +00:00
} . Build ( )
2022-07-12 13:45:03 +00:00
File_pulumi_resource_proto = out . File
file_pulumi_resource_proto_rawDesc = nil
file_pulumi_resource_proto_goTypes = nil
file_pulumi_resource_proto_depIdxs = nil
2020-02-28 11:53:47 +00:00
}