mirror of https://github.com/pulumi/pulumi.git
bbc9c6d0d5
Addressing https://github.com/pulumi/pulumi/issues/8237 starting with NodeJS This PR implements `Stack.import(...)` in NodeJS automation API and allows the user to specify resources and other import options to perform the import. Here is an example of how it looks like from the user's perspective: ```ts // importing resources from a list of import definitions // can also specify nameTable: { ... } const result = await stack.import({ protect: false, resources: [ { type: "random:index/randomPassword:RandomPassword", name: "randomPassword", id: "supersecret" } ] }) // see the generated code from the import console.log(result.generatedCode) ``` In addition to specifying resources, we can also specify a converter to import resources with: ```ts // pulumi import --from terraform ./tfstate.json const result = await stack.import({ converter: "terraform", converterArgs: "./tfstate.json" }) ``` > I've used `converter` and `converterArgs` as opposed to `from` and `fromArgs` because `fromArgs` sounds a bit weird and `converter` makes sense because we are using a converter. We could say `fromConverter` and `fromConverterArgs` but that sounds like a mouthful |
||
---|---|---|
.. | ||
correct_project | ||
import | ||
json | ||
nested_config | ||
tcfg | ||
testproj | ||
testproj_dotnet | ||
yaml | ||
yml |