pulumi/sdk/proto/languages.proto
joeduffy fbfca58a3f Implement components
This change implements core support for "components" in the Pulumi
Fabric.  This work is described further in pulumi/pulumi#340, where
we are still discussing some of the finer points.

In a nutshell, resources no longer imply external providers.  It's
entirely possible to have a resource that logically represents
something but without having a physical manifestation that needs to
be tracked and managed by our typical CRUD operations.

For example, the aws/serverless/Function helper is one such type.
It aggregates Lambda-related resources and exposes a nice interface.
All of the Pulumi Cloud Framework resources are also examples.

To indicate that a resource does participate in the usual CRUD resource
provider, it simply derives from ExternalResource instead of Resource.

All resources now have the ability to adopt children.  This is purely
a metadata/tagging thing, and will help us roll up displays, provide
attribution to the developer, and even hide aspects of the resource
graph as appropriate (e.g., when they are implementation details).

Our use of this capability is ultra limited right now; in fact, the
only place we display children is in the CLI output.  For instance:

    + aws:serverless:Function: (create)
      [urn=urn:pulumi:demo::serverless::aws:serverless:Function::mylambda]
      => urn:pulumi:demo::serverless::aws:iam/role:Role::mylambda-iamrole
      => urn:pulumi:demo::serverless::aws:iam/rolePolicyAttachment:RolePolicyAttachment::mylambda-iampolicy-0
      => urn:pulumi:demo::serverless::aws:lambda/function:Function::mylambda

The bit indicating whether a resource is external or not is tracked
in the resulting checkpoint file, along with any of its children.
2017-10-14 18:30:59 -07:00

54 lines
2.6 KiB
Protocol Buffer

// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
syntax = "proto3";
import "google/protobuf/struct.proto";
import "provider.proto";
package pulumirpc;
// LanguageRuntime is the interface that the planning monitor uses to drive execution of an interpreter responsible
// for confguring and creating resource objects.
service LanguageRuntime {
rpc Run(RunRequest) returns (RunResponse) {}
}
// RunRequest asks the interpreter to execute a program.
message RunRequest {
string pwd = 1; // the program's working directory.
string program = 2; // the path to the program to execute.
repeated string args = 3; // any arguments to pass to the program.
map<string, string> config = 4; // the configuration variables to apply before running.
bool dryRun = 5; // true if we're only doing a dryrun (preview).
int32 parallel = 6; // the degree of parallelism for resource operations (<=1 for serial).
}
// RunResponse is the response back from the interpreter/source back to the monitor.
message RunResponse {
string error = 1; // an unhandled error if any occurred.
}
// ResourceMonitor is the interface a source uses to talk back to the planning monitor orchestrating the execution.
service ResourceMonitor {
rpc Invoke(InvokeRequest) returns (InvokeResponse) {}
rpc NewResource(NewResourceRequest) returns (NewResourceResponse) {}
}
// NewResourceRequest contains information about a resource object that was newly allocated.
message NewResourceRequest {
string type = 1; // the type of the object allocated.
string name = 2; // the name, for URN purposes, of the object.
repeated string children = 3; // an optional list of child URNs belonging to this parent resource.
bool external = 4; // true if the resource is external to Pulumi, managed by CRUD operations.
google.protobuf.Struct object = 5; // an object produced by the interpreter/source.
}
// NewResourceResponse reflects back the properties initialized during creation, if applicable.
message NewResourceResponse {
string id = 1; // the unique ID assigned by the provider.
string urn = 2; // the URN assigned by the fabric.
google.protobuf.Struct object = 3; // the resulting object properties, including provider defaults.
bool stable = 4; // if true, the object's state is stable and may be trusted not to change.
repeated string stables = 5; // an optional list of guaranteed-stable properties.
}