@pulumi/newrelic 5.72.0 → 5.72.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulumi/newrelic",
3
- "version": "5.72.0",
3
+ "version": "5.72.1",
4
4
  "description": "A Pulumi package for creating and managing New Relic resources.",
5
5
  "keywords": [
6
6
  "pulumi",
@@ -23,6 +23,6 @@
23
23
  "pulumi": {
24
24
  "resource": true,
25
25
  "name": "newrelic",
26
- "version": "5.72.0"
26
+ "version": "5.72.1"
27
27
  }
28
28
  }
@@ -2,185 +2,271 @@ import * as pulumi from "@pulumi/pulumi";
2
2
  /**
3
3
  * Use this resource to create and manage New Relic Workflow Automation.
4
4
  *
5
- * Workflow Automation allows you to define automated workflows using YAML definitions. These workflows can be scoped to either an account or an organization and support various automation steps and configurations.
5
+ * Workflow Automation allows you to define automated workflows using YAML definitions. These workflows can scope to either an account or an organization and support various automation steps and configurations.
6
6
  *
7
7
  * ## Example Usage
8
8
  *
9
9
  * ### Basic Workflow Automation with ACCOUNT Scope
10
10
  *
11
+ * ```typescript
12
+ * import * as pulumi from "@pulumi/pulumi";
13
+ * import * as newrelic from "@pulumi/newrelic";
14
+ *
15
+ * const testQuery = new newrelic.WorkflowAutomation("test_query", {
16
+ * name: "test_query_workflow",
17
+ * scopeId: "your-account-id",
18
+ * scopeType: "ACCOUNT",
19
+ * definition: `name: test_query_workflow
20
+ * description: Simple workflow that queries NRDB and waits
21
+ * steps:
22
+ * - name: queryNrdb
23
+ * type: action
24
+ * action: newrelic.nrdb.query
25
+ * version: 1
26
+ * inputs:
27
+ * query: SELECT count(*) from Log LIMIT 10
28
+ * - name: wait
29
+ * type: wait
30
+ * seconds: 3
31
+ * signals: []
32
+ * next: end
33
+ * `,
34
+ * });
35
+ * ```
36
+ *
11
37
  * ### Workflow Automation with ORGANIZATION Scope
12
38
  *
13
- * ### Advanced Workflow: CCU Governance and Monitoring
39
+ * ```typescript
40
+ * import * as pulumi from "@pulumi/pulumi";
41
+ * import * as newrelic from "@pulumi/newrelic";
42
+ *
43
+ * const orgQuery = new newrelic.WorkflowAutomation("org_query", {
44
+ * name: "org_query_workflow",
45
+ * scopeId: "your-organization-id",
46
+ * scopeType: "ORGANIZATION",
47
+ * definition: `name: org_query_workflow
48
+ * description: Organization-level workflow that queries NRDB
49
+ * steps:
50
+ * - name: queryNrdb
51
+ * type: action
52
+ * action: newrelic.nrdb.query
53
+ * version: 1
54
+ * inputs:
55
+ * query: SELECT count(*) from Transaction LIMIT 10
56
+ * - name: wait
57
+ * type: wait
58
+ * seconds: 5
59
+ * signals: []
60
+ * next: end
61
+ * `,
62
+ * });
63
+ * ```
14
64
  *
15
- * This example demonstrates a production-grade workflow for monitoring and governing Compute Capacity Unit (CCU) consumption with input validation, email notifications, and event tracking:
65
+ * ## [YAML Definition Structure](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/definition-schema/)
16
66
  *
17
- * ## YAML Definition Structure
67
+ * The `definition` argument accepts a YAML string that defines the workflow's structure and logic.
18
68
  *
19
- * The `definition` argument accepts a YAML string that defines the workflow automation. The YAML must include the following fields:
69
+ * ### Top-Level Fields
20
70
  *
21
- * ### Required Fields
71
+ * | Field | Type | Required | Description |
72
+ * | ----- | ----- | ----- | ----- |
73
+ * | `name` | String | Yes | The name of the workflow. Must match the `name` argument in the Terraform resource. |
74
+ * | `description` | String | No | A brief summary of what the workflow does. Recommended for clarity. |
75
+ * | `workflowInputs` | Object | No | A map of input variables that can be passed to the workflow at runtime. |
76
+ * | `steps` | Array | Yes | An ordered array of step objects that define the workflow's logic. |
22
77
  *
23
- * * `name` - (Required) The name of the workflow. This **must** match the `name` argument in the Terraform resource.
24
- * * `description` - (Optional but recommended) A description of what the workflow automation does.
25
- * * `steps` - (Required) An array of steps that define the workflow automation logic.
78
+ * ***
26
79
  *
27
80
  * ### Workflow Inputs
28
81
  *
29
- * Workflows can define inputs that can be passed when the workflow is executed:
82
+ * Define inputs to make your workflows more flexible and reusable.
30
83
  *
31
- * Inputs can reference secrets using the syntax: `${{ :secrets:secretName }}`
84
+ * * Inputs can reference secrets using the syntax: `${{ :secrets:secretName }}`
32
85
  *
33
- * #### Input Validation
86
+ * #### Input Validation Types
34
87
  *
35
88
  * Workflow inputs support various validation types to ensure data integrity:
36
89
  *
37
- * **Regex Validation:**
90
+ * * [Regex Validation:](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/definition-schema/#validation-types)
91
+ *
92
+ * * Integer Range Validation:
38
93
  *
39
- * **Integer Range Validation:**
94
+ * **Note**: By default, integer variables accept both positive and negative values. If you define a *minIntValue* validation, the field rejects any value below that threshold. For example, setting *minIntValue: 0* prevents negative integers from being entered.
40
95
  *
41
- * **List Type:**
96
+ * * List Type:
42
97
  *
43
- * ### Step Types
98
+ * **Note**: This list is case sensitive.
44
99
  *
45
- * Each step in the `steps` array can be of different types:
100
+ * **Step Types**
101
+ *
102
+ * Each object in the `steps` array defines a single unit of work. The primary step types are [`action`, `wait`, `switch`, and `loop`.](https://docs.newrelic.com/docs/workflow-automation/create-a-workflow-automation/create-your-own/#core-concepts)
46
103
  *
47
104
  * #### Action Steps
48
105
  *
49
- * Action steps execute specific actions like querying NRDB, transforming data, or sending notifications:
106
+ * Executes a specific function, such as querying data or sending a notification.
50
107
  *
51
- * * `type: action` - Executes an action
52
- * * `action` - The action to execute (e.g., `newrelic.nrdb.query`, `utils.transform.toCSV`, `slack.chat.postMessage`)
53
- * * `version` - The version of the action to use
54
- * * `inputs` - Input parameters for the action
108
+ * * `type: action` \- Defines the step as an action.
109
+ * * `action` \- The specific action to execute (example, `newrelic.nrdb.query`).
110
+ * * `version` \- The version of the action to use.
111
+ * * `inputs` \- A map of input parameters for the action.
55
112
  *
56
- * Common actions include:
57
- * - `newrelic.nrdb.query` - Query New Relic database
58
- * - `utils.transform.toCSV` - Transform data to CSV format
59
- * - `slack.chat.postMessage` - Send messages to Slack
60
- * - And many more...
113
+ * Example:
61
114
  *
62
- * #### Wait Steps
115
+ * **Common actions include:**
63
116
  *
64
- * * `type: wait` - Pauses the workflow execution
65
- * * `seconds` - Number of seconds to wait
66
- * * `signals` - Optional array of signals to wait for
67
- * * `next` - Optional next step name (use "end" to terminate)
117
+ * * `newrelic.nrdb.query` \- Query New Relic database
118
+ * * `utils.transform.toCSV` \- Transform data to CSV format
119
+ * * `slack.chat.postMessage` \- Send messages to Slack
68
120
  *
69
- * #### Switch Steps
121
+ * **Available actions**
122
+ * A complete list of available actions, their versions, and required inputs can be found in the [**Workflow Action Catalog**](https://docs.newrelic.com/docs/workflow-automation/actions-catalog/).
70
123
  *
71
- * * `type: switch` - Conditional branching based on expressions
72
- * * `switch` - Array of conditions to evaluate
73
- * * `condition` - Expression to evaluate (uses JQ syntax)
74
- * * `next` - Step to execute if condition is true
75
- * * `next` - Default step if no conditions match
124
+ * #### Wait steps
76
125
  *
77
- * #### Loop Steps
126
+ * Pauses the workflow for a specified duration or until it receives a signal.
78
127
  *
79
- * * `type: loop` - Repeats a set of steps
80
- * * `for.in` - Expression defining the iteration (e.g., `${{ [range(1; 30)] }}`)
81
- * * `steps` - Array of steps to execute in each iteration
82
- * * Steps can use `next: break` to exit the loop early
128
+ * * `type: wait`
129
+ * * `seconds` \- The number of seconds to pause.
130
+ * * `signals` \- (Optional) An array of signals to wait for. See [SignalWorkflowRun](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/signal-workflow-run/) for more information
131
+ * * `next` \- (Optional) The name of the next step. Use `end` to terminate the workflow.
83
132
  *
84
- * ### Referencing Data in Workflows
133
+ * Example:
85
134
  *
86
- * You can reference data from previous steps and inputs using template expressions:
135
+ * #### Switch steps
87
136
  *
88
- * * Workflow inputs: `${{ .workflowInputs.inputName }}`
89
- * * Step outputs: `${{ .steps.stepName.outputs.fieldName }}`
90
- * * Secrets: `${{ :secrets:secretName }}`
137
+ * Provides conditional branching logic.
91
138
  *
92
- * ### Example YAML Structure
139
+ * * `type: switch`
140
+ * * `switch` \- An array of conditions to evaluate in order.
141
+ * * `condition` \- A JQ expression that evaluates to `true` or `false`.
142
+ * * `next` \- The name of the step to execute if the condition is true. The `switch` block can also have a top-level `next` field to define the default step if no conditions match.
93
143
  *
94
- * **Simple workflow with query and wait:**
144
+ * Example:
95
145
  *
96
- * **Advanced workflow with inputs and multiple actions:**
146
+ * #### Loop steps
97
147
  *
98
- * ## Important Notes
148
+ * Iterates over a set of values and executes a sequence of steps for each iteration.
99
149
  *
100
- * ### Name Consistency
150
+ * * `type: loop`
151
+ * * `for.in` \- A JQ expression that returns an array to iterate over.
152
+ * * `steps` \- An array of steps to execute for each iteration. Inside the loop, you can use `next: continue` to skip to the next iteration or `next: break` to exit the loop.
101
153
  *
102
- * The `name` field in the Terraform resource **must** match the `name` field in the YAML definition. If they don't match, Terraform will return an error during plan or apply.
154
+ * Example:
103
155
  *
104
- * For example, this configuration is **correct**:
156
+ * ***
105
157
  *
106
- * This configuration is **incorrect** and will fail:
158
+ * ### Referencing Data in Workflows
107
159
  *
108
- * ### Scope Types
160
+ * You can dynamically reference data from inputs, secrets, and other steps using JQ-like template expressions.
109
161
  *
110
- * * **ACCOUNT** - The workflow automation is scoped to a specific New Relic account. Use your numeric account ID as the `scopeId`.
111
- * * **ORGANIZATION** - The workflow automation is scoped to your entire New Relic organization. Use your organization ID string as the `scopeId`.
162
+ * | Data Source | Syntax | Example |
163
+ * | ----- | ----- | ----- |
164
+ * | **Workflow Inputs** | `${{ .workflowInputs.inputName }}` | `${{ .workflowInputs.ccuThreshold }}` |
165
+ * | **Step Outputs** | `${{ .steps.stepName.outputs.fieldName }}` | `${{ .steps.query1.outputs.results }}` |
166
+ * | **Loop Elements** | `${{ .steps.loopStepName.loop.element }}` | `${{ .steps.loopStep1.loop.element.email }}` |
167
+ * | **Secrets** | `${{ :secrets:secretName }}` | `${{ :secrets:myApiKey }}` |
112
168
  *
113
- * ### ForceNew Attributes
169
+ * ***
114
170
  *
115
- * The following attributes will force a new resource to be created if changed:
116
- * * `name` - Changing the workflow name creates a new workflow.
117
- * * `scopeId` - Changing the scope ID creates a new workflow.
118
- * * `scopeType` - Changing between ACCOUNT and ORGANIZATION creates a new workflow.
171
+ * ### Example YAML Structure
119
172
  *
120
- * ### YAML Validation
173
+ * Simple workflow with query and wait:
121
174
  *
122
- * The provider validates the YAML definition during plan and apply operations:
123
- * * The YAML must be valid and parseable.
124
- * * The `name` field must be present in the YAML.
125
- * * The `name` in the YAML must match the Terraform resource `name`.
175
+ * Advanced workflow with inputs and multiple actions:
126
176
  *
127
- * Invalid YAML or missing required fields will result in an error.
177
+ * ## Important note
128
178
  *
129
- * ## Additional Information
179
+ * ### Name Consistency
130
180
  *
131
- * For more details about New Relic Workflow Automation, please refer to the [New Relic Workflow Automation documentation](https://docs.newrelic.com/docs/workflow-automation/).
181
+ * The `name` field in the Terraform resource must match the name field in the YAML definition. If they don't match, Terraform will return an error during `terraform validate`, `plan`, or `apply`.
132
182
  *
133
- * ### Versioning
183
+ * Example Error Message:
134
184
  *
135
- * Each time you update the `definition` of a workflow automation, New Relic automatically increments the `version` attribute. This allows you to track changes to your workflow automation over time.
185
+ * For example, this configuration is **correct**:
136
186
  *
137
- * ### Best Practices
187
+ * ```typescript
188
+ * import * as pulumi from "@pulumi/pulumi";
189
+ * import * as newrelic from "@pulumi/newrelic";
190
+ *
191
+ * const example = new newrelic.WorkflowAutomation("example", {
192
+ * name: "my-workflow",
193
+ * scopeId: "1234567",
194
+ * scopeType: "ACCOUNT",
195
+ * definition: `name: my-workflow # This matches the resource name
196
+ * description: Example workflow
197
+ * steps:
198
+ * - name: waitStep
199
+ * type: wait
200
+ * seconds: 10
201
+ * `,
202
+ * });
203
+ * ```
138
204
  *
139
- * 1. **Use Heredoc Syntax**: For multi-line YAML definitions, use the heredoc syntax (`<<-YAML ... YAML`) for better readability.
205
+ * This configuration is **incorrect** and will fail:
140
206
  *
141
- * 2. **External YAML Files**: For complex workflows, consider storing your YAML in separate files and using Terraform's `file()` or `templatefile()` functions:
207
+ * ```typescript
208
+ * import * as pulumi from "@pulumi/pulumi";
209
+ * import * as newrelic from "@pulumi/newrelic";
210
+ *
211
+ * const example = new newrelic.WorkflowAutomation("example", {
212
+ * name: "my-workflow",
213
+ * scopeId: "1234567",
214
+ * scopeType: "ACCOUNT",
215
+ * definition: `name: different-name # This doesn't match the resource name - ERROR!
216
+ * description: Example workflow
217
+ * steps:
218
+ * - name: waitStep
219
+ * type: wait
220
+ * seconds: 10
221
+ * `,
222
+ * });
223
+ * ```
142
224
  *
143
- * 3. **Version Control**: Store your workflow YAML definitions in version control alongside your Terraform configuration.
225
+ * ### Scope type
144
226
  *
145
- * 4. **Testing**: Test workflow automation changes in a non-production account before applying to production.
227
+ * * **ACCOUNT** \- The workflow automation is scoped to a specific New Relic account. Use your numeric account ID as the `scopeId`.
228
+ * * **ORGANIZATION** \- The workflow automation is scoped to your entire New Relic organization. Use your organization ID string as the `scopeId`.
146
229
  *
147
- * 5. **Naming Conventions**: Use consistent naming conventions for your workflows to make them easier to manage and identify.
230
+ * See, [Create accounts and organizations](https://docs.newrelic.com/docs/accounts/accounts-billing/account-structure/multi-tenancy/org-creation/) on how to create an account or an organization.
148
231
  *
149
- * ### Troubleshooting
232
+ * ### ForceNew attributes
150
233
  *
151
- * #### Name Mismatch Error
234
+ * The following attributes, when changed, will force creation of a new resource :
152
235
  *
153
- * If you receive an error like "name in resource configuration does not match name in YAML definition", ensure that:
154
- * * The `name` attribute in your Terraform resource matches exactly with the `name` field in your YAML definition.
155
- * * There are no extra spaces or different capitalization between the two names.
236
+ * * `name` \- Changing the workflow name creates a new resource.
237
+ * * `scopeId` \- Changing the scope ID creates a new resource.
238
+ * * `scopeType` \- Changing between **ACCOUNT** and **ORGANIZATION** creates a new resource.
156
239
  *
157
- * #### Scope ID Format Error
240
+ * ### YAML validation
158
241
  *
159
- * If you receive an error about invalid scopeId format for ACCOUNT scope:
160
- * * Ensure your account ID is numeric (e.g., "1234567", not "account-1234567").
161
- * * For ACCOUNT scope, the scopeId should be a string representation of your numeric account ID.
242
+ * The provider validates the YAML definition during plan-and-apply operations:
162
243
  *
163
- * #### Invalid YAML Error
244
+ * * The YAML must be valid and parsable.
245
+ * * The `name` field must be present in the YAML.
246
+ * * The `name` in the YAML must match the Terraform resource name.
164
247
  *
165
- * If you receive a YAML parsing error:
166
- * * Validate your YAML syntax using a YAML validator.
167
- * * Ensure proper indentation (YAML is indentation-sensitive).
168
- * * Check that all required fields are present.
248
+ * Invalid YAML or missing required fields will result in an error.
249
+ *
250
+ * Example YAML validation errors:
251
+ *
252
+ * YAML Validation Error
253
+ * 1. *waitStep* has invalid type "waitAgain". Valid types are:
254
+ * action, loop, switch, wait, assign
169
255
  *
170
- * ## See Also
256
+ * 2. Workflow definition names can not be changed.
171
257
  *
172
- * * [New Relic Workflow Automation Documentation](https://docs.newrelic.com/docs/workflow-automation/)
258
+ * ### *Versioning*
259
+ *
260
+ * Each time you update the `definition` of a workflow automation, New Relic automatically increments the `version` attribute. This allows you to track changes to your workflow automation over time.
173
261
  *
174
262
  * ## Import
175
263
  *
176
- * Workflow automations can be imported using the composite ID format: `<scope_type>#<scope_id>#<workflow_name>`, e.g.
264
+ * Import workflow automations using the composite ID format: `<scope_type>#<scope_id>#<workflow_name>`, for example:
177
265
  *
178
266
  * ```sh
179
267
  * $ pulumi import newrelic:index/workflowAutomation:WorkflowAutomation test_query ACCOUNT#1234567#test_query_workflow
180
268
  * ```
181
269
  *
182
- * For workflows with complex names:
183
- *
184
270
  * ```sh
185
271
  * $ pulumi import newrelic:index/workflowAutomation:WorkflowAutomation ccu_governance ACCOUNT#1234567#CCUGovernance
186
272
  * ```
@@ -208,7 +294,7 @@ export declare class WorkflowAutomation extends pulumi.CustomResource {
208
294
  */
209
295
  static isInstance(obj: any): obj is WorkflowAutomation;
210
296
  /**
211
- * The YAML definition of the workflow automation. This should be a valid YAML string that includes a `name` field matching the resource `name` argument, and defines the workflow steps and configuration.
297
+ * \- (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
212
298
  */
213
299
  readonly definition: pulumi.Output<string>;
214
300
  /**
@@ -216,23 +302,23 @@ export declare class WorkflowAutomation extends pulumi.CustomResource {
216
302
  */
217
303
  readonly definitionId: pulumi.Output<string>;
218
304
  /**
219
- * The description of the workflow automation, as defined in the YAML definition.
305
+ * \- The description of the workflow, as defined in the YAML.
220
306
  */
221
307
  readonly description: pulumi.Output<string>;
222
308
  /**
223
- * The name of the workflow automation. This must match the `name` field in the YAML definition provided in the `definition` argument. **Important**: Changes to this field will force a new resource to be created.
309
+ * \- (Required) The name of the workflow. This must match the `name` field in the YAML `definition`. **Important**: Changing this field will force a new resource to be created.
224
310
  */
225
311
  readonly name: pulumi.Output<string>;
226
312
  /**
227
- * The scope ID for the workflow automation. For `ACCOUNT` scope, this should be your New Relic account ID (numeric). For `ORGANIZATION` scope, this should be your organization ID (string). **Important**: Changes to this field will force a new resource to be created.
313
+ * \- (Required) The ID of the scope for the workflow. For `ACCOUNT` scope, this is your New Relic account ID (numeric). For `ORGANIZATION` scope, this is your organization ID (string). **Important**: Changing this field will force a new resource to be created.
228
314
  */
229
315
  readonly scopeId: pulumi.Output<string>;
230
316
  /**
231
- * The scope type for the workflow automation. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changes to this field will force a new resource to be created.
317
+ * \- (Required) The scope type for the workflow. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changing this field will force a new resource to be created.
232
318
  */
233
319
  readonly scopeType: pulumi.Output<string>;
234
320
  /**
235
- * The current version number of the workflow automation.
321
+ * \- The current version number of the workflow. This number increments with each update to the `definition`.
236
322
  */
237
323
  readonly version: pulumi.Output<number>;
238
324
  /**
@@ -253,7 +339,7 @@ export declare class WorkflowAutomation extends pulumi.CustomResource {
253
339
  */
254
340
  export interface WorkflowAutomationState {
255
341
  /**
256
- * The YAML definition of the workflow automation. This should be a valid YAML string that includes a `name` field matching the resource `name` argument, and defines the workflow steps and configuration.
342
+ * \- (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
257
343
  */
258
344
  definition?: pulumi.Input<string | undefined>;
259
345
  /**
@@ -261,23 +347,23 @@ export interface WorkflowAutomationState {
261
347
  */
262
348
  definitionId?: pulumi.Input<string | undefined>;
263
349
  /**
264
- * The description of the workflow automation, as defined in the YAML definition.
350
+ * \- The description of the workflow, as defined in the YAML.
265
351
  */
266
352
  description?: pulumi.Input<string | undefined>;
267
353
  /**
268
- * The name of the workflow automation. This must match the `name` field in the YAML definition provided in the `definition` argument. **Important**: Changes to this field will force a new resource to be created.
354
+ * \- (Required) The name of the workflow. This must match the `name` field in the YAML `definition`. **Important**: Changing this field will force a new resource to be created.
269
355
  */
270
356
  name?: pulumi.Input<string | undefined>;
271
357
  /**
272
- * The scope ID for the workflow automation. For `ACCOUNT` scope, this should be your New Relic account ID (numeric). For `ORGANIZATION` scope, this should be your organization ID (string). **Important**: Changes to this field will force a new resource to be created.
358
+ * \- (Required) The ID of the scope for the workflow. For `ACCOUNT` scope, this is your New Relic account ID (numeric). For `ORGANIZATION` scope, this is your organization ID (string). **Important**: Changing this field will force a new resource to be created.
273
359
  */
274
360
  scopeId?: pulumi.Input<string | undefined>;
275
361
  /**
276
- * The scope type for the workflow automation. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changes to this field will force a new resource to be created.
362
+ * \- (Required) The scope type for the workflow. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changing this field will force a new resource to be created.
277
363
  */
278
364
  scopeType?: pulumi.Input<string | undefined>;
279
365
  /**
280
- * The current version number of the workflow automation.
366
+ * \- The current version number of the workflow. This number increments with each update to the `definition`.
281
367
  */
282
368
  version?: pulumi.Input<number | undefined>;
283
369
  /**
@@ -290,19 +376,19 @@ export interface WorkflowAutomationState {
290
376
  */
291
377
  export interface WorkflowAutomationArgs {
292
378
  /**
293
- * The YAML definition of the workflow automation. This should be a valid YAML string that includes a `name` field matching the resource `name` argument, and defines the workflow steps and configuration.
379
+ * \- (Required) The YAML definition of the workflow. This must be a valid YAML string that defines the workflow's configuration.
294
380
  */
295
381
  definition: pulumi.Input<string>;
296
382
  /**
297
- * The name of the workflow automation. This must match the `name` field in the YAML definition provided in the `definition` argument. **Important**: Changes to this field will force a new resource to be created.
383
+ * \- (Required) The name of the workflow. This must match the `name` field in the YAML `definition`. **Important**: Changing this field will force a new resource to be created.
298
384
  */
299
385
  name?: pulumi.Input<string | undefined>;
300
386
  /**
301
- * The scope ID for the workflow automation. For `ACCOUNT` scope, this should be your New Relic account ID (numeric). For `ORGANIZATION` scope, this should be your organization ID (string). **Important**: Changes to this field will force a new resource to be created.
387
+ * \- (Required) The ID of the scope for the workflow. For `ACCOUNT` scope, this is your New Relic account ID (numeric). For `ORGANIZATION` scope, this is your organization ID (string). **Important**: Changing this field will force a new resource to be created.
302
388
  */
303
389
  scopeId: pulumi.Input<string>;
304
390
  /**
305
- * The scope type for the workflow automation. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changes to this field will force a new resource to be created.
391
+ * \- (Required) The scope type for the workflow. Must be either `ACCOUNT` or `ORGANIZATION`. **Important**: Changing this field will force a new resource to be created.
306
392
  */
307
393
  scopeType: pulumi.Input<string>;
308
394
  }
@@ -1 +1 @@
1
- {"version":3,"file":"workflowAutomation.d.ts","sourceRoot":"","sources":["../workflowAutomation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAGzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+LG;AACH,qBAAa,kBAAmB,SAAQ,MAAM,CAAC,cAAc;IACzD;;;;;;;;OAQ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E,MAAM,CAAC,qBAAqB;CAqC9F;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC9C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC/C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC3C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7C;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC3C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CACnC"}
@@ -31,185 +31,271 @@ const utilities = __importStar(require("./utilities"));
31
31
  /**
32
32
  * Use this resource to create and manage New Relic Workflow Automation.
33
33
  *
34
- * Workflow Automation allows you to define automated workflows using YAML definitions. These workflows can be scoped to either an account or an organization and support various automation steps and configurations.
34
+ * Workflow Automation allows you to define automated workflows using YAML definitions. These workflows can scope to either an account or an organization and support various automation steps and configurations.
35
35
  *
36
36
  * ## Example Usage
37
37
  *
38
38
  * ### Basic Workflow Automation with ACCOUNT Scope
39
39
  *
40
+ * ```typescript
41
+ * import * as pulumi from "@pulumi/pulumi";
42
+ * import * as newrelic from "@pulumi/newrelic";
43
+ *
44
+ * const testQuery = new newrelic.WorkflowAutomation("test_query", {
45
+ * name: "test_query_workflow",
46
+ * scopeId: "your-account-id",
47
+ * scopeType: "ACCOUNT",
48
+ * definition: `name: test_query_workflow
49
+ * description: Simple workflow that queries NRDB and waits
50
+ * steps:
51
+ * - name: queryNrdb
52
+ * type: action
53
+ * action: newrelic.nrdb.query
54
+ * version: 1
55
+ * inputs:
56
+ * query: SELECT count(*) from Log LIMIT 10
57
+ * - name: wait
58
+ * type: wait
59
+ * seconds: 3
60
+ * signals: []
61
+ * next: end
62
+ * `,
63
+ * });
64
+ * ```
65
+ *
40
66
  * ### Workflow Automation with ORGANIZATION Scope
41
67
  *
42
- * ### Advanced Workflow: CCU Governance and Monitoring
68
+ * ```typescript
69
+ * import * as pulumi from "@pulumi/pulumi";
70
+ * import * as newrelic from "@pulumi/newrelic";
71
+ *
72
+ * const orgQuery = new newrelic.WorkflowAutomation("org_query", {
73
+ * name: "org_query_workflow",
74
+ * scopeId: "your-organization-id",
75
+ * scopeType: "ORGANIZATION",
76
+ * definition: `name: org_query_workflow
77
+ * description: Organization-level workflow that queries NRDB
78
+ * steps:
79
+ * - name: queryNrdb
80
+ * type: action
81
+ * action: newrelic.nrdb.query
82
+ * version: 1
83
+ * inputs:
84
+ * query: SELECT count(*) from Transaction LIMIT 10
85
+ * - name: wait
86
+ * type: wait
87
+ * seconds: 5
88
+ * signals: []
89
+ * next: end
90
+ * `,
91
+ * });
92
+ * ```
43
93
  *
44
- * This example demonstrates a production-grade workflow for monitoring and governing Compute Capacity Unit (CCU) consumption with input validation, email notifications, and event tracking:
94
+ * ## [YAML Definition Structure](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/definition-schema/)
45
95
  *
46
- * ## YAML Definition Structure
96
+ * The `definition` argument accepts a YAML string that defines the workflow's structure and logic.
47
97
  *
48
- * The `definition` argument accepts a YAML string that defines the workflow automation. The YAML must include the following fields:
98
+ * ### Top-Level Fields
49
99
  *
50
- * ### Required Fields
100
+ * | Field | Type | Required | Description |
101
+ * | ----- | ----- | ----- | ----- |
102
+ * | `name` | String | Yes | The name of the workflow. Must match the `name` argument in the Terraform resource. |
103
+ * | `description` | String | No | A brief summary of what the workflow does. Recommended for clarity. |
104
+ * | `workflowInputs` | Object | No | A map of input variables that can be passed to the workflow at runtime. |
105
+ * | `steps` | Array | Yes | An ordered array of step objects that define the workflow's logic. |
51
106
  *
52
- * * `name` - (Required) The name of the workflow. This **must** match the `name` argument in the Terraform resource.
53
- * * `description` - (Optional but recommended) A description of what the workflow automation does.
54
- * * `steps` - (Required) An array of steps that define the workflow automation logic.
107
+ * ***
55
108
  *
56
109
  * ### Workflow Inputs
57
110
  *
58
- * Workflows can define inputs that can be passed when the workflow is executed:
111
+ * Define inputs to make your workflows more flexible and reusable.
59
112
  *
60
- * Inputs can reference secrets using the syntax: `${{ :secrets:secretName }}`
113
+ * * Inputs can reference secrets using the syntax: `${{ :secrets:secretName }}`
61
114
  *
62
- * #### Input Validation
115
+ * #### Input Validation Types
63
116
  *
64
117
  * Workflow inputs support various validation types to ensure data integrity:
65
118
  *
66
- * **Regex Validation:**
119
+ * * [Regex Validation:](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/definition-schema/#validation-types)
120
+ *
121
+ * * Integer Range Validation:
67
122
  *
68
- * **Integer Range Validation:**
123
+ * **Note**: By default, integer variables accept both positive and negative values. If you define a *minIntValue* validation, the field rejects any value below that threshold. For example, setting *minIntValue: 0* prevents negative integers from being entered.
69
124
  *
70
- * **List Type:**
125
+ * * List Type:
71
126
  *
72
- * ### Step Types
127
+ * **Note**: This list is case sensitive.
73
128
  *
74
- * Each step in the `steps` array can be of different types:
129
+ * **Step Types**
130
+ *
131
+ * Each object in the `steps` array defines a single unit of work. The primary step types are [`action`, `wait`, `switch`, and `loop`.](https://docs.newrelic.com/docs/workflow-automation/create-a-workflow-automation/create-your-own/#core-concepts)
75
132
  *
76
133
  * #### Action Steps
77
134
  *
78
- * Action steps execute specific actions like querying NRDB, transforming data, or sending notifications:
135
+ * Executes a specific function, such as querying data or sending a notification.
79
136
  *
80
- * * `type: action` - Executes an action
81
- * * `action` - The action to execute (e.g., `newrelic.nrdb.query`, `utils.transform.toCSV`, `slack.chat.postMessage`)
82
- * * `version` - The version of the action to use
83
- * * `inputs` - Input parameters for the action
137
+ * * `type: action` \- Defines the step as an action.
138
+ * * `action` \- The specific action to execute (example, `newrelic.nrdb.query`).
139
+ * * `version` \- The version of the action to use.
140
+ * * `inputs` \- A map of input parameters for the action.
84
141
  *
85
- * Common actions include:
86
- * - `newrelic.nrdb.query` - Query New Relic database
87
- * - `utils.transform.toCSV` - Transform data to CSV format
88
- * - `slack.chat.postMessage` - Send messages to Slack
89
- * - And many more...
142
+ * Example:
90
143
  *
91
- * #### Wait Steps
144
+ * **Common actions include:**
92
145
  *
93
- * * `type: wait` - Pauses the workflow execution
94
- * * `seconds` - Number of seconds to wait
95
- * * `signals` - Optional array of signals to wait for
96
- * * `next` - Optional next step name (use "end" to terminate)
146
+ * * `newrelic.nrdb.query` \- Query New Relic database
147
+ * * `utils.transform.toCSV` \- Transform data to CSV format
148
+ * * `slack.chat.postMessage` \- Send messages to Slack
97
149
  *
98
- * #### Switch Steps
150
+ * **Available actions**
151
+ * A complete list of available actions, their versions, and required inputs can be found in the [**Workflow Action Catalog**](https://docs.newrelic.com/docs/workflow-automation/actions-catalog/).
99
152
  *
100
- * * `type: switch` - Conditional branching based on expressions
101
- * * `switch` - Array of conditions to evaluate
102
- * * `condition` - Expression to evaluate (uses JQ syntax)
103
- * * `next` - Step to execute if condition is true
104
- * * `next` - Default step if no conditions match
153
+ * #### Wait steps
105
154
  *
106
- * #### Loop Steps
155
+ * Pauses the workflow for a specified duration or until it receives a signal.
107
156
  *
108
- * * `type: loop` - Repeats a set of steps
109
- * * `for.in` - Expression defining the iteration (e.g., `${{ [range(1; 30)] }}`)
110
- * * `steps` - Array of steps to execute in each iteration
111
- * * Steps can use `next: break` to exit the loop early
157
+ * * `type: wait`
158
+ * * `seconds` \- The number of seconds to pause.
159
+ * * `signals` \- (Optional) An array of signals to wait for. See [SignalWorkflowRun](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/signal-workflow-run/) for more information
160
+ * * `next` \- (Optional) The name of the next step. Use `end` to terminate the workflow.
112
161
  *
113
- * ### Referencing Data in Workflows
162
+ * Example:
114
163
  *
115
- * You can reference data from previous steps and inputs using template expressions:
164
+ * #### Switch steps
116
165
  *
117
- * * Workflow inputs: `${{ .workflowInputs.inputName }}`
118
- * * Step outputs: `${{ .steps.stepName.outputs.fieldName }}`
119
- * * Secrets: `${{ :secrets:secretName }}`
166
+ * Provides conditional branching logic.
120
167
  *
121
- * ### Example YAML Structure
168
+ * * `type: switch`
169
+ * * `switch` \- An array of conditions to evaluate in order.
170
+ * * `condition` \- A JQ expression that evaluates to `true` or `false`.
171
+ * * `next` \- The name of the step to execute if the condition is true. The `switch` block can also have a top-level `next` field to define the default step if no conditions match.
122
172
  *
123
- * **Simple workflow with query and wait:**
173
+ * Example:
124
174
  *
125
- * **Advanced workflow with inputs and multiple actions:**
175
+ * #### Loop steps
126
176
  *
127
- * ## Important Notes
177
+ * Iterates over a set of values and executes a sequence of steps for each iteration.
128
178
  *
129
- * ### Name Consistency
179
+ * * `type: loop`
180
+ * * `for.in` \- A JQ expression that returns an array to iterate over.
181
+ * * `steps` \- An array of steps to execute for each iteration. Inside the loop, you can use `next: continue` to skip to the next iteration or `next: break` to exit the loop.
130
182
  *
131
- * The `name` field in the Terraform resource **must** match the `name` field in the YAML definition. If they don't match, Terraform will return an error during plan or apply.
183
+ * Example:
132
184
  *
133
- * For example, this configuration is **correct**:
185
+ * ***
134
186
  *
135
- * This configuration is **incorrect** and will fail:
187
+ * ### Referencing Data in Workflows
136
188
  *
137
- * ### Scope Types
189
+ * You can dynamically reference data from inputs, secrets, and other steps using JQ-like template expressions.
138
190
  *
139
- * * **ACCOUNT** - The workflow automation is scoped to a specific New Relic account. Use your numeric account ID as the `scopeId`.
140
- * * **ORGANIZATION** - The workflow automation is scoped to your entire New Relic organization. Use your organization ID string as the `scopeId`.
191
+ * | Data Source | Syntax | Example |
192
+ * | ----- | ----- | ----- |
193
+ * | **Workflow Inputs** | `${{ .workflowInputs.inputName }}` | `${{ .workflowInputs.ccuThreshold }}` |
194
+ * | **Step Outputs** | `${{ .steps.stepName.outputs.fieldName }}` | `${{ .steps.query1.outputs.results }}` |
195
+ * | **Loop Elements** | `${{ .steps.loopStepName.loop.element }}` | `${{ .steps.loopStep1.loop.element.email }}` |
196
+ * | **Secrets** | `${{ :secrets:secretName }}` | `${{ :secrets:myApiKey }}` |
141
197
  *
142
- * ### ForceNew Attributes
198
+ * ***
143
199
  *
144
- * The following attributes will force a new resource to be created if changed:
145
- * * `name` - Changing the workflow name creates a new workflow.
146
- * * `scopeId` - Changing the scope ID creates a new workflow.
147
- * * `scopeType` - Changing between ACCOUNT and ORGANIZATION creates a new workflow.
200
+ * ### Example YAML Structure
148
201
  *
149
- * ### YAML Validation
202
+ * Simple workflow with query and wait:
150
203
  *
151
- * The provider validates the YAML definition during plan and apply operations:
152
- * * The YAML must be valid and parseable.
153
- * * The `name` field must be present in the YAML.
154
- * * The `name` in the YAML must match the Terraform resource `name`.
204
+ * Advanced workflow with inputs and multiple actions:
155
205
  *
156
- * Invalid YAML or missing required fields will result in an error.
206
+ * ## Important note
157
207
  *
158
- * ## Additional Information
208
+ * ### Name Consistency
159
209
  *
160
- * For more details about New Relic Workflow Automation, please refer to the [New Relic Workflow Automation documentation](https://docs.newrelic.com/docs/workflow-automation/).
210
+ * The `name` field in the Terraform resource must match the name field in the YAML definition. If they don't match, Terraform will return an error during `terraform validate`, `plan`, or `apply`.
161
211
  *
162
- * ### Versioning
212
+ * Example Error Message:
163
213
  *
164
- * Each time you update the `definition` of a workflow automation, New Relic automatically increments the `version` attribute. This allows you to track changes to your workflow automation over time.
214
+ * For example, this configuration is **correct**:
165
215
  *
166
- * ### Best Practices
216
+ * ```typescript
217
+ * import * as pulumi from "@pulumi/pulumi";
218
+ * import * as newrelic from "@pulumi/newrelic";
219
+ *
220
+ * const example = new newrelic.WorkflowAutomation("example", {
221
+ * name: "my-workflow",
222
+ * scopeId: "1234567",
223
+ * scopeType: "ACCOUNT",
224
+ * definition: `name: my-workflow # This matches the resource name
225
+ * description: Example workflow
226
+ * steps:
227
+ * - name: waitStep
228
+ * type: wait
229
+ * seconds: 10
230
+ * `,
231
+ * });
232
+ * ```
167
233
  *
168
- * 1. **Use Heredoc Syntax**: For multi-line YAML definitions, use the heredoc syntax (`<<-YAML ... YAML`) for better readability.
234
+ * This configuration is **incorrect** and will fail:
169
235
  *
170
- * 2. **External YAML Files**: For complex workflows, consider storing your YAML in separate files and using Terraform's `file()` or `templatefile()` functions:
236
+ * ```typescript
237
+ * import * as pulumi from "@pulumi/pulumi";
238
+ * import * as newrelic from "@pulumi/newrelic";
239
+ *
240
+ * const example = new newrelic.WorkflowAutomation("example", {
241
+ * name: "my-workflow",
242
+ * scopeId: "1234567",
243
+ * scopeType: "ACCOUNT",
244
+ * definition: `name: different-name # This doesn't match the resource name - ERROR!
245
+ * description: Example workflow
246
+ * steps:
247
+ * - name: waitStep
248
+ * type: wait
249
+ * seconds: 10
250
+ * `,
251
+ * });
252
+ * ```
171
253
  *
172
- * 3. **Version Control**: Store your workflow YAML definitions in version control alongside your Terraform configuration.
254
+ * ### Scope type
173
255
  *
174
- * 4. **Testing**: Test workflow automation changes in a non-production account before applying to production.
256
+ * * **ACCOUNT** \- The workflow automation is scoped to a specific New Relic account. Use your numeric account ID as the `scopeId`.
257
+ * * **ORGANIZATION** \- The workflow automation is scoped to your entire New Relic organization. Use your organization ID string as the `scopeId`.
175
258
  *
176
- * 5. **Naming Conventions**: Use consistent naming conventions for your workflows to make them easier to manage and identify.
259
+ * See, [Create accounts and organizations](https://docs.newrelic.com/docs/accounts/accounts-billing/account-structure/multi-tenancy/org-creation/) on how to create an account or an organization.
177
260
  *
178
- * ### Troubleshooting
261
+ * ### ForceNew attributes
179
262
  *
180
- * #### Name Mismatch Error
263
+ * The following attributes, when changed, will force creation of a new resource :
181
264
  *
182
- * If you receive an error like "name in resource configuration does not match name in YAML definition", ensure that:
183
- * * The `name` attribute in your Terraform resource matches exactly with the `name` field in your YAML definition.
184
- * * There are no extra spaces or different capitalization between the two names.
265
+ * * `name` \- Changing the workflow name creates a new resource.
266
+ * * `scopeId` \- Changing the scope ID creates a new resource.
267
+ * * `scopeType` \- Changing between **ACCOUNT** and **ORGANIZATION** creates a new resource.
185
268
  *
186
- * #### Scope ID Format Error
269
+ * ### YAML validation
187
270
  *
188
- * If you receive an error about invalid scopeId format for ACCOUNT scope:
189
- * * Ensure your account ID is numeric (e.g., "1234567", not "account-1234567").
190
- * * For ACCOUNT scope, the scopeId should be a string representation of your numeric account ID.
271
+ * The provider validates the YAML definition during plan-and-apply operations:
191
272
  *
192
- * #### Invalid YAML Error
273
+ * * The YAML must be valid and parsable.
274
+ * * The `name` field must be present in the YAML.
275
+ * * The `name` in the YAML must match the Terraform resource name.
193
276
  *
194
- * If you receive a YAML parsing error:
195
- * * Validate your YAML syntax using a YAML validator.
196
- * * Ensure proper indentation (YAML is indentation-sensitive).
197
- * * Check that all required fields are present.
277
+ * Invalid YAML or missing required fields will result in an error.
278
+ *
279
+ * Example YAML validation errors:
280
+ *
281
+ * YAML Validation Error
282
+ * 1. *waitStep* has invalid type "waitAgain". Valid types are:
283
+ * action, loop, switch, wait, assign
198
284
  *
199
- * ## See Also
285
+ * 2. Workflow definition names can not be changed.
200
286
  *
201
- * * [New Relic Workflow Automation Documentation](https://docs.newrelic.com/docs/workflow-automation/)
287
+ * ### *Versioning*
288
+ *
289
+ * Each time you update the `definition` of a workflow automation, New Relic automatically increments the `version` attribute. This allows you to track changes to your workflow automation over time.
202
290
  *
203
291
  * ## Import
204
292
  *
205
- * Workflow automations can be imported using the composite ID format: `<scope_type>#<scope_id>#<workflow_name>`, e.g.
293
+ * Import workflow automations using the composite ID format: `<scope_type>#<scope_id>#<workflow_name>`, for example:
206
294
  *
207
295
  * ```sh
208
296
  * $ pulumi import newrelic:index/workflowAutomation:WorkflowAutomation test_query ACCOUNT#1234567#test_query_workflow
209
297
  * ```
210
298
  *
211
- * For workflows with complex names:
212
- *
213
299
  * ```sh
214
300
  * $ pulumi import newrelic:index/workflowAutomation:WorkflowAutomation ccu_governance ACCOUNT#1234567#CCUGovernance
215
301
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"workflowAutomation.js","sourceRoot":"","sources":["../workflowAutomation.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjF,uDAAyC;AACzC,uDAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+LG;AACH,MAAa,kBAAmB,SAAQ,MAAM,CAAC,cAAc;IACzD;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAA+B,EAAE,IAAmC;QAC7H,OAAO,IAAI,kBAAkB,CAAC,IAAI,EAAO,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,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