@pulumi/cloudamqp 3.25.0-alpha.1766554038 → 3.25.0

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/nodeActions.d.ts CHANGED
@@ -1,27 +1,29 @@
1
1
  import * as pulumi from "@pulumi/pulumi";
2
2
  /**
3
- * This resource allows you to invoke actions on a specific node.
3
+ * This resource allows you to invoke actions on specific nodes or the entire cluster. Actions can target individual nodes, multiple nodes, or all nodes in the cluster at once.
4
4
  *
5
5
  * Only available for dedicated subscription plans.
6
6
  *
7
+ * > **Note:** From version 1.41.0, this resource supports cluster-level actions (`cluster.start`, `cluster.stop`, `cluster.restart`) and the `nodeNames` list attribute for targeting multiple nodes. The `nodeName` attribute is deprecated in favor of `nodeNames`.
8
+ *
7
9
  * ## Example Usage
8
10
  *
9
11
  * <details>
10
12
  * <summary>
11
13
  * <b>
12
- * <i>Already know the node identifier (e.g. from state file)</i>
14
+ * <i>Cluster-wide broker restart (recommended for v1.41.0+)</i>
13
15
  * </b>
14
16
  * </summary>
15
17
  *
18
+ * Restart the broker on all nodes of the cluster at once. Making sure the broker is stopped and started in correct order. This is the simplest approach for cluster-wide operations.
19
+ *
16
20
  * ```typescript
17
21
  * import * as pulumi from "@pulumi/pulumi";
18
22
  * import * as cloudamqp from "@pulumi/cloudamqp";
19
23
  *
20
- * // New recipient to receieve notifications
21
- * const nodeAction = new cloudamqp.NodeActions("node_action", {
24
+ * const clusterRestart = new cloudamqp.NodeActions("cluster_restart", {
22
25
  * instanceId: instance.id,
23
- * nodeName: "<node name>",
24
- * action: "restart",
26
+ * action: "cluster.restart",
25
27
  * });
26
28
  * ```
27
29
  *
@@ -30,42 +32,51 @@ import * as pulumi from "@pulumi/pulumi";
30
32
  * <details>
31
33
  * <summary>
32
34
  * <b>
33
- * <i>Multi node RabbitMQ restart</i>
35
+ * <i>Restart broker on specific nodes using node_names</i>
34
36
  * </b>
35
37
  * </summary>
36
38
  *
37
- * Using data source `cloudamqp.getNodes` to restart RabbitMQ on all nodes.
38
- *
39
- * > **Note:** RabbitMQ restart on multiple nodes need to be chained, let one node restart at the time.
39
+ * Target specific nodes using the `nodeNames` list attribute.
40
40
  *
41
41
  * ```typescript
42
42
  * import * as pulumi from "@pulumi/pulumi";
43
43
  * import * as cloudamqp from "@pulumi/cloudamqp";
44
44
  *
45
- * const listNodes = cloudamqp.getNodes({
45
+ * const nodes = cloudamqp.getNodes({
46
46
  * instanceId: instance.id,
47
47
  * });
48
- * const restart01 = new cloudamqp.NodeActions("restart_01", {
48
+ * const restartSubset = new cloudamqp.NodeActions("restart_subset", {
49
49
  * instanceId: instance.id,
50
50
  * action: "restart",
51
- * nodeName: listNodes.then(listNodes => listNodes.nodes?.[0]?.name),
51
+ * nodeNames: [
52
+ * nodes.then(nodes => nodes.nodes?.[0]?.name),
53
+ * nodes.then(nodes => nodes.nodes?.[1]?.name),
54
+ * ],
52
55
  * });
53
- * const restart02 = new cloudamqp.NodeActions("restart_02", {
56
+ * ```
57
+ *
58
+ * </details>
59
+ *
60
+ * <details>
61
+ * <summary>
62
+ * <b>
63
+ * <i>Reboot a single node</i>
64
+ * </b>
65
+ * </summary>
66
+ *
67
+ * Reboot the entire node (VM) rather than just the broker.
68
+ *
69
+ * ```typescript
70
+ * import * as pulumi from "@pulumi/pulumi";
71
+ * import * as cloudamqp from "@pulumi/cloudamqp";
72
+ *
73
+ * const nodes = cloudamqp.getNodes({
54
74
  * instanceId: instance.id,
55
- * action: "restart",
56
- * nodeName: listNodes.then(listNodes => listNodes.nodes?.[1]?.name),
57
- * }, {
58
- * dependsOn: [restart01],
59
75
  * });
60
- * const restart03 = new cloudamqp.NodeActions("restart_03", {
76
+ * const rebootNode = new cloudamqp.NodeActions("reboot_node", {
61
77
  * instanceId: instance.id,
62
- * action: "restart",
63
- * nodeName: listNodes.then(listNodes => listNodes.nodes?.[2]?.name),
64
- * }, {
65
- * dependsOn: [
66
- * restart01,
67
- * restart02,
68
- * ],
78
+ * action: "reboot",
79
+ * nodeNames: [nodes.then(nodes => nodes.nodes?.[0]?.name)],
69
80
  * });
70
81
  * ```
71
82
  *
@@ -74,37 +85,99 @@ import * as pulumi from "@pulumi/pulumi";
74
85
  * <details>
75
86
  * <summary>
76
87
  * <b>
77
- * <i>Combine log level configuration change with multi node RabbitMQ restart</i>
88
+ * <i>Restart RabbitMQ management interface</i>
78
89
  * </b>
79
90
  * </summary>
80
91
  *
92
+ * Only restart the management interface without affecting the broker.
93
+ *
81
94
  * ```typescript
82
95
  * import * as pulumi from "@pulumi/pulumi";
83
96
  * import * as cloudamqp from "@pulumi/cloudamqp";
84
97
  *
85
- * const listNodes = cloudamqp.getNodes({
98
+ * const nodes = cloudamqp.getNodes({
99
+ * instanceId: instance.id,
100
+ * });
101
+ * const mgmtRestart = new cloudamqp.NodeActions("mgmt_restart", {
86
102
  * instanceId: instance.id,
103
+ * action: "mgmt.restart",
104
+ * nodeNames: [nodes.then(nodes => nodes.nodes?.[0]?.name)],
87
105
  * });
106
+ * ```
107
+ *
108
+ * </details>
109
+ *
110
+ * <details>
111
+ * <summary>
112
+ * <b>
113
+ * <i>Combine with configuration changes</i>
114
+ * </b>
115
+ * </summary>
116
+ *
117
+ * Apply configuration changes and restart the cluster.
118
+ *
119
+ * ```typescript
120
+ * import * as pulumi from "@pulumi/pulumi";
121
+ * import * as cloudamqp from "@pulumi/cloudamqp";
122
+ *
88
123
  * const rabbitmqConfig = new cloudamqp.RabbitConfiguration("rabbitmq_config", {
89
124
  * instanceId: instance.id,
90
125
  * logExchangeLevel: "info",
91
126
  * });
127
+ * const clusterRestart = new cloudamqp.NodeActions("cluster_restart", {
128
+ * instanceId: instance.id,
129
+ * action: "cluster.restart",
130
+ * }, {
131
+ * dependsOn: [rabbitmqConfig],
132
+ * });
133
+ * ```
134
+ *
135
+ * </details>
136
+ *
137
+ * <details>
138
+ * <summary>
139
+ * <b>
140
+ * <i>Legacy Usage (pre-1.41.0)</i>
141
+ * </b>
142
+ * </summary>
143
+ *
144
+ * These examples show the older approach using `nodeName` (singular) and chained restarts. While still supported, the cluster-level actions above are recommended for new configurations.
145
+ *
146
+ * **Single node restart:**
147
+ *
148
+ * ```typescript
149
+ * import * as pulumi from "@pulumi/pulumi";
150
+ * import * as cloudamqp from "@pulumi/cloudamqp";
151
+ *
152
+ * const nodeAction = new cloudamqp.NodeActions("node_action", {
153
+ * instanceId: instance.id,
154
+ * nodeName: "<node name>",
155
+ * action: "restart",
156
+ * });
157
+ * ```
158
+ *
159
+ * **Chained multi-node restart:**
160
+ *
161
+ * > **Note:** This approach restarts nodes sequentially to minimize cluster disruption. Consider using `cluster.restart` for simpler configuration.
162
+ *
163
+ * ```typescript
164
+ * import * as pulumi from "@pulumi/pulumi";
165
+ * import * as cloudamqp from "@pulumi/cloudamqp";
166
+ *
167
+ * const listNodes = cloudamqp.getNodes({
168
+ * instanceId: instance.id,
169
+ * });
92
170
  * const restart01 = new cloudamqp.NodeActions("restart_01", {
93
171
  * instanceId: instance.id,
94
172
  * action: "restart",
95
173
  * nodeName: listNodes.then(listNodes => listNodes.nodes?.[0]?.name),
96
- * }, {
97
- * dependsOn: [rabbitmqConfig],
98
174
  * });
99
175
  * const restart02 = new cloudamqp.NodeActions("restart_02", {
100
176
  * instanceId: instance.id,
101
177
  * action: "restart",
102
178
  * nodeName: listNodes.then(listNodes => listNodes.nodes?.[1]?.name),
103
179
  * }, {
104
- * dependsOn: [
105
- * rabbitmqConfig,
106
- * restart01,
107
- * ],
180
+ * dependsOn: [restart01],
108
181
  * });
109
182
  * const restart03 = new cloudamqp.NodeActions("restart_03", {
110
183
  * instanceId: instance.id,
@@ -112,7 +185,6 @@ import * as pulumi from "@pulumi/pulumi";
112
185
  * nodeName: listNodes.then(listNodes => listNodes.nodes?.[2]?.name),
113
186
  * }, {
114
187
  * dependsOn: [
115
- * rabbitmqConfig,
116
188
  * restart01,
117
189
  * restart02,
118
190
  * ],
@@ -123,29 +195,49 @@ import * as pulumi from "@pulumi/pulumi";
123
195
  *
124
196
  * ## Action reference
125
197
  *
126
- * Valid actions for ***LavinMQ***.
198
+ * Actions are categorized by what they affect:
199
+ *
200
+ * ### Broker Actions
201
+ *
202
+ * These actions control the message broker software (RabbitMQ or LavinMQ) on the specified nodes.
203
+ *
204
+ * | Action | Info | Applies to |
205
+ * |---------|-------------------------------------------|-------------------|
206
+ * | start | Start the message broker | RabbitMQ, LavinMQ |
207
+ * | stop | Stop the message broker | RabbitMQ, LavinMQ |
208
+ * | restart | Restart the message broker | RabbitMQ, LavinMQ |
209
+ *
210
+ * ### Management Interface Actions
211
+ *
212
+ * These actions control the management interface without affecting the broker itself.
213
+ *
214
+ * | Action | Info | Applies to |
215
+ * |--------------|-------------------------------------------|------------|
216
+ * | mgmt.restart | Restart the RabbitMQ management interface | RabbitMQ |
217
+ *
218
+ * ### Node Actions
127
219
  *
128
- * | Action | Info |
129
- * |--------------|------------------------------------|
130
- * | start | Start LavinMQ |
131
- * | stop | Stop LavinMQ |
132
- * | restart | Restart LavinMQ |
133
- * | reboot | Reboot the node |
220
+ * These actions affect the entire node (VM), not just the broker software.
134
221
  *
135
- * Valid actions for ***RabbitMQ***.
222
+ * | Action | Info | Applies to |
223
+ * |--------|-----------------------------------------------|-------------------|
224
+ * | reboot | Reboot the entire node (VM) | RabbitMQ, LavinMQ |
136
225
  *
137
- * | Action | Info |
138
- * |--------------|------------------------------------|
139
- * | start | Start RabbitMQ |
140
- * | stop | Stop RabbitMQ |
141
- * | restart | Restart RabbitMQ |
142
- * | reboot | Reboot the node |
143
- * | mgmt.restart | Restart the RabbitMQ mgmt interace |
226
+ * ### Cluster Actions
227
+ *
228
+ * > **Available from version 1.41.0**
229
+ *
230
+ * These actions operate on all nodes in the cluster simultaneously. The `nodeNames` attribute can be omitted for these actions.
231
+ *
232
+ * | Action | Info | Applies to |
233
+ * |-----------------|-------------------------------------------------|-------------------|
234
+ * | cluster.start | Start the message broker on all cluster nodes | RabbitMQ, LavinMQ |
235
+ * | cluster.stop | Stop the message broker on all cluster nodes | RabbitMQ, LavinMQ |
236
+ * | cluster.restart | Restart the message broker on all cluster nodes | RabbitMQ, LavinMQ |
144
237
  *
145
238
  * ## Dependency
146
239
  *
147
- * This resource depends on CloudAMQP instance identifier, `cloudamqp_instance.instance.id` and node
148
- * name.
240
+ * This resource depends on CloudAMQP instance identifier, `cloudamqp_instance.instance.id`. For non-cluster actions, it also requires either `nodeName` or `nodeNames` to specify which nodes to act upon. Cluster-level actions automatically apply to all nodes in the cluster.
149
241
  *
150
242
  * ## Import
151
243
  *
@@ -168,7 +260,7 @@ export declare class NodeActions extends pulumi.CustomResource {
168
260
  */
169
261
  static isInstance(obj: any): obj is NodeActions;
170
262
  /**
171
- * The action to invoke on the node.
263
+ * The action to invoke. See Action reference below for valid values.
172
264
  */
173
265
  readonly action: pulumi.Output<string>;
174
266
  /**
@@ -176,13 +268,25 @@ export declare class NodeActions extends pulumi.CustomResource {
176
268
  */
177
269
  readonly instanceId: pulumi.Output<number>;
178
270
  /**
179
- * The node name, e.g `green-guinea-pig-01`.
271
+ * The node name, e.g. `green-guinea-pig-01`. Use `nodeNames` instead. This attribute will be removed in a future version.
272
+ *
273
+ * @deprecated Use nodeNames instead. This attribute will be removed in a future version.
274
+ */
275
+ readonly nodeName: pulumi.Output<string | undefined>;
276
+ /**
277
+ * List of node names to perform the action on, e.g. `["green-guinea-pig-01", "green-guinea-pig-02"]`. For cluster-level actions (`cluster.start`, `cluster.stop`, `cluster.restart`), this can be omitted and the action will automatically apply to all nodes.
278
+ */
279
+ readonly nodeNames: pulumi.Output<string[] | undefined>;
280
+ /**
281
+ * Sleep interval in seconds between polling for node status. Default: `10`.
180
282
  */
181
- readonly nodeName: pulumi.Output<string>;
283
+ readonly sleep: pulumi.Output<number>;
182
284
  /**
183
- * If the node is running.
285
+ * Timeout in seconds for the action to complete. Default: `1800` (30 minutes).
286
+ *
287
+ * > **Note:** Either `nodeName` or `nodeNames` must be specified for non-cluster actions. Cluster actions (`cluster.start`, `cluster.stop`, `cluster.restart`) can omit both and will automatically target all nodes.
184
288
  */
185
- readonly running: pulumi.Output<boolean>;
289
+ readonly timeout: pulumi.Output<number>;
186
290
  /**
187
291
  * Create a NodeActions resource with the given unique name, arguments, and options.
188
292
  *
@@ -197,7 +301,7 @@ export declare class NodeActions extends pulumi.CustomResource {
197
301
  */
198
302
  export interface NodeActionsState {
199
303
  /**
200
- * The action to invoke on the node.
304
+ * The action to invoke. See Action reference below for valid values.
201
305
  */
202
306
  action?: pulumi.Input<string>;
203
307
  /**
@@ -205,20 +309,32 @@ export interface NodeActionsState {
205
309
  */
206
310
  instanceId?: pulumi.Input<number>;
207
311
  /**
208
- * The node name, e.g `green-guinea-pig-01`.
312
+ * The node name, e.g. `green-guinea-pig-01`. Use `nodeNames` instead. This attribute will be removed in a future version.
313
+ *
314
+ * @deprecated Use nodeNames instead. This attribute will be removed in a future version.
209
315
  */
210
316
  nodeName?: pulumi.Input<string>;
211
317
  /**
212
- * If the node is running.
318
+ * List of node names to perform the action on, e.g. `["green-guinea-pig-01", "green-guinea-pig-02"]`. For cluster-level actions (`cluster.start`, `cluster.stop`, `cluster.restart`), this can be omitted and the action will automatically apply to all nodes.
319
+ */
320
+ nodeNames?: pulumi.Input<pulumi.Input<string>[]>;
321
+ /**
322
+ * Sleep interval in seconds between polling for node status. Default: `10`.
213
323
  */
214
- running?: pulumi.Input<boolean>;
324
+ sleep?: pulumi.Input<number>;
325
+ /**
326
+ * Timeout in seconds for the action to complete. Default: `1800` (30 minutes).
327
+ *
328
+ * > **Note:** Either `nodeName` or `nodeNames` must be specified for non-cluster actions. Cluster actions (`cluster.start`, `cluster.stop`, `cluster.restart`) can omit both and will automatically target all nodes.
329
+ */
330
+ timeout?: pulumi.Input<number>;
215
331
  }
216
332
  /**
217
333
  * The set of arguments for constructing a NodeActions resource.
218
334
  */
219
335
  export interface NodeActionsArgs {
220
336
  /**
221
- * The action to invoke on the node.
337
+ * The action to invoke. See Action reference below for valid values.
222
338
  */
223
339
  action: pulumi.Input<string>;
224
340
  /**
@@ -226,7 +342,23 @@ export interface NodeActionsArgs {
226
342
  */
227
343
  instanceId: pulumi.Input<number>;
228
344
  /**
229
- * The node name, e.g `green-guinea-pig-01`.
345
+ * The node name, e.g. `green-guinea-pig-01`. Use `nodeNames` instead. This attribute will be removed in a future version.
346
+ *
347
+ * @deprecated Use nodeNames instead. This attribute will be removed in a future version.
348
+ */
349
+ nodeName?: pulumi.Input<string>;
350
+ /**
351
+ * List of node names to perform the action on, e.g. `["green-guinea-pig-01", "green-guinea-pig-02"]`. For cluster-level actions (`cluster.start`, `cluster.stop`, `cluster.restart`), this can be omitted and the action will automatically apply to all nodes.
352
+ */
353
+ nodeNames?: pulumi.Input<pulumi.Input<string>[]>;
354
+ /**
355
+ * Sleep interval in seconds between polling for node status. Default: `10`.
356
+ */
357
+ sleep?: pulumi.Input<number>;
358
+ /**
359
+ * Timeout in seconds for the action to complete. Default: `1800` (30 minutes).
360
+ *
361
+ * > **Note:** Either `nodeName` or `nodeNames` must be specified for non-cluster actions. Cluster actions (`cluster.start`, `cluster.stop`, `cluster.restart`) can omit both and will automatically target all nodes.
230
362
  */
231
- nodeName: pulumi.Input<string>;
363
+ timeout?: pulumi.Input<number>;
232
364
  }