Commit graph

11 commits

Author SHA1 Message Date
Justin Van Patten ba39ed9ad4
Add tests that return failures from Call (#8424)
- [sdk/nodejs] - Allow returning failures from Call in the provider without setting result outputs.
- [sdk/go] - Allow specifying Call failures from the provider.
- Add tests that return failures from Call.
2021-11-16 08:58:46 -08:00
Justin Van Patten d812d16329
[sdk/go] Unmarshal output values in component provider (#7975)
This adds support for unmarshaling output values in the CopyTo helper used when copying inputs to an args struct
2021-09-17 19:46:06 -07:00
Anton Tayanovskyy 5069a8fca8
Fixes 5642 for Go: allow DependsOn accepting inputs and outputs (#7584)
* Work in progress, first passing tests

* Test unknown dep prop similar to Python

* Test fixes

* Fix lint

* Nit fix

* CHANGELOG

* Add ResourceInputArray and simplify the API

* Adopt urnSet
2021-08-13 11:13:23 -04:00
Justin Van Patten e8bd8e5e1f
Rehydrate provider resources in Construct (#7624)
Previously, any provider resource passed to multi-lang components would be instantiated as a `DependencyProviderResource` inside `Construct`, which prevents the component from being able to easily access the provider's state as an instance of of the provider (e.g. `*aws.Provider`).

This change attempts to rehydrate the provider resource in the same way that resource references are rehydrated, if it's been registered, s.t. the specific provider resource type is instantiated with its state. Otherwise falling back to returning `DependencyProviderResource`.
2021-07-23 14:10:06 -07:00
Justin Van Patten 824fb397f9
[sdk/go] Support for implementing methods in provider (#7379) 2021-07-01 15:46:16 -07:00
Pat Gavlin 398fb2f852
Preliminary fix for #7359. (#7369)
These changes contain a preliminary fix for #7359 in the Go SDK. The fix
handles input values that are nested one level deep within maps and
arrays, but does not handle other cases of nested input types.
2021-06-28 16:04:21 -07:00
Evan Boyle 634e97cd55
Include config secret info in Construct calls (#7358) 2021-06-24 15:38:01 -07:00
Justin Van Patten 48bbc28d9e
[sdk/go] Specify known when creating outputs for construct (#7343)
If an input is an unknown value or contains unknowns, specify `false` for `known` when creating the output.
2021-06-21 09:51:41 -07:00
Pat Gavlin 354946a1e4
Await outstanding async work in Go. (#6983)
The Pulumi Go SDK does not currently await all outstanding asynchronous
work associated with a Pulumi program. Because all relevant asynchronous
work is created via the Pulumi SDK, we can track this asynchronous work
and ensure that it has all completed prior to returning from
`Context.Run`.

This is complicated by the fact that many of the existing APIs that are
able to create `Output`s--`NewOutput`, `ToOutput`, `Any`,  `ToSecret`,
and `All`--do not have a `*Context` parameter, and so have no
straightforward way to associate themselves with a `*Context`. To address
this, these changes add new versions of each of these APIs as methods on
`*Context`.

Despite these new methods, most Pulumi programs should work without
changes: the bulk of `Output`s are created by the SDK itself as part of
resource registration, and for `Any` and `All`, we can pick up the
context from any `Output`s present in the arguments. The only programs
that should require changes are those that create outputs from whole
cloth using `NewOutput`, `ToOutput`, or `ToSecret` and create unawaited
async work rooted at those outputs.

On an implementation level, these changes track asynchronous work using
a `sync.WaitGroup` associated with each `*Context`. This `WaitGroup` is
passed to each output associated with the context. The SDK increments
this `WaitGroup`'s count prior to starting any asynchronous work and
decrements it once the work (including any callbacks triggered by the
work) is complete.

This fixes the Go portion of #3991.
2021-05-14 12:00:21 -07:00
Justin Van Patten 81810cbb9c
[sdk/go] Support prompt values in Construct (#6790)
Adds support for prompt values. And renames `ConstructInputs.SetArgs` to `ConstructInputs.CopyTo`.
2021-04-18 09:18:25 -07:00
Justin Van Patten 780a0c8a3d
Support defining remote components in Go (#6403) 2021-04-16 11:49:21 -07:00