pulumi/sdk/nodejs/tests/automation/data
Zaid Ajaj bbc9c6d0d5
[autmation/nodejs] Implement Stack.import() to specify and import resources into a stack (#16615)
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
2024-07-24 14:58:12 +00:00
..
correct_project [automation/go,nodejs,python] - Respect existing project settings (#6655) 2021-03-31 07:51:11 -07:00
import [autmation/nodejs] Implement Stack.import() to specify and import resources into a stack (#16615) 2024-07-24 14:58:12 +00:00
json [nodejs] Fix serialization/deserialization for StackSettings (#6754) 2021-04-12 16:49:49 -07:00
nested_config [Automation API / Nodejs] - Environment functions (#14788) 2023-12-11 16:14:10 +00:00
tcfg Replace Rome with Biome in the NodeJS SDK (#16456) 2024-06-24 11:14:56 +00:00
testproj Update github.com/cloudflare/circl to v1.3.7 (#15151) 2024-01-16 08:59:57 +00:00
testproj_dotnet Test and fix for nodejs automation api 2023-01-23 08:26:58 +00:00
yaml [nodejs] Fix serialization/deserialization for StackSettings (#6754) 2021-04-12 16:49:49 -07:00
yml [nodejs] Fix serialization/deserialization for StackSettings (#6754) 2021-04-12 16:49:49 -07:00