@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 +2 -2
- package/workflowAutomation.d.ts +201 -115
- package/workflowAutomation.d.ts.map +1 -1
- package/workflowAutomation.js +185 -99
- package/workflowAutomation.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulumi/newrelic",
|
|
3
|
-
"version": "5.72.
|
|
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.
|
|
26
|
+
"version": "5.72.1"
|
|
27
27
|
}
|
|
28
28
|
}
|
package/workflowAutomation.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
65
|
+
* ## [YAML Definition Structure](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/definition-schema/)
|
|
16
66
|
*
|
|
17
|
-
*
|
|
67
|
+
* The `definition` argument accepts a YAML string that defines the workflow's structure and logic.
|
|
18
68
|
*
|
|
19
|
-
*
|
|
69
|
+
* ### Top-Level Fields
|
|
20
70
|
*
|
|
21
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
* **
|
|
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
|
-
*
|
|
96
|
+
* * List Type:
|
|
42
97
|
*
|
|
43
|
-
*
|
|
98
|
+
* **Note**: This list is case sensitive.
|
|
44
99
|
*
|
|
45
|
-
*
|
|
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
|
-
*
|
|
106
|
+
* Executes a specific function, such as querying data or sending a notification.
|
|
50
107
|
*
|
|
51
|
-
* * `type: action`
|
|
52
|
-
* * `action`
|
|
53
|
-
* * `version`
|
|
54
|
-
* * `inputs`
|
|
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
|
-
*
|
|
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
|
-
*
|
|
115
|
+
* **Common actions include:**
|
|
63
116
|
*
|
|
64
|
-
* * `
|
|
65
|
-
*
|
|
66
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
126
|
+
* Pauses the workflow for a specified duration or until it receives a signal.
|
|
78
127
|
*
|
|
79
|
-
* * `type:
|
|
80
|
-
* * `
|
|
81
|
-
* * `
|
|
82
|
-
* *
|
|
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
|
-
*
|
|
133
|
+
* Example:
|
|
85
134
|
*
|
|
86
|
-
*
|
|
135
|
+
* #### Switch steps
|
|
87
136
|
*
|
|
88
|
-
*
|
|
89
|
-
* * Step outputs: `${{ .steps.stepName.outputs.fieldName }}`
|
|
90
|
-
* * Secrets: `${{ :secrets:secretName }}`
|
|
137
|
+
* Provides conditional branching logic.
|
|
91
138
|
*
|
|
92
|
-
*
|
|
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
|
-
*
|
|
144
|
+
* Example:
|
|
95
145
|
*
|
|
96
|
-
*
|
|
146
|
+
* #### Loop steps
|
|
97
147
|
*
|
|
98
|
-
*
|
|
148
|
+
* Iterates over a set of values and executes a sequence of steps for each iteration.
|
|
99
149
|
*
|
|
100
|
-
*
|
|
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
|
-
*
|
|
154
|
+
* Example:
|
|
103
155
|
*
|
|
104
|
-
*
|
|
156
|
+
* ***
|
|
105
157
|
*
|
|
106
|
-
*
|
|
158
|
+
* ### Referencing Data in Workflows
|
|
107
159
|
*
|
|
108
|
-
*
|
|
160
|
+
* You can dynamically reference data from inputs, secrets, and other steps using JQ-like template expressions.
|
|
109
161
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
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
|
-
*
|
|
169
|
+
* ***
|
|
114
170
|
*
|
|
115
|
-
*
|
|
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
|
-
*
|
|
173
|
+
* Simple workflow with query and wait:
|
|
121
174
|
*
|
|
122
|
-
*
|
|
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
|
-
*
|
|
177
|
+
* ## Important note
|
|
128
178
|
*
|
|
129
|
-
*
|
|
179
|
+
* ### Name Consistency
|
|
130
180
|
*
|
|
131
|
-
*
|
|
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
|
-
*
|
|
183
|
+
* Example Error Message:
|
|
134
184
|
*
|
|
135
|
-
*
|
|
185
|
+
* For example, this configuration is **correct**:
|
|
136
186
|
*
|
|
137
|
-
*
|
|
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
|
-
*
|
|
205
|
+
* This configuration is **incorrect** and will fail:
|
|
140
206
|
*
|
|
141
|
-
*
|
|
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
|
-
*
|
|
225
|
+
* ### Scope type
|
|
144
226
|
*
|
|
145
|
-
*
|
|
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
|
-
*
|
|
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
|
-
* ###
|
|
232
|
+
* ### ForceNew attributes
|
|
150
233
|
*
|
|
151
|
-
*
|
|
234
|
+
* The following attributes, when changed, will force creation of a new resource :
|
|
152
235
|
*
|
|
153
|
-
*
|
|
154
|
-
* *
|
|
155
|
-
* *
|
|
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
|
-
*
|
|
240
|
+
* ### YAML validation
|
|
158
241
|
*
|
|
159
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
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
|
-
*
|
|
256
|
+
* 2. Workflow definition names can not be changed.
|
|
171
257
|
*
|
|
172
|
-
* *
|
|
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
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1
|
+
{"version":3,"file":"workflowAutomation.d.ts","sourceRoot":"","sources":["../workflowAutomation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAGzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqRG;AACH,qBAAa,kBAAmB,SAAQ,MAAM,CAAC,cAAc;IACzD;;;;;;;;OAQG;WACW,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,uBAAuB,EA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AAC,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"}
|
package/workflowAutomation.js
CHANGED
|
@@ -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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
94
|
+
* ## [YAML Definition Structure](https://docs.newrelic.com/docs/workflow-automation/workflow-automation-apis/definition-schema/)
|
|
45
95
|
*
|
|
46
|
-
*
|
|
96
|
+
* The `definition` argument accepts a YAML string that defines the workflow's structure and logic.
|
|
47
97
|
*
|
|
48
|
-
*
|
|
98
|
+
* ### Top-Level Fields
|
|
49
99
|
*
|
|
50
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
* **
|
|
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
|
-
*
|
|
125
|
+
* * List Type:
|
|
71
126
|
*
|
|
72
|
-
*
|
|
127
|
+
* **Note**: This list is case sensitive.
|
|
73
128
|
*
|
|
74
|
-
*
|
|
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
|
-
*
|
|
135
|
+
* Executes a specific function, such as querying data or sending a notification.
|
|
79
136
|
*
|
|
80
|
-
* * `type: action`
|
|
81
|
-
* * `action`
|
|
82
|
-
* * `version`
|
|
83
|
-
* * `inputs`
|
|
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
|
-
*
|
|
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
|
-
*
|
|
144
|
+
* **Common actions include:**
|
|
92
145
|
*
|
|
93
|
-
* * `
|
|
94
|
-
*
|
|
95
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
155
|
+
* Pauses the workflow for a specified duration or until it receives a signal.
|
|
107
156
|
*
|
|
108
|
-
* * `type:
|
|
109
|
-
* * `
|
|
110
|
-
* * `
|
|
111
|
-
* *
|
|
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
|
-
*
|
|
162
|
+
* Example:
|
|
114
163
|
*
|
|
115
|
-
*
|
|
164
|
+
* #### Switch steps
|
|
116
165
|
*
|
|
117
|
-
*
|
|
118
|
-
* * Step outputs: `${{ .steps.stepName.outputs.fieldName }}`
|
|
119
|
-
* * Secrets: `${{ :secrets:secretName }}`
|
|
166
|
+
* Provides conditional branching logic.
|
|
120
167
|
*
|
|
121
|
-
*
|
|
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
|
-
*
|
|
173
|
+
* Example:
|
|
124
174
|
*
|
|
125
|
-
*
|
|
175
|
+
* #### Loop steps
|
|
126
176
|
*
|
|
127
|
-
*
|
|
177
|
+
* Iterates over a set of values and executes a sequence of steps for each iteration.
|
|
128
178
|
*
|
|
129
|
-
*
|
|
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
|
-
*
|
|
183
|
+
* Example:
|
|
132
184
|
*
|
|
133
|
-
*
|
|
185
|
+
* ***
|
|
134
186
|
*
|
|
135
|
-
*
|
|
187
|
+
* ### Referencing Data in Workflows
|
|
136
188
|
*
|
|
137
|
-
*
|
|
189
|
+
* You can dynamically reference data from inputs, secrets, and other steps using JQ-like template expressions.
|
|
138
190
|
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
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
|
-
*
|
|
198
|
+
* ***
|
|
143
199
|
*
|
|
144
|
-
*
|
|
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
|
-
*
|
|
202
|
+
* Simple workflow with query and wait:
|
|
150
203
|
*
|
|
151
|
-
*
|
|
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
|
-
*
|
|
206
|
+
* ## Important note
|
|
157
207
|
*
|
|
158
|
-
*
|
|
208
|
+
* ### Name Consistency
|
|
159
209
|
*
|
|
160
|
-
*
|
|
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
|
-
*
|
|
212
|
+
* Example Error Message:
|
|
163
213
|
*
|
|
164
|
-
*
|
|
214
|
+
* For example, this configuration is **correct**:
|
|
165
215
|
*
|
|
166
|
-
*
|
|
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
|
-
*
|
|
234
|
+
* This configuration is **incorrect** and will fail:
|
|
169
235
|
*
|
|
170
|
-
*
|
|
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
|
-
*
|
|
254
|
+
* ### Scope type
|
|
173
255
|
*
|
|
174
|
-
*
|
|
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
|
-
*
|
|
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
|
-
* ###
|
|
261
|
+
* ### ForceNew attributes
|
|
179
262
|
*
|
|
180
|
-
*
|
|
263
|
+
* The following attributes, when changed, will force creation of a new resource :
|
|
181
264
|
*
|
|
182
|
-
*
|
|
183
|
-
* *
|
|
184
|
-
* *
|
|
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
|
-
*
|
|
269
|
+
* ### YAML validation
|
|
187
270
|
*
|
|
188
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
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
|
-
*
|
|
285
|
+
* 2. Workflow definition names can not be changed.
|
|
200
286
|
*
|
|
201
|
-
* *
|
|
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
|
-
*
|
|
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
|
|
1
|
+
{"version":3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