pulumi/proto/pulumi/converter.proto

89 lines
3.1 KiB
Protocol Buffer

// Copyright 2016-2023, Pulumi Corporation.
//
// 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.
syntax = "proto3";
import "pulumi/codegen/hcl.proto";
package pulumirpc;
option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go;pulumirpc";
// Converter is a service for converting between other ecosystems and Pulumi.
// This is currently unstable and experimental.
service Converter {
// ConvertState converts state from the target ecosystem into a form that can be imported into Pulumi.
rpc ConvertState(ConvertStateRequest) returns (ConvertStateResponse) {}
// ConvertProgram converts a program from the target ecosystem into a form that can be used with Pulumi.
rpc ConvertProgram(ConvertProgramRequest) returns (ConvertProgramResponse) {}
}
message ConvertStateRequest {
// the gRPC target of the mapper service.
string mapper_target = 1;
// the args passed to `pulumi import` for this conversion. Normally used to specifiy a state file to
// import from.
repeated string args = 2;
}
// A ResourceImport specifies a resource to import.
message ResourceImport {
// the type token for the resource.
string type = 1;
// the name of the resource.
string name = 2;
// the ID of the resource.
string id = 3;
// the provider version to use for the resource, if any.
string version = 4;
// the provider PluginDownloadURL to use for the resource, if any.
string pluginDownloadURL = 5;
// the logical name of the resource.
string logical_name = 6;
// true if this is a component resource.
bool is_component = 7;
// true if this is a remote resource. Ignored if is_component is false.
bool is_remote = 8;
}
message ConvertStateResponse {
// a list of resources to import.
repeated ResourceImport resources = 1;
// any diagnostics from state conversion.
repeated pulumirpc.codegen.Diagnostic diagnostics = 2;
}
message ConvertProgramRequest {
// the source directory containing the program to convert from.
string source_directory = 1;
// a target directory to write the resulting PCL code and project file to.
string target_directory = 2;
// the gRPC target of the mapper service.
string mapper_target = 3;
// The target of a codegen.LoaderServer to use for loading schemas.
string loader_target = 4;
// the args passed to `pulumi convert` for this conversion. Normally used to specifiy a root file, or conversion options.
repeated string args = 5;
}
message ConvertProgramResponse {
// any diagnostics from code generation.
repeated pulumirpc.codegen.Diagnostic diagnostics = 1;
}