pulumi/sdk/nodejs/proto
Will Jones 4e90fcb781 Implement the `CreateIfNotExists` resource option
This commit implements `CreateIfNotExists`, a new resource option that
allows programs to specify resource options that should be created only
if they do not already exist in the provider. Use cases for this feature
include "global" or shared resources, such as AWS service-linked
providers within an account, or SSL policies within a GCP
account/project. `CreateIfNotExists` behaves as follows:

* The option accepts an ID, much like `Import`, that will be used to
  determine whether or not a resource exists using a `Read` operation.
  If it does, resource inputs must match as they would be required to in
  an ordinary import. If not, the resource is created as usual.

* Due to the semantics specified above, it is an error to specify both
  `CreateIfNotExists` and `Import` resource options on a single
  resource.

The "if not exists" part is handled by a provider `Read` call that we
make in step generation. This is not ideal, since we'd like step
generation to be non-blocking (and `Read` could block for an arbitrary
amount of time). However, there aren't many other good options for
achieving this:

* Source evaluation would be a good middle ground, but this would
  require changing the contract of `Read`/introducing another call since
  we do not have a URN at this point.
* Parallelising step generation (see e.g. #15026). This is the "best"
  outcome and feels the most correct, but carries a large amount of risk.

There _are_ instances of us breaking this rule (not blocking in step
generation) already (e.g. `Check` and `Diff`, which "should" be fast but
in reality could do anything they like), and the hypothesis is that
there won't be many resources with this option in a given stack, so this
feels like an acceptable compromise.

A set of lifecycle tests capturing `CreateIfNotExists`' interactions
with existing resource options and scenarios are included. This commit
does not include SDK updates to use the new option; these will be
introduced in future changesets.

Part of #16189
2024-07-02 17:27:42 +01:00
..
codegen Clean up unused import warnings (#15581) 2024-03-04 13:01:25 +00:00
testing Add SupportPack to schemas to write out in the new style (#15713) 2024-03-22 09:25:46 +00:00
alias_grpc_pb.js feat(engine): Adds structured alias support to the engine 2022-10-11 17:56:32 -04:00
alias_pb.d.ts Update node sdk to use typescript definitions for grpc and protobufs. (#14415) 2023-12-04 15:22:44 +00:00
alias_pb.js Fix recursive fixups in JavaScript protobuf generation (#14424) 2023-11-10 13:31:14 +00:00
analyzer_grpc_pb.d.ts Update node sdk to use typescript definitions for grpc and protobufs. (#14415) 2023-12-04 15:22:44 +00:00
analyzer_grpc_pb.js Policy remediations feature (#14080) 2023-10-09 18:31:17 +00:00
analyzer_pb.d.ts Update node sdk to use typescript definitions for grpc and protobufs. (#14415) 2023-12-04 15:22:44 +00:00
analyzer_pb.js Fix recursive fixups in JavaScript protobuf generation (#14424) 2023-11-10 13:31:14 +00:00
callback_grpc_pb.d.ts Clean up unused import warnings (#15581) 2024-03-04 13:01:25 +00:00
callback_grpc_pb.js Clean up unused import warnings (#15581) 2024-03-04 13:01:25 +00:00
callback_pb.d.ts Clean up unused import warnings (#15581) 2024-03-04 13:01:25 +00:00
callback_pb.js Clean up unused import warnings (#15581) 2024-03-04 13:01:25 +00:00
converter_grpc_pb.d.ts Clean up unused import warnings (#15581) 2024-03-04 13:01:25 +00:00
converter_grpc_pb.js Clean up unused import warnings (#15581) 2024-03-04 13:01:25 +00:00
converter_pb.d.ts Clean up unused import warnings (#15581) 2024-03-04 13:01:25 +00:00
converter_pb.js Clean up unused import warnings (#15581) 2024-03-04 13:01:25 +00:00
engine_grpc_pb.d.ts Update node sdk to use typescript definitions for grpc and protobufs. (#14415) 2023-12-04 15:22:44 +00:00
engine_grpc_pb.js Compile protobufs with "pulumi" namespace (#10074) 2022-07-12 14:45:03 +01:00
engine_pb.d.ts Update node sdk to use typescript definitions for grpc and protobufs. (#14415) 2023-12-04 15:22:44 +00:00
engine_pb.js Fix recursive fixups in JavaScript protobuf generation (#14424) 2023-11-10 13:31:14 +00:00
errors_grpc_pb.js Regenerate protocol buffers code 2020-02-28 11:53:47 +00:00
errors_pb.d.ts Update node sdk to use typescript definitions for grpc and protobufs. (#14415) 2023-12-04 15:22:44 +00:00
errors_pb.js Fix recursive fixups in JavaScript protobuf generation (#14424) 2023-11-10 13:31:14 +00:00
language_grpc_pb.d.ts Query language runtime for options during “pulumi new” (#16346) 2024-06-17 17:10:55 +00:00
language_grpc_pb.js Query language runtime for options during “pulumi new” (#16346) 2024-06-17 17:10:55 +00:00
language_pb.d.ts Add not-found markers to missing executables for packagemanagers (#16488) 2024-06-28 23:21:55 +00:00
language_pb.js Add not-found markers to missing executables for packagemanagers (#16488) 2024-06-28 23:21:55 +00:00
plugin_grpc_pb.js Regenerate protocol buffers code 2020-02-28 11:53:47 +00:00
plugin_pb.d.ts Update node sdk to use typescript definitions for grpc and protobufs. (#14415) 2023-12-04 15:22:44 +00:00
plugin_pb.js Fix recursive fixups in JavaScript protobuf generation (#14424) 2023-11-10 13:31:14 +00:00
provider_grpc_pb.d.ts Add Paramaterize to provider interface (#16174) 2024-05-15 16:22:39 +00:00
provider_grpc_pb.js Implement the `CreateIfNotExists` resource option 2024-07-02 17:27:42 +01:00
provider_pb.d.ts Implement the `CreateIfNotExists` resource option 2024-07-02 17:27:42 +01:00
provider_pb.js Implement the `CreateIfNotExists` resource option 2024-07-02 17:27:42 +01:00
resource_grpc_pb.d.ts Keep package refs separate from providers (#16458) 2024-06-24 14:59:18 +00:00
resource_grpc_pb.js Keep package refs separate from providers (#16458) 2024-06-24 14:59:18 +00:00
resource_pb.d.ts Implement the `CreateIfNotExists` resource option 2024-07-02 17:27:42 +01:00
resource_pb.js Implement the `CreateIfNotExists` resource option 2024-07-02 17:27:42 +01:00
source_grpc_pb.js [engine] Add support for source positions 2023-07-10 14:35:40 -07:00
source_pb.d.ts Update node sdk to use typescript definitions for grpc and protobufs. (#14415) 2023-12-04 15:22:44 +00:00
source_pb.js Fix recursive fixups in JavaScript protobuf generation (#14424) 2023-11-10 13:31:14 +00:00
status_grpc_pb.js Regenerate protocol buffers code 2020-02-28 11:53:47 +00:00
status_pb.d.ts Update node sdk to use typescript definitions for grpc and protobufs. (#14415) 2023-12-04 15:22:44 +00:00
status_pb.js Compile protobufs with "pulumi" namespace (#10074) 2022-07-12 14:45:03 +01:00