pulumi/sdk/nodejs/tests
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
..
automation [autmation/nodejs] Implement Stack.import() to specify and import resources into a stack (#16615) 2024-07-24 14:58:12 +00:00
runtime Revert "Implement `dependsOn` for invokes in the NodeJS SDK (#16560)" (#16642) 2024-07-12 10:16:55 +00:00
sxs_ts_test Replace Rome with Biome in the NodeJS SDK (#16456) 2024-06-24 11:14:56 +00:00
config.spec.ts Apply autoformat 2023-04-28 18:27:10 -04:00
constants.ts ci: improve x-plat testing on Windows 2022-03-06 14:45:26 -08:00
init.spec.ts Apply autoformat 2023-04-28 18:27:10 -04:00
iterable.spec.ts Apply autoformat 2023-04-28 18:27:10 -04:00
options.spec.ts Apply autoformat 2023-04-28 18:27:10 -04:00
output.spec.ts allow unknowns in apply during update (#15898) 2024-04-10 16:48:38 +00:00
provider.spec.ts Add google-protobuf types (#14422) 2023-10-27 09:55:44 +00:00
resource.spec.ts [sdk/nodejs] Fix provider for resource methods (#13796) 2023-08-30 14:49:53 +00:00
stackReference.spec.ts Apply autoformat 2023-04-28 18:27:10 -04:00
unwrap.spec.ts Apply autoformat 2023-04-28 18:27:10 -04:00
util.ts Apply autoformat 2023-04-28 18:27:10 -04:00