@pulumi/pulumi 3.181.0 → 3.182.0-alpha.x05fd819
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/automation/cmd.js +4 -2
- package/automation/cmd.js.map +1 -1
- package/cmd/run/index.js +39 -0
- package/cmd/run/index.js.map +1 -1
- package/package.json +1 -1
- package/proto/analyzer_grpc_pb.d.ts +17 -0
- package/proto/analyzer_grpc_pb.js +15 -0
- package/proto/resource_pb.d.ts +6 -0
- package/proto/resource_pb.js +83 -23
- package/resource.d.ts +132 -0
- package/resource.js +44 -0
- package/resource.js.map +1 -1
- package/runtime/callbacks.d.ts +3 -1
- package/runtime/callbacks.js +52 -0
- package/runtime/callbacks.js.map +1 -1
- package/runtime/mocks.js +1 -0
- package/runtime/mocks.js.map +1 -1
- package/runtime/resource.d.ts +2 -1
- package/runtime/resource.js +47 -0
- package/runtime/resource.js.map +1 -1
- package/runtime/settings.js +4 -2
- package/runtime/settings.js.map +1 -1
- package/runtime/state.js +1 -0
- package/runtime/state.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/automation/cmd.js
CHANGED
|
@@ -144,15 +144,17 @@ class PulumiCommand {
|
|
|
144
144
|
if (!args.includes("--non-interactive")) {
|
|
145
145
|
args.push("--non-interactive");
|
|
146
146
|
}
|
|
147
|
+
const env = { ...additionalEnv };
|
|
147
148
|
// Prepend the folder where the CLI is installed to the path to ensure
|
|
148
149
|
// we pickup the matching bundled plugins.
|
|
149
150
|
if (path.isAbsolute(this.command)) {
|
|
150
151
|
const pulumiBin = path.dirname(this.command);
|
|
151
152
|
const sep = os.platform() === "win32" ? ";" : ":";
|
|
152
153
|
const envPath = pulumiBin + sep + (additionalEnv["PATH"] || process.env.PATH);
|
|
153
|
-
|
|
154
|
+
env["PATH"] = envPath;
|
|
154
155
|
}
|
|
155
|
-
|
|
156
|
+
env["PULUMI_AUTOMATION_API"] = "true";
|
|
157
|
+
return exec(this.command, args, cwd, env, onOutput, onError, signal);
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
160
|
exports.PulumiCommand = PulumiCommand;
|
package/automation/cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../../automation/cmd.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;;;AAEjC,kDAA0B;AAC1B,uCAAyB;AACzB,8CAAsB;AACtB,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,yCAA2B;AAC3B,wCAAwD;AACxD,qDAAkD;AAClD,qCAA8C;AAE9C,MAAM,sBAAsB,GAAG,0CAA0C,CAAC;AAE1E;;GAEG;AACH,MAAa,aAAa;IAKtB,YAAY,MAAc,EAAE,MAAc,EAAE,IAAY,EAAE,GAAW;QACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IACD,QAAQ;QACJ,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,IAAI,CAAC,GAAG,EAAE;YACV,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;SAChC;QACD,OAAO,SAAS,IAAI,CAAC,IAAI,cAAc,IAAI,CAAC,MAAM,cAAc,IAAI,CAAC,MAAM,YAAY,MAAM,IAAI,CAAC;IACtG,CAAC;CACJ;AAlBD,sCAkBC;AAkBD,MAAa,aAAa;IACtB,YACa,OAAe,EACf,OAA6B;QAD7B,YAAO,GAAP,OAAO,CAAQ;QACf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cAAsB,EACtB,MAAe;IAEf,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC7C,IAAI,MAAM,EAAE;QACR,OAAO,OAAO,CAAC;KAClB;IACD,IAAI,OAAO,IAAI,IAAI,EAAE;QACjB,MAAM,IAAI,KAAK,CACX,6GAA6G,sBAAsB,cAAc,CACpJ,CAAC;KACL;IACD,IAAI,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE;QAClC,MAAM,IAAI,KAAK,CACX,4DAA4D,cAAc,yBAAyB,UAAU,CAAC,KAAK,0BAA0B,CAChJ,CAAC;KACL;IACD,IAAI,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACnC,MAAM,IAAI,KAAK,CACX,8EAA8E,UAAU,CAAC,QAAQ,EAAE,iCAAiC,cAAc,iCAAiC,CACtL,CAAC;KACL;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAzBD,sEAyBC"}
|
package/cmd/run/index.js
CHANGED
|
@@ -25,7 +25,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
// Enable source map support so we get good stack traces.
|
|
27
27
|
require("source-map-support/register");
|
|
28
|
+
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
29
|
+
const emptyproto = __importStar(require("google-protobuf/google/protobuf/empty_pb"));
|
|
28
30
|
const log = __importStar(require("../../log"));
|
|
31
|
+
const settings = __importStar(require("../../runtime/settings"));
|
|
29
32
|
// The very first thing we do is set up unhandled exception and rejection hooks to ensure that these
|
|
30
33
|
// events cause us to exit with a non-zero code. It is critically important that we do this early:
|
|
31
34
|
// if we do not, unhandled rejections in particular may cause us to exit with a 0 exit code, which
|
|
@@ -81,6 +84,42 @@ process.on("exit", (code) => {
|
|
|
81
84
|
process.exitCode = exports.nodeJSProcessExitedAfterLoggingUserActionableMessage;
|
|
82
85
|
}
|
|
83
86
|
});
|
|
87
|
+
let hasSignaled = false;
|
|
88
|
+
process.on("beforeExit", async (code) => {
|
|
89
|
+
// Signal and wait for shutdown means a succesful program execution, so
|
|
90
|
+
// first check if there were any errors and bail out immediately if so.
|
|
91
|
+
if (uncaughtErrors.size > 0) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
// Similarly, if we're exiting with with a non-zero code, bail out.
|
|
95
|
+
if (code !== 0) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
// `beforeExit` is called when Node.js's event loop is empty. We call
|
|
99
|
+
// `signalAndWaitForShutdown`, which is async, so it schedules more
|
|
100
|
+
// eventloop work. We have to bail out here the next time the eventloop
|
|
101
|
+
// is empty, otherwise we end up in a loop where this handler is called
|
|
102
|
+
// forever.
|
|
103
|
+
if (hasSignaled) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
hasSignaled = true;
|
|
107
|
+
settings.getMonitor()?.signalAndWaitForShutdown(new emptyproto.Empty(), (err, _) => {
|
|
108
|
+
if (err) {
|
|
109
|
+
// If we are running against an older version of the CLI,
|
|
110
|
+
// SignalAndWaitForShutdown might not be implemented. This is
|
|
111
|
+
// mostly fine, but means that delete hooks do not work. Since
|
|
112
|
+
// we check if the CLI supports the `resourceHook` feature when
|
|
113
|
+
// registering hooks, it's fine to ignore the `UNIMPLEMENTED`
|
|
114
|
+
// error here.
|
|
115
|
+
if (err && err.code === grpc.status.UNIMPLEMENTED) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
console.error(`Error while signaling shutdown: ${err}`);
|
|
119
|
+
}
|
|
120
|
+
return;
|
|
121
|
+
});
|
|
122
|
+
});
|
|
84
123
|
// As the second thing we do, ensure that we're connected to v8's inspector API. We need to do
|
|
85
124
|
// this as some information is only sent out as events, without any way to query for it after the
|
|
86
125
|
// fact. For example, we want to keep track of ScriptId->FileNames so that we can appropriately
|
package/cmd/run/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../cmd/run/index.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;;;AAEjC,yDAAyD;AACzD,uCAAqC;AAErC,+CAAiC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../cmd/run/index.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;;;AAEjC,yDAAyD;AACzD,uCAAqC;AAErC,oDAAsC;AACtC,qFAAuE;AACvE,+CAAiC;AACjC,iEAAmD;AAEnD,oGAAoG;AACpG,kGAAkG;AAClG,kGAAkG;AAClG,mGAAmG;AACnG,kDAAkD;AAClD,EAAE;AACF,oGAAoG;AACpG,QAAQ;AACR,MAAM,cAAc,GAAG,IAAI,GAAG,EAAS,CAAC;AAExC,gGAAgG;AAChG,oGAAoG;AACpG,kGAAkG;AAClG,iGAAiG;AACjG,sCAAsC;AACtC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAS,CAAC;AAEtC,IAAI,cAAc,GAAG,KAAK,CAAC;AAC3B,MAAM,eAAe,GAAG,CAAC,GAAU,EAAE,EAAE;IACnC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,CAAC,cAAc,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAC3C,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OA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CAAC,CAAC,GAAU,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAC/D,CAAC;QAEF,6GAA6G;QAC7G,+GAA+G;QAC/G,EAAE;QACF,6GAA6G;QAC7G,gHAAgH;QAChH,kDAAkD;QAClD,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE;YACd,cAAc,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW,EAAE,KAAyB;IAC7D,IAAI,KAAK,EAAE;QACP,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;KAC5B;AACL,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -19,6 +19,7 @@ interface IAnalyzerService extends grpc.ServiceDefinition<grpc.UntypedServiceImp
|
|
|
19
19
|
configure: IAnalyzerService_IConfigure;
|
|
20
20
|
handshake: IAnalyzerService_IHandshake;
|
|
21
21
|
configureStack: IAnalyzerService_IConfigureStack;
|
|
22
|
+
cancel: IAnalyzerService_ICancel;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
interface IAnalyzerService_IAnalyze extends grpc.MethodDefinition<pulumi_analyzer_pb.AnalyzeRequest, pulumi_analyzer_pb.AnalyzeResponse> {
|
|
@@ -93,6 +94,15 @@ interface IAnalyzerService_IConfigureStack extends grpc.MethodDefinition<pulumi_
|
|
|
93
94
|
responseSerialize: grpc.serialize<pulumi_analyzer_pb.AnalyzerStackConfigureResponse>;
|
|
94
95
|
responseDeserialize: grpc.deserialize<pulumi_analyzer_pb.AnalyzerStackConfigureResponse>;
|
|
95
96
|
}
|
|
97
|
+
interface IAnalyzerService_ICancel extends grpc.MethodDefinition<google_protobuf_empty_pb.Empty, google_protobuf_empty_pb.Empty> {
|
|
98
|
+
path: "/pulumirpc.Analyzer/Cancel";
|
|
99
|
+
requestStream: false;
|
|
100
|
+
responseStream: false;
|
|
101
|
+
requestSerialize: grpc.serialize<google_protobuf_empty_pb.Empty>;
|
|
102
|
+
requestDeserialize: grpc.deserialize<google_protobuf_empty_pb.Empty>;
|
|
103
|
+
responseSerialize: grpc.serialize<google_protobuf_empty_pb.Empty>;
|
|
104
|
+
responseDeserialize: grpc.deserialize<google_protobuf_empty_pb.Empty>;
|
|
105
|
+
}
|
|
96
106
|
|
|
97
107
|
export const AnalyzerService: IAnalyzerService;
|
|
98
108
|
|
|
@@ -105,6 +115,7 @@ export interface IAnalyzerServer extends grpc.UntypedServiceImplementation {
|
|
|
105
115
|
configure: grpc.handleUnaryCall<pulumi_analyzer_pb.ConfigureAnalyzerRequest, google_protobuf_empty_pb.Empty>;
|
|
106
116
|
handshake: grpc.handleUnaryCall<pulumi_analyzer_pb.AnalyzerHandshakeRequest, pulumi_analyzer_pb.AnalyzerHandshakeResponse>;
|
|
107
117
|
configureStack: grpc.handleUnaryCall<pulumi_analyzer_pb.AnalyzerStackConfigureRequest, pulumi_analyzer_pb.AnalyzerStackConfigureResponse>;
|
|
118
|
+
cancel: grpc.handleUnaryCall<google_protobuf_empty_pb.Empty, google_protobuf_empty_pb.Empty>;
|
|
108
119
|
}
|
|
109
120
|
|
|
110
121
|
export interface IAnalyzerClient {
|
|
@@ -132,6 +143,9 @@ export interface IAnalyzerClient {
|
|
|
132
143
|
configureStack(request: pulumi_analyzer_pb.AnalyzerStackConfigureRequest, callback: (error: grpc.ServiceError | null, response: pulumi_analyzer_pb.AnalyzerStackConfigureResponse) => void): grpc.ClientUnaryCall;
|
|
133
144
|
configureStack(request: pulumi_analyzer_pb.AnalyzerStackConfigureRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: pulumi_analyzer_pb.AnalyzerStackConfigureResponse) => void): grpc.ClientUnaryCall;
|
|
134
145
|
configureStack(request: pulumi_analyzer_pb.AnalyzerStackConfigureRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: pulumi_analyzer_pb.AnalyzerStackConfigureResponse) => void): grpc.ClientUnaryCall;
|
|
146
|
+
cancel(request: google_protobuf_empty_pb.Empty, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall;
|
|
147
|
+
cancel(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall;
|
|
148
|
+
cancel(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall;
|
|
135
149
|
}
|
|
136
150
|
|
|
137
151
|
export class AnalyzerClient extends grpc.Client implements IAnalyzerClient {
|
|
@@ -160,4 +174,7 @@ export class AnalyzerClient extends grpc.Client implements IAnalyzerClient {
|
|
|
160
174
|
public configureStack(request: pulumi_analyzer_pb.AnalyzerStackConfigureRequest, callback: (error: grpc.ServiceError | null, response: pulumi_analyzer_pb.AnalyzerStackConfigureResponse) => void): grpc.ClientUnaryCall;
|
|
161
175
|
public configureStack(request: pulumi_analyzer_pb.AnalyzerStackConfigureRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: pulumi_analyzer_pb.AnalyzerStackConfigureResponse) => void): grpc.ClientUnaryCall;
|
|
162
176
|
public configureStack(request: pulumi_analyzer_pb.AnalyzerStackConfigureRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: pulumi_analyzer_pb.AnalyzerStackConfigureResponse) => void): grpc.ClientUnaryCall;
|
|
177
|
+
public cancel(request: google_protobuf_empty_pb.Empty, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall;
|
|
178
|
+
public cancel(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall;
|
|
179
|
+
public cancel(request: google_protobuf_empty_pb.Empty, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: google_protobuf_empty_pb.Empty) => void): grpc.ClientUnaryCall;
|
|
163
180
|
}
|
|
@@ -264,6 +264,21 @@ configureStack: {
|
|
|
264
264
|
responseSerialize: serialize_pulumirpc_AnalyzerStackConfigureResponse,
|
|
265
265
|
responseDeserialize: deserialize_pulumirpc_AnalyzerStackConfigureResponse,
|
|
266
266
|
},
|
|
267
|
+
// Cancel signals the analyzer to gracefully shut down and abort any ongoing analysis operations.
|
|
268
|
+
// Operations aborted in this way will return an error. Since Cancel is advisory and non-blocking,
|
|
269
|
+
// it is up to the host to decide how long to wait after Cancel is called before (e.g.)
|
|
270
|
+
// hard-closing any gRPC connection.
|
|
271
|
+
cancel: {
|
|
272
|
+
path: '/pulumirpc.Analyzer/Cancel',
|
|
273
|
+
requestStream: false,
|
|
274
|
+
responseStream: false,
|
|
275
|
+
requestType: google_protobuf_empty_pb.Empty,
|
|
276
|
+
responseType: google_protobuf_empty_pb.Empty,
|
|
277
|
+
requestSerialize: serialize_google_protobuf_Empty,
|
|
278
|
+
requestDeserialize: deserialize_google_protobuf_Empty,
|
|
279
|
+
responseSerialize: serialize_google_protobuf_Empty,
|
|
280
|
+
responseDeserialize: deserialize_google_protobuf_Empty,
|
|
281
|
+
},
|
|
267
282
|
};
|
|
268
283
|
|
|
269
284
|
exports.AnalyzerClient = grpc.makeGenericClientConstructor(AnalyzerService);
|
package/proto/resource_pb.d.ts
CHANGED
|
@@ -886,6 +886,10 @@ export class ResourceHookRequest extends jspb.Message {
|
|
|
886
886
|
setUrn(value: string): ResourceHookRequest;
|
|
887
887
|
getId(): string;
|
|
888
888
|
setId(value: string): ResourceHookRequest;
|
|
889
|
+
getName(): string;
|
|
890
|
+
setName(value: string): ResourceHookRequest;
|
|
891
|
+
getType(): string;
|
|
892
|
+
setType(value: string): ResourceHookRequest;
|
|
889
893
|
|
|
890
894
|
hasNewInputs(): boolean;
|
|
891
895
|
clearNewInputs(): void;
|
|
@@ -921,6 +925,8 @@ export namespace ResourceHookRequest {
|
|
|
921
925
|
export type AsObject = {
|
|
922
926
|
urn: string,
|
|
923
927
|
id: string,
|
|
928
|
+
name: string,
|
|
929
|
+
type: string,
|
|
924
930
|
newInputs?: google_protobuf_struct_pb.Struct.AsObject,
|
|
925
931
|
oldInputs?: google_protobuf_struct_pb.Struct.AsObject,
|
|
926
932
|
newOutputs?: google_protobuf_struct_pb.Struct.AsObject,
|
package/proto/resource_pb.js
CHANGED
|
@@ -7463,6 +7463,8 @@ proto.pulumirpc.ResourceHookRequest.toObject = function(includeInstance, msg) {
|
|
|
7463
7463
|
var f, obj = {
|
|
7464
7464
|
urn: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
7465
7465
|
id: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
7466
|
+
name: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
7467
|
+
type: jspb.Message.getFieldWithDefault(msg, 4, ""),
|
|
7466
7468
|
newInputs: (f = msg.getNewInputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f),
|
|
7467
7469
|
oldInputs: (f = msg.getOldInputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f),
|
|
7468
7470
|
newOutputs: (f = msg.getNewOutputs()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f),
|
|
@@ -7512,21 +7514,29 @@ proto.pulumirpc.ResourceHookRequest.deserializeBinaryFromReader = function(msg,
|
|
|
7512
7514
|
msg.setId(value);
|
|
7513
7515
|
break;
|
|
7514
7516
|
case 3:
|
|
7517
|
+
var value = /** @type {string} */ (reader.readString());
|
|
7518
|
+
msg.setName(value);
|
|
7519
|
+
break;
|
|
7520
|
+
case 4:
|
|
7521
|
+
var value = /** @type {string} */ (reader.readString());
|
|
7522
|
+
msg.setType(value);
|
|
7523
|
+
break;
|
|
7524
|
+
case 5:
|
|
7515
7525
|
var value = new google_protobuf_struct_pb.Struct;
|
|
7516
7526
|
reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
|
|
7517
7527
|
msg.setNewInputs(value);
|
|
7518
7528
|
break;
|
|
7519
|
-
case
|
|
7529
|
+
case 6:
|
|
7520
7530
|
var value = new google_protobuf_struct_pb.Struct;
|
|
7521
7531
|
reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
|
|
7522
7532
|
msg.setOldInputs(value);
|
|
7523
7533
|
break;
|
|
7524
|
-
case
|
|
7534
|
+
case 7:
|
|
7525
7535
|
var value = new google_protobuf_struct_pb.Struct;
|
|
7526
7536
|
reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
|
|
7527
7537
|
msg.setNewOutputs(value);
|
|
7528
7538
|
break;
|
|
7529
|
-
case
|
|
7539
|
+
case 8:
|
|
7530
7540
|
var value = new google_protobuf_struct_pb.Struct;
|
|
7531
7541
|
reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
|
|
7532
7542
|
msg.setOldOutputs(value);
|
|
@@ -7574,10 +7584,24 @@ proto.pulumirpc.ResourceHookRequest.serializeBinaryToWriter = function(message,
|
|
|
7574
7584
|
f
|
|
7575
7585
|
);
|
|
7576
7586
|
}
|
|
7587
|
+
f = message.getName();
|
|
7588
|
+
if (f.length > 0) {
|
|
7589
|
+
writer.writeString(
|
|
7590
|
+
3,
|
|
7591
|
+
f
|
|
7592
|
+
);
|
|
7593
|
+
}
|
|
7594
|
+
f = message.getType();
|
|
7595
|
+
if (f.length > 0) {
|
|
7596
|
+
writer.writeString(
|
|
7597
|
+
4,
|
|
7598
|
+
f
|
|
7599
|
+
);
|
|
7600
|
+
}
|
|
7577
7601
|
f = message.getNewInputs();
|
|
7578
7602
|
if (f != null) {
|
|
7579
7603
|
writer.writeMessage(
|
|
7580
|
-
|
|
7604
|
+
5,
|
|
7581
7605
|
f,
|
|
7582
7606
|
google_protobuf_struct_pb.Struct.serializeBinaryToWriter
|
|
7583
7607
|
);
|
|
@@ -7585,7 +7609,7 @@ proto.pulumirpc.ResourceHookRequest.serializeBinaryToWriter = function(message,
|
|
|
7585
7609
|
f = message.getOldInputs();
|
|
7586
7610
|
if (f != null) {
|
|
7587
7611
|
writer.writeMessage(
|
|
7588
|
-
|
|
7612
|
+
6,
|
|
7589
7613
|
f,
|
|
7590
7614
|
google_protobuf_struct_pb.Struct.serializeBinaryToWriter
|
|
7591
7615
|
);
|
|
@@ -7593,7 +7617,7 @@ proto.pulumirpc.ResourceHookRequest.serializeBinaryToWriter = function(message,
|
|
|
7593
7617
|
f = message.getNewOutputs();
|
|
7594
7618
|
if (f != null) {
|
|
7595
7619
|
writer.writeMessage(
|
|
7596
|
-
|
|
7620
|
+
7,
|
|
7597
7621
|
f,
|
|
7598
7622
|
google_protobuf_struct_pb.Struct.serializeBinaryToWriter
|
|
7599
7623
|
);
|
|
@@ -7601,7 +7625,7 @@ proto.pulumirpc.ResourceHookRequest.serializeBinaryToWriter = function(message,
|
|
|
7601
7625
|
f = message.getOldOutputs();
|
|
7602
7626
|
if (f != null) {
|
|
7603
7627
|
writer.writeMessage(
|
|
7604
|
-
|
|
7628
|
+
8,
|
|
7605
7629
|
f,
|
|
7606
7630
|
google_protobuf_struct_pb.Struct.serializeBinaryToWriter
|
|
7607
7631
|
);
|
|
@@ -7646,12 +7670,48 @@ proto.pulumirpc.ResourceHookRequest.prototype.setId = function(value) {
|
|
|
7646
7670
|
|
|
7647
7671
|
|
|
7648
7672
|
/**
|
|
7649
|
-
* optional
|
|
7673
|
+
* optional string name = 3;
|
|
7674
|
+
* @return {string}
|
|
7675
|
+
*/
|
|
7676
|
+
proto.pulumirpc.ResourceHookRequest.prototype.getName = function() {
|
|
7677
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
|
|
7678
|
+
};
|
|
7679
|
+
|
|
7680
|
+
|
|
7681
|
+
/**
|
|
7682
|
+
* @param {string} value
|
|
7683
|
+
* @return {!proto.pulumirpc.ResourceHookRequest} returns this
|
|
7684
|
+
*/
|
|
7685
|
+
proto.pulumirpc.ResourceHookRequest.prototype.setName = function(value) {
|
|
7686
|
+
return jspb.Message.setProto3StringField(this, 3, value);
|
|
7687
|
+
};
|
|
7688
|
+
|
|
7689
|
+
|
|
7690
|
+
/**
|
|
7691
|
+
* optional string type = 4;
|
|
7692
|
+
* @return {string}
|
|
7693
|
+
*/
|
|
7694
|
+
proto.pulumirpc.ResourceHookRequest.prototype.getType = function() {
|
|
7695
|
+
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
|
|
7696
|
+
};
|
|
7697
|
+
|
|
7698
|
+
|
|
7699
|
+
/**
|
|
7700
|
+
* @param {string} value
|
|
7701
|
+
* @return {!proto.pulumirpc.ResourceHookRequest} returns this
|
|
7702
|
+
*/
|
|
7703
|
+
proto.pulumirpc.ResourceHookRequest.prototype.setType = function(value) {
|
|
7704
|
+
return jspb.Message.setProto3StringField(this, 4, value);
|
|
7705
|
+
};
|
|
7706
|
+
|
|
7707
|
+
|
|
7708
|
+
/**
|
|
7709
|
+
* optional google.protobuf.Struct new_inputs = 5;
|
|
7650
7710
|
* @return {?proto.google.protobuf.Struct}
|
|
7651
7711
|
*/
|
|
7652
7712
|
proto.pulumirpc.ResourceHookRequest.prototype.getNewInputs = function() {
|
|
7653
7713
|
return /** @type{?proto.google.protobuf.Struct} */ (
|
|
7654
|
-
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct,
|
|
7714
|
+
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 5));
|
|
7655
7715
|
};
|
|
7656
7716
|
|
|
7657
7717
|
|
|
@@ -7660,7 +7720,7 @@ proto.pulumirpc.ResourceHookRequest.prototype.getNewInputs = function() {
|
|
|
7660
7720
|
* @return {!proto.pulumirpc.ResourceHookRequest} returns this
|
|
7661
7721
|
*/
|
|
7662
7722
|
proto.pulumirpc.ResourceHookRequest.prototype.setNewInputs = function(value) {
|
|
7663
|
-
return jspb.Message.setWrapperField(this,
|
|
7723
|
+
return jspb.Message.setWrapperField(this, 5, value);
|
|
7664
7724
|
};
|
|
7665
7725
|
|
|
7666
7726
|
|
|
@@ -7678,17 +7738,17 @@ proto.pulumirpc.ResourceHookRequest.prototype.clearNewInputs = function() {
|
|
|
7678
7738
|
* @return {boolean}
|
|
7679
7739
|
*/
|
|
7680
7740
|
proto.pulumirpc.ResourceHookRequest.prototype.hasNewInputs = function() {
|
|
7681
|
-
return jspb.Message.getField(this,
|
|
7741
|
+
return jspb.Message.getField(this, 5) != null;
|
|
7682
7742
|
};
|
|
7683
7743
|
|
|
7684
7744
|
|
|
7685
7745
|
/**
|
|
7686
|
-
* optional google.protobuf.Struct old_inputs =
|
|
7746
|
+
* optional google.protobuf.Struct old_inputs = 6;
|
|
7687
7747
|
* @return {?proto.google.protobuf.Struct}
|
|
7688
7748
|
*/
|
|
7689
7749
|
proto.pulumirpc.ResourceHookRequest.prototype.getOldInputs = function() {
|
|
7690
7750
|
return /** @type{?proto.google.protobuf.Struct} */ (
|
|
7691
|
-
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct,
|
|
7751
|
+
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 6));
|
|
7692
7752
|
};
|
|
7693
7753
|
|
|
7694
7754
|
|
|
@@ -7697,7 +7757,7 @@ proto.pulumirpc.ResourceHookRequest.prototype.getOldInputs = function() {
|
|
|
7697
7757
|
* @return {!proto.pulumirpc.ResourceHookRequest} returns this
|
|
7698
7758
|
*/
|
|
7699
7759
|
proto.pulumirpc.ResourceHookRequest.prototype.setOldInputs = function(value) {
|
|
7700
|
-
return jspb.Message.setWrapperField(this,
|
|
7760
|
+
return jspb.Message.setWrapperField(this, 6, value);
|
|
7701
7761
|
};
|
|
7702
7762
|
|
|
7703
7763
|
|
|
@@ -7715,17 +7775,17 @@ proto.pulumirpc.ResourceHookRequest.prototype.clearOldInputs = function() {
|
|
|
7715
7775
|
* @return {boolean}
|
|
7716
7776
|
*/
|
|
7717
7777
|
proto.pulumirpc.ResourceHookRequest.prototype.hasOldInputs = function() {
|
|
7718
|
-
return jspb.Message.getField(this,
|
|
7778
|
+
return jspb.Message.getField(this, 6) != null;
|
|
7719
7779
|
};
|
|
7720
7780
|
|
|
7721
7781
|
|
|
7722
7782
|
/**
|
|
7723
|
-
* optional google.protobuf.Struct new_outputs =
|
|
7783
|
+
* optional google.protobuf.Struct new_outputs = 7;
|
|
7724
7784
|
* @return {?proto.google.protobuf.Struct}
|
|
7725
7785
|
*/
|
|
7726
7786
|
proto.pulumirpc.ResourceHookRequest.prototype.getNewOutputs = function() {
|
|
7727
7787
|
return /** @type{?proto.google.protobuf.Struct} */ (
|
|
7728
|
-
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct,
|
|
7788
|
+
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 7));
|
|
7729
7789
|
};
|
|
7730
7790
|
|
|
7731
7791
|
|
|
@@ -7734,7 +7794,7 @@ proto.pulumirpc.ResourceHookRequest.prototype.getNewOutputs = function() {
|
|
|
7734
7794
|
* @return {!proto.pulumirpc.ResourceHookRequest} returns this
|
|
7735
7795
|
*/
|
|
7736
7796
|
proto.pulumirpc.ResourceHookRequest.prototype.setNewOutputs = function(value) {
|
|
7737
|
-
return jspb.Message.setWrapperField(this,
|
|
7797
|
+
return jspb.Message.setWrapperField(this, 7, value);
|
|
7738
7798
|
};
|
|
7739
7799
|
|
|
7740
7800
|
|
|
@@ -7752,17 +7812,17 @@ proto.pulumirpc.ResourceHookRequest.prototype.clearNewOutputs = function() {
|
|
|
7752
7812
|
* @return {boolean}
|
|
7753
7813
|
*/
|
|
7754
7814
|
proto.pulumirpc.ResourceHookRequest.prototype.hasNewOutputs = function() {
|
|
7755
|
-
return jspb.Message.getField(this,
|
|
7815
|
+
return jspb.Message.getField(this, 7) != null;
|
|
7756
7816
|
};
|
|
7757
7817
|
|
|
7758
7818
|
|
|
7759
7819
|
/**
|
|
7760
|
-
* optional google.protobuf.Struct old_outputs =
|
|
7820
|
+
* optional google.protobuf.Struct old_outputs = 8;
|
|
7761
7821
|
* @return {?proto.google.protobuf.Struct}
|
|
7762
7822
|
*/
|
|
7763
7823
|
proto.pulumirpc.ResourceHookRequest.prototype.getOldOutputs = function() {
|
|
7764
7824
|
return /** @type{?proto.google.protobuf.Struct} */ (
|
|
7765
|
-
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct,
|
|
7825
|
+
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 8));
|
|
7766
7826
|
};
|
|
7767
7827
|
|
|
7768
7828
|
|
|
@@ -7771,7 +7831,7 @@ proto.pulumirpc.ResourceHookRequest.prototype.getOldOutputs = function() {
|
|
|
7771
7831
|
* @return {!proto.pulumirpc.ResourceHookRequest} returns this
|
|
7772
7832
|
*/
|
|
7773
7833
|
proto.pulumirpc.ResourceHookRequest.prototype.setOldOutputs = function(value) {
|
|
7774
|
-
return jspb.Message.setWrapperField(this,
|
|
7834
|
+
return jspb.Message.setWrapperField(this, 8, value);
|
|
7775
7835
|
};
|
|
7776
7836
|
|
|
7777
7837
|
|
|
@@ -7789,7 +7849,7 @@ proto.pulumirpc.ResourceHookRequest.prototype.clearOldOutputs = function() {
|
|
|
7789
7849
|
* @return {boolean}
|
|
7790
7850
|
*/
|
|
7791
7851
|
proto.pulumirpc.ResourceHookRequest.prototype.hasOldOutputs = function() {
|
|
7792
|
-
return jspb.Message.getField(this,
|
|
7852
|
+
return jspb.Message.getField(this, 8) != null;
|
|
7793
7853
|
};
|
|
7794
7854
|
|
|
7795
7855
|
|
package/resource.d.ts
CHANGED
|
@@ -248,6 +248,11 @@ export interface ResourceOptions {
|
|
|
248
248
|
* if specified is being deleted as well.
|
|
249
249
|
*/
|
|
250
250
|
deletedWith?: Resource;
|
|
251
|
+
/**
|
|
252
|
+
* Optional resource hooks to bind to this resource. The hooks will be
|
|
253
|
+
* invoked during certain step of the lifecycle of the resource.
|
|
254
|
+
*/
|
|
255
|
+
hooks?: ResourceHookBinding;
|
|
251
256
|
}
|
|
252
257
|
export interface CustomTimeouts {
|
|
253
258
|
/**
|
|
@@ -394,6 +399,133 @@ export interface CustomResourceOptions extends ResourceOptions {
|
|
|
394
399
|
*/
|
|
395
400
|
import?: ID;
|
|
396
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* ResourceHook is a named hook that can be registered as a resource hook.
|
|
404
|
+
*/
|
|
405
|
+
export declare class ResourceHook {
|
|
406
|
+
/**
|
|
407
|
+
* The unqiue name of the resource hook.
|
|
408
|
+
*/
|
|
409
|
+
name: string;
|
|
410
|
+
/**
|
|
411
|
+
* The function that will be called when the resource hook is triggered.
|
|
412
|
+
*/
|
|
413
|
+
callback: ResourceHookFunction;
|
|
414
|
+
/**
|
|
415
|
+
* Run the hook during dry run (preview) operations. Defaults to false.
|
|
416
|
+
*/
|
|
417
|
+
opts?: ResourceHookOptions;
|
|
418
|
+
constructor(name: string, callback: ResourceHookFunction, opts?: ResourceHookOptions);
|
|
419
|
+
static isInstance(obj: any): obj is ResourceHook;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Options for registering a resource hook.
|
|
423
|
+
*/
|
|
424
|
+
export interface ResourceHookOptions {
|
|
425
|
+
/**
|
|
426
|
+
* Run the hook during dry run (preview) operations. Defaults to false.
|
|
427
|
+
*/
|
|
428
|
+
onDryRun?: boolean;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* ResourceHookArgs represents the arguments passed to a resource hook
|
|
432
|
+
* Depending on the hook type, only some of the new/old inputs/outputs are set.
|
|
433
|
+
*
|
|
434
|
+
* | Hook Type | old_inputs | new_inputs | old_outputs | new_outputs |
|
|
435
|
+
* | ------------- | ---------- | ---------- | ----------- | ----------- |
|
|
436
|
+
* | before_create | | ✓ | | |
|
|
437
|
+
* | after_create | | ✓ | | ✓ |
|
|
438
|
+
* | before_update | ✓ | ✓ | ✓ | |
|
|
439
|
+
* | after_update | ✓ | ✓ | ✓ | ✓ |
|
|
440
|
+
* | before_delete | ✓ | | ✓ | |
|
|
441
|
+
* | after_delete | ✓ | | ✓ | |
|
|
442
|
+
*/
|
|
443
|
+
export interface ResourceHookArgs {
|
|
444
|
+
/**
|
|
445
|
+
* The URN of the resource that triggered the hook.
|
|
446
|
+
*/
|
|
447
|
+
urn: URN;
|
|
448
|
+
/**
|
|
449
|
+
* The ID of the resource that triggered the hook.
|
|
450
|
+
*/
|
|
451
|
+
id: ID;
|
|
452
|
+
/**
|
|
453
|
+
* The name of the resource that triggered the hook.
|
|
454
|
+
*/
|
|
455
|
+
name: string;
|
|
456
|
+
/**
|
|
457
|
+
* The type of the resource that triggered the hook.
|
|
458
|
+
*/
|
|
459
|
+
type: string;
|
|
460
|
+
/**
|
|
461
|
+
* The new inputs of the resource that triggered the hook.
|
|
462
|
+
*/
|
|
463
|
+
newInputs?: Record<string, any>;
|
|
464
|
+
/**
|
|
465
|
+
* The old inputs of the resource that triggered the hook.
|
|
466
|
+
*/
|
|
467
|
+
oldInputs?: Record<string, any>;
|
|
468
|
+
/**
|
|
469
|
+
* The new outputs of the resource that triggered the hook.
|
|
470
|
+
*/
|
|
471
|
+
newOutputs?: Record<string, any>;
|
|
472
|
+
/**
|
|
473
|
+
* The old outputs of the resource that triggered the hook.
|
|
474
|
+
*/
|
|
475
|
+
oldOutputs?: Record<string, any>;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* ResourceHookFunction is a function that can be registered as a resource hook.
|
|
479
|
+
*/
|
|
480
|
+
export declare type ResourceHookFunction = (args: ResourceHookArgs) => void | Promise<void>;
|
|
481
|
+
/**
|
|
482
|
+
* Binds {@link ResourceHook} instances to a resource. The resource hooks will
|
|
483
|
+
* be invoked during certain step of the lifecycle of the resource.
|
|
484
|
+
*
|
|
485
|
+
* `before_${action}` hooks that raise an exception cause the action to fail.
|
|
486
|
+
* `after_${action}` hooks that raise an exception will log a warning, but do
|
|
487
|
+
* not cause the action or the deployment to fail.
|
|
488
|
+
*
|
|
489
|
+
* When running `pulumi destroy`, `before_delete` and `after_delete` resource
|
|
490
|
+
* hooks require the operation to run with `--run-program`, to ensure that the
|
|
491
|
+
* program which defines the hooks is available.
|
|
492
|
+
*/
|
|
493
|
+
export interface ResourceHookBinding {
|
|
494
|
+
/**
|
|
495
|
+
* Hooks to be invoked before the resource is created.
|
|
496
|
+
*/
|
|
497
|
+
beforeCreate?: Array<ResourceHookFunction | ResourceHook>;
|
|
498
|
+
/**
|
|
499
|
+
* Hooks to be invoked after the resource is created.
|
|
500
|
+
*/
|
|
501
|
+
afterCreate?: Array<ResourceHookFunction | ResourceHook>;
|
|
502
|
+
/**
|
|
503
|
+
* Hooks to be invoked before the resource is updated.
|
|
504
|
+
*/
|
|
505
|
+
beforeUpdate?: Array<ResourceHookFunction | ResourceHook>;
|
|
506
|
+
/**
|
|
507
|
+
* Hooks to be invoked after the resource is updated.
|
|
508
|
+
*/
|
|
509
|
+
afterUpdate?: Array<ResourceHookFunction | ResourceHook>;
|
|
510
|
+
/**
|
|
511
|
+
* Hooks to be invoked before the resource is deleted.
|
|
512
|
+
*
|
|
513
|
+
* Note that delete hooks require that destroy operations are run with `--run-program`. Unlike other hook types,
|
|
514
|
+
* this argument requires named {@link ResourceHook} instances, and does not accept anonymous
|
|
515
|
+
* {@link ResourceHookFunction}. This is because the engine needs to be able to identify a hook when a resource is
|
|
516
|
+
* deleted.
|
|
517
|
+
*/
|
|
518
|
+
beforeDelete?: Array<ResourceHook>;
|
|
519
|
+
/**
|
|
520
|
+
* Hooks to be invoked after the resource is deleted.
|
|
521
|
+
*
|
|
522
|
+
* Note that delete hooks require that destroy operations are run with `--run-program`. Unlike other hook types,
|
|
523
|
+
* this argument requires named {@link ResourceHook} instances, and does not accept anonymous
|
|
524
|
+
* {@link ResourceHookFunction}. This is because the engine needs to be able to identify a hook when a resource is
|
|
525
|
+
* deleted.
|
|
526
|
+
*/
|
|
527
|
+
afterDelete?: Array<ResourceHook>;
|
|
528
|
+
}
|
|
397
529
|
/**
|
|
398
530
|
* {@link ComponentResourceOptions} is a bag of optional settings that control a
|
|
399
531
|
* component resource's behavior.
|