# Program conversion
<gh-file:pulumi#proto/pulumi/converter.proto>

## Services

(pulumirpc.Converter)=
### 🔌 Converter
Converter is a service for converting between other ecosystems and Pulumi.
This is currently unstable and experimental.


(pulumirpc.Converter.ConvertState)=
#### 📞 ConvertState

⤵️ [ConvertStateRequest](#pulumirpc.ConvertStateRequest) ⤴️ [ConvertStateResponse](#pulumirpc.ConvertStateResponse)

ConvertState converts state from the target ecosystem into a form that can be imported into Pulumi.


(pulumirpc.Converter.ConvertProgram)=
#### 📞 ConvertProgram

⤵️ [ConvertProgramRequest](#pulumirpc.ConvertProgramRequest) ⤴️ [ConvertProgramResponse](#pulumirpc.ConvertProgramResponse)

ConvertProgram converts a program from the target ecosystem into a form that can be used with Pulumi.


(pulumirpc.Converter.ConvertSnippet)=
#### 📞 ConvertSnippet

⤵️ [ConvertSnippetRequest](#pulumirpc.ConvertSnippetRequest) ⤴️ [ConvertSnippetResponse](#pulumirpc.ConvertSnippetResponse)

ConvertSnippet generates a single PCL file from a single source file in the target ecosystem. It is used when
callers need to convert a small source fragment, such as an input file, rather than a full Pulumi program.

## Messages
(pulumirpc.ConvertProgramRequest)=
### 📨 ConvertProgramRequest



`source_directory` [string](#string)
:   the source directory containing the program to convert from.


`target_directory` [string](#string)
:   a target directory to write the resulting PCL code and project file to.


`mapper_target` [string](#string)
:   the gRPC target of the mapper service.


`loader_target` [string](#string)
:   The target of a codegen.LoaderServer to use for loading schemas.


`args` [string](#string)
:   the args passed to `pulumi convert` for this conversion. Normally used to specifiy a root file, or conversion options.


`generated_project_directory` [string](#string)
:   the directory where the final generated project for the eventual destination language will be written.
  use to determine relative paths of any asset that will be copied over.
  Do not write files to this directory as these files might be overwritten in 
  the project generation process.

(pulumirpc.ConvertProgramResponse)=
### 📨 ConvertProgramResponse



`diagnostics` [codegen.Diagnostic](#pulumirpc.codegen.Diagnostic)
:   any diagnostics from code generation.

(pulumirpc.ConvertSnippetRequest)=
### 📨 ConvertSnippetRequest



`filename` [string](#string)
:   The name of the source file. This is used for diagnostics.


`source` [bytes](#bytes)
:   The raw bytes of the source file.


`target_loader` [string](#string)
:   The target of a codegen.LoaderServer to use for loading schemas.


`package` [codegen.GetSchemaRequest](#codegen.GetSchemaRequest)
:   The package description to load which contains the token.


`token` [string](#string)
:   The token to use when converting the snippet. This may be a provider token, such as `pulumi:providers:pkg`,
  a function token, or a resource token.


`attributes` [ConvertSnippetRequest.AttributesEntry](#pulumirpc.ConvertSnippetRequest.AttributesEntry)
:   any extra attributes to convert.


`resources` [ConvertSnippetRequest.ResourcesEntry](#pulumirpc.ConvertSnippetRequest.ResourcesEntry)
:   any external resource references to convert.

(pulumirpc.ConvertSnippetRequest.AttributesEntry)=
### 📨 AttributesEntry



`key` [string](#string)
: &lt;No description&gt;


`value` [string](#string)
: &lt;No description&gt;

(pulumirpc.ConvertSnippetRequest.ResourceReference)=
### 📨 ResourceReference



`token` [string](#string)
:   The resource token for the referenced resource.


`package` [codegen.GetSchemaRequest](#codegen.GetSchemaRequest)
:   The package description to load for the referenced resource.

(pulumirpc.ConvertSnippetRequest.ResourcesEntry)=
### 📨 ResourcesEntry



`key` [string](#string)
: &lt;No description&gt;


`value` [ConvertSnippetRequest.ResourceReference](#pulumirpc.ConvertSnippetRequest.ResourceReference)
: &lt;No description&gt;

(pulumirpc.ConvertSnippetResponse)=
### 📨 ConvertSnippetResponse



`diagnostics` [codegen.Diagnostic](#pulumirpc.codegen.Diagnostic)
:   Any diagnostics raised by code generation.


`filename` [string](#string)
:   The generated PCL filename.


`source` [bytes](#bytes)
:   The generated PCL source code.


`attributes` [ConvertSnippetResponse.AttributesEntry](#pulumirpc.ConvertSnippetResponse.AttributesEntry)
:   any extra attributes to merge into the final pcl result.


`resource_names` [ConvertSnippetResponse.ResourceNamesEntry](#pulumirpc.ConvertSnippetResponse.ResourceNamesEntry)
:   any external resource names that were rewritten during conversion. The keys are identifiers
  in the source language and the values are identifiers in the generated PCL.

(pulumirpc.ConvertSnippetResponse.AttributesEntry)=
### 📨 AttributesEntry



`key` [string](#string)
: &lt;No description&gt;


`value` [string](#string)
: &lt;No description&gt;

(pulumirpc.ConvertSnippetResponse.ResourceNamesEntry)=
### 📨 ResourceNamesEntry



`key` [string](#string)
: &lt;No description&gt;


`value` [string](#string)
: &lt;No description&gt;

(pulumirpc.ConvertStateRequest)=
### 📨 ConvertStateRequest



`mapper_target` [string](#string)
:   the gRPC target of the mapper service.


`args` [string](#string)
:   the args passed to `pulumi import` for this conversion. Normally used to specifiy a state file to
  import from.


`loader_target` [string](#string)
:   The target of a codegen.LoaderServer to use for loading schemas.


`resolver_target` [string](#string)
:   The target of a [](pulumirpc.PackageResolver) service the converter can use to resolve package
  specifications to concrete package dependencies. May be empty on older engines.

(pulumirpc.ConvertStateResponse)=
### 📨 ConvertStateResponse



`resources` [ResourceImport](#pulumirpc.ResourceImport)
:   a list of resources to import.


`diagnostics` [codegen.Diagnostic](#pulumirpc.codegen.Diagnostic)
:   any diagnostics from state conversion.

(pulumirpc.ResourceExtension)=
### 📨 ResourceExtension
A ResourceExtension describes an extension parameterization to apply to a resource's (base) provider.


`name` [string](#string)
:   the name of the extension package.


`version` [string](#string)
:   the version of the extension package.


`value` [bytes](#bytes)
:   the parameter value for the extension.

(pulumirpc.ResourceImport)=
### 📨 ResourceImport
A ResourceImport specifies a resource to import.


`type` [string](#string)
:   the type token for the resource.


`name` [string](#string)
:   the name of the resource.


`id` [string](#string)
:   the ID of the resource.


`version` [string](#string)
:   the provider version to use for the resource, if any.


`pluginDownloadURL` [string](#string)
:   the provider PluginDownloadURL to use for the resource, if any.


`logical_name` [string](#string)
:   the logical name of the resource.


`is_component` [bool](#bool)
:   true if this is a component resource.


`is_remote` [bool](#bool)
:   true if this is a remote resource. Ignored if is_component is false.


`parameterization` [ResourceParameterization](#pulumirpc.ResourceParameterization)
:   the replacement parameterization to use for the resource's provider, if any. Set when the resource
  should be imported under a parameterized (e.g. dynamically bridged) provider rather than a plain one.


`extension` [ResourceExtension](#pulumirpc.ResourceExtension)
:   the extension parameterization to apply to the resource's provider, if any. Unlike a replacement
  parameterization, the resource's own type is in the base provider's package; the extension is a blob
  applied on top of that provider. Mutually exclusive with parameterization.


`parent` [string](#string)
:   the name of the resource's parent, if any. Must reference the name of another resource in the same
  response; resources without a parent are parented to the stack root.


`properties` [string](#string)
:   the input properties to include when generating code for the resource. Defaults to the resource's
  required properties.


`provider` [string](#string)
:   the name of the resource's explicit provider, if any. Must reference the name of a provider
  declared as another resource (of type "pulumi:providers:<package>") in the same response;
  resources without a provider are served by an appropriate default provider.


`inputs` [google.protobuf.Struct](#google.protobuf.Struct)
:   input properties supplied for the resource, if any. Values the provider's Read cannot return
  (e.g. write-only attributes) are taken from here instead. For a provider declared in the
  response, inputs is its configuration. Secret values are marked with Pulumi's standard secret
  signature.


`outputs` [google.protobuf.Struct](#google.protobuf.Struct)
:   the resource's full output state, if any. When set, the resource is imported from these values
  directly and the provider's Read is skipped entirely. Secret values are marked with Pulumi's
  standard secret signature.

(pulumirpc.ResourceParameterization)=
### 📨 ResourceParameterization
A ResourceParameterization describes the base plugin that a resource's parameterized provider is built
from. The parameterized package name and version are taken from the resource's own type and version.


`plugin_name` [string](#string)
:   the name of the base plugin to parameterize (e.g. "terraform-provider").


`plugin_version` [string](#string)
:   the version of the base plugin to parameterize.


`value` [bytes](#bytes)
:   the parameter value to apply to the base plugin.

