-
Notifications
You must be signed in to change notification settings - Fork 151
/
maintenanceWindowTask.go
389 lines (329 loc) · 18.5 KB
/
maintenanceWindowTask.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ssm
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an SSM Maintenance Window Task resource
//
// ## Example Usage
//
// ## Import
//
// AWS Maintenance Window Task can be imported using the `window_id` and `window_task_id` separated by `/`.
//
// ```sh
// $ pulumi import aws:ssm/maintenanceWindowTask:MaintenanceWindowTask task <window_id>/<window_task_id>
// ```
type MaintenanceWindowTask struct {
pulumi.CustomResourceState
// The description of the maintenance window task.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The maximum number of targets this task can be run for in parallel.
MaxConcurrency pulumi.StringOutput `pulumi:"maxConcurrency"`
// The maximum number of errors allowed before this task stops being scheduled.
MaxErrors pulumi.StringOutput `pulumi:"maxErrors"`
// The name of the maintenance window task.
Name pulumi.StringOutput `pulumi:"name"`
// The priority of the task in the Maintenance Window, the lower the number the higher the priority. Tasks in a Maintenance Window are scheduled in priority order with tasks that have the same priority scheduled in parallel.
Priority pulumi.IntPtrOutput `pulumi:"priority"`
// The role that should be assumed when executing the task. If a role is not provided, Systems Manager uses your account's service-linked role. If no service-linked role for Systems Manager exists in your account, it is created for you.
ServiceRoleArn pulumi.StringOutput `pulumi:"serviceRoleArn"`
// The targets (either instances or window target ids). Instances are specified using Key=InstanceIds,Values=instanceid1,instanceid2. Window target ids are specified using Key=WindowTargetIds,Values=window target id1, window target id2.
Targets MaintenanceWindowTaskTargetArrayOutput `pulumi:"targets"`
// The ARN of the task to execute.
TaskArn pulumi.StringOutput `pulumi:"taskArn"`
// Configuration block with parameters for task execution.
TaskInvocationParameters MaintenanceWindowTaskTaskInvocationParametersPtrOutput `pulumi:"taskInvocationParameters"`
// The type of task being registered. Valid values: `AUTOMATION`, `LAMBDA`, `RUN_COMMAND` or `STEP_FUNCTIONS`.
TaskType pulumi.StringOutput `pulumi:"taskType"`
// The Id of the maintenance window to register the task with.
WindowId pulumi.StringOutput `pulumi:"windowId"`
}
// NewMaintenanceWindowTask registers a new resource with the given unique name, arguments, and options.
func NewMaintenanceWindowTask(ctx *pulumi.Context,
name string, args *MaintenanceWindowTaskArgs, opts ...pulumi.ResourceOption) (*MaintenanceWindowTask, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.MaxConcurrency == nil {
return nil, errors.New("invalid value for required argument 'MaxConcurrency'")
}
if args.MaxErrors == nil {
return nil, errors.New("invalid value for required argument 'MaxErrors'")
}
if args.TaskArn == nil {
return nil, errors.New("invalid value for required argument 'TaskArn'")
}
if args.TaskType == nil {
return nil, errors.New("invalid value for required argument 'TaskType'")
}
if args.WindowId == nil {
return nil, errors.New("invalid value for required argument 'WindowId'")
}
var resource MaintenanceWindowTask
err := ctx.RegisterResource("aws:ssm/maintenanceWindowTask:MaintenanceWindowTask", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMaintenanceWindowTask gets an existing MaintenanceWindowTask resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetMaintenanceWindowTask(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MaintenanceWindowTaskState, opts ...pulumi.ResourceOption) (*MaintenanceWindowTask, error) {
var resource MaintenanceWindowTask
err := ctx.ReadResource("aws:ssm/maintenanceWindowTask:MaintenanceWindowTask", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MaintenanceWindowTask resources.
type maintenanceWindowTaskState struct {
// The description of the maintenance window task.
Description *string `pulumi:"description"`
// The maximum number of targets this task can be run for in parallel.
MaxConcurrency *string `pulumi:"maxConcurrency"`
// The maximum number of errors allowed before this task stops being scheduled.
MaxErrors *string `pulumi:"maxErrors"`
// The name of the maintenance window task.
Name *string `pulumi:"name"`
// The priority of the task in the Maintenance Window, the lower the number the higher the priority. Tasks in a Maintenance Window are scheduled in priority order with tasks that have the same priority scheduled in parallel.
Priority *int `pulumi:"priority"`
// The role that should be assumed when executing the task. If a role is not provided, Systems Manager uses your account's service-linked role. If no service-linked role for Systems Manager exists in your account, it is created for you.
ServiceRoleArn *string `pulumi:"serviceRoleArn"`
// The targets (either instances or window target ids). Instances are specified using Key=InstanceIds,Values=instanceid1,instanceid2. Window target ids are specified using Key=WindowTargetIds,Values=window target id1, window target id2.
Targets []MaintenanceWindowTaskTarget `pulumi:"targets"`
// The ARN of the task to execute.
TaskArn *string `pulumi:"taskArn"`
// Configuration block with parameters for task execution.
TaskInvocationParameters *MaintenanceWindowTaskTaskInvocationParameters `pulumi:"taskInvocationParameters"`
// The type of task being registered. Valid values: `AUTOMATION`, `LAMBDA`, `RUN_COMMAND` or `STEP_FUNCTIONS`.
TaskType *string `pulumi:"taskType"`
// The Id of the maintenance window to register the task with.
WindowId *string `pulumi:"windowId"`
}
type MaintenanceWindowTaskState struct {
// The description of the maintenance window task.
Description pulumi.StringPtrInput
// The maximum number of targets this task can be run for in parallel.
MaxConcurrency pulumi.StringPtrInput
// The maximum number of errors allowed before this task stops being scheduled.
MaxErrors pulumi.StringPtrInput
// The name of the maintenance window task.
Name pulumi.StringPtrInput
// The priority of the task in the Maintenance Window, the lower the number the higher the priority. Tasks in a Maintenance Window are scheduled in priority order with tasks that have the same priority scheduled in parallel.
Priority pulumi.IntPtrInput
// The role that should be assumed when executing the task. If a role is not provided, Systems Manager uses your account's service-linked role. If no service-linked role for Systems Manager exists in your account, it is created for you.
ServiceRoleArn pulumi.StringPtrInput
// The targets (either instances or window target ids). Instances are specified using Key=InstanceIds,Values=instanceid1,instanceid2. Window target ids are specified using Key=WindowTargetIds,Values=window target id1, window target id2.
Targets MaintenanceWindowTaskTargetArrayInput
// The ARN of the task to execute.
TaskArn pulumi.StringPtrInput
// Configuration block with parameters for task execution.
TaskInvocationParameters MaintenanceWindowTaskTaskInvocationParametersPtrInput
// The type of task being registered. Valid values: `AUTOMATION`, `LAMBDA`, `RUN_COMMAND` or `STEP_FUNCTIONS`.
TaskType pulumi.StringPtrInput
// The Id of the maintenance window to register the task with.
WindowId pulumi.StringPtrInput
}
func (MaintenanceWindowTaskState) ElementType() reflect.Type {
return reflect.TypeOf((*maintenanceWindowTaskState)(nil)).Elem()
}
type maintenanceWindowTaskArgs struct {
// The description of the maintenance window task.
Description *string `pulumi:"description"`
// The maximum number of targets this task can be run for in parallel.
MaxConcurrency string `pulumi:"maxConcurrency"`
// The maximum number of errors allowed before this task stops being scheduled.
MaxErrors string `pulumi:"maxErrors"`
// The name of the maintenance window task.
Name *string `pulumi:"name"`
// The priority of the task in the Maintenance Window, the lower the number the higher the priority. Tasks in a Maintenance Window are scheduled in priority order with tasks that have the same priority scheduled in parallel.
Priority *int `pulumi:"priority"`
// The role that should be assumed when executing the task. If a role is not provided, Systems Manager uses your account's service-linked role. If no service-linked role for Systems Manager exists in your account, it is created for you.
ServiceRoleArn *string `pulumi:"serviceRoleArn"`
// The targets (either instances or window target ids). Instances are specified using Key=InstanceIds,Values=instanceid1,instanceid2. Window target ids are specified using Key=WindowTargetIds,Values=window target id1, window target id2.
Targets []MaintenanceWindowTaskTarget `pulumi:"targets"`
// The ARN of the task to execute.
TaskArn string `pulumi:"taskArn"`
// Configuration block with parameters for task execution.
TaskInvocationParameters *MaintenanceWindowTaskTaskInvocationParameters `pulumi:"taskInvocationParameters"`
// The type of task being registered. Valid values: `AUTOMATION`, `LAMBDA`, `RUN_COMMAND` or `STEP_FUNCTIONS`.
TaskType string `pulumi:"taskType"`
// The Id of the maintenance window to register the task with.
WindowId string `pulumi:"windowId"`
}
// The set of arguments for constructing a MaintenanceWindowTask resource.
type MaintenanceWindowTaskArgs struct {
// The description of the maintenance window task.
Description pulumi.StringPtrInput
// The maximum number of targets this task can be run for in parallel.
MaxConcurrency pulumi.StringInput
// The maximum number of errors allowed before this task stops being scheduled.
MaxErrors pulumi.StringInput
// The name of the maintenance window task.
Name pulumi.StringPtrInput
// The priority of the task in the Maintenance Window, the lower the number the higher the priority. Tasks in a Maintenance Window are scheduled in priority order with tasks that have the same priority scheduled in parallel.
Priority pulumi.IntPtrInput
// The role that should be assumed when executing the task. If a role is not provided, Systems Manager uses your account's service-linked role. If no service-linked role for Systems Manager exists in your account, it is created for you.
ServiceRoleArn pulumi.StringPtrInput
// The targets (either instances or window target ids). Instances are specified using Key=InstanceIds,Values=instanceid1,instanceid2. Window target ids are specified using Key=WindowTargetIds,Values=window target id1, window target id2.
Targets MaintenanceWindowTaskTargetArrayInput
// The ARN of the task to execute.
TaskArn pulumi.StringInput
// Configuration block with parameters for task execution.
TaskInvocationParameters MaintenanceWindowTaskTaskInvocationParametersPtrInput
// The type of task being registered. Valid values: `AUTOMATION`, `LAMBDA`, `RUN_COMMAND` or `STEP_FUNCTIONS`.
TaskType pulumi.StringInput
// The Id of the maintenance window to register the task with.
WindowId pulumi.StringInput
}
func (MaintenanceWindowTaskArgs) ElementType() reflect.Type {
return reflect.TypeOf((*maintenanceWindowTaskArgs)(nil)).Elem()
}
type MaintenanceWindowTaskInput interface {
pulumi.Input
ToMaintenanceWindowTaskOutput() MaintenanceWindowTaskOutput
ToMaintenanceWindowTaskOutputWithContext(ctx context.Context) MaintenanceWindowTaskOutput
}
func (*MaintenanceWindowTask) ElementType() reflect.Type {
return reflect.TypeOf((*MaintenanceWindowTask)(nil))
}
func (i *MaintenanceWindowTask) ToMaintenanceWindowTaskOutput() MaintenanceWindowTaskOutput {
return i.ToMaintenanceWindowTaskOutputWithContext(context.Background())
}
func (i *MaintenanceWindowTask) ToMaintenanceWindowTaskOutputWithContext(ctx context.Context) MaintenanceWindowTaskOutput {
return pulumi.ToOutputWithContext(ctx, i).(MaintenanceWindowTaskOutput)
}
func (i *MaintenanceWindowTask) ToMaintenanceWindowTaskPtrOutput() MaintenanceWindowTaskPtrOutput {
return i.ToMaintenanceWindowTaskPtrOutputWithContext(context.Background())
}
func (i *MaintenanceWindowTask) ToMaintenanceWindowTaskPtrOutputWithContext(ctx context.Context) MaintenanceWindowTaskPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(MaintenanceWindowTaskPtrOutput)
}
type MaintenanceWindowTaskPtrInput interface {
pulumi.Input
ToMaintenanceWindowTaskPtrOutput() MaintenanceWindowTaskPtrOutput
ToMaintenanceWindowTaskPtrOutputWithContext(ctx context.Context) MaintenanceWindowTaskPtrOutput
}
type maintenanceWindowTaskPtrType MaintenanceWindowTaskArgs
func (*maintenanceWindowTaskPtrType) ElementType() reflect.Type {
return reflect.TypeOf((**MaintenanceWindowTask)(nil))
}
func (i *maintenanceWindowTaskPtrType) ToMaintenanceWindowTaskPtrOutput() MaintenanceWindowTaskPtrOutput {
return i.ToMaintenanceWindowTaskPtrOutputWithContext(context.Background())
}
func (i *maintenanceWindowTaskPtrType) ToMaintenanceWindowTaskPtrOutputWithContext(ctx context.Context) MaintenanceWindowTaskPtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(MaintenanceWindowTaskPtrOutput)
}
// MaintenanceWindowTaskArrayInput is an input type that accepts MaintenanceWindowTaskArray and MaintenanceWindowTaskArrayOutput values.
// You can construct a concrete instance of `MaintenanceWindowTaskArrayInput` via:
//
// MaintenanceWindowTaskArray{ MaintenanceWindowTaskArgs{...} }
type MaintenanceWindowTaskArrayInput interface {
pulumi.Input
ToMaintenanceWindowTaskArrayOutput() MaintenanceWindowTaskArrayOutput
ToMaintenanceWindowTaskArrayOutputWithContext(context.Context) MaintenanceWindowTaskArrayOutput
}
type MaintenanceWindowTaskArray []MaintenanceWindowTaskInput
func (MaintenanceWindowTaskArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*MaintenanceWindowTask)(nil))
}
func (i MaintenanceWindowTaskArray) ToMaintenanceWindowTaskArrayOutput() MaintenanceWindowTaskArrayOutput {
return i.ToMaintenanceWindowTaskArrayOutputWithContext(context.Background())
}
func (i MaintenanceWindowTaskArray) ToMaintenanceWindowTaskArrayOutputWithContext(ctx context.Context) MaintenanceWindowTaskArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MaintenanceWindowTaskArrayOutput)
}
// MaintenanceWindowTaskMapInput is an input type that accepts MaintenanceWindowTaskMap and MaintenanceWindowTaskMapOutput values.
// You can construct a concrete instance of `MaintenanceWindowTaskMapInput` via:
//
// MaintenanceWindowTaskMap{ "key": MaintenanceWindowTaskArgs{...} }
type MaintenanceWindowTaskMapInput interface {
pulumi.Input
ToMaintenanceWindowTaskMapOutput() MaintenanceWindowTaskMapOutput
ToMaintenanceWindowTaskMapOutputWithContext(context.Context) MaintenanceWindowTaskMapOutput
}
type MaintenanceWindowTaskMap map[string]MaintenanceWindowTaskInput
func (MaintenanceWindowTaskMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*MaintenanceWindowTask)(nil))
}
func (i MaintenanceWindowTaskMap) ToMaintenanceWindowTaskMapOutput() MaintenanceWindowTaskMapOutput {
return i.ToMaintenanceWindowTaskMapOutputWithContext(context.Background())
}
func (i MaintenanceWindowTaskMap) ToMaintenanceWindowTaskMapOutputWithContext(ctx context.Context) MaintenanceWindowTaskMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MaintenanceWindowTaskMapOutput)
}
type MaintenanceWindowTaskOutput struct {
*pulumi.OutputState
}
func (MaintenanceWindowTaskOutput) ElementType() reflect.Type {
return reflect.TypeOf((*MaintenanceWindowTask)(nil))
}
func (o MaintenanceWindowTaskOutput) ToMaintenanceWindowTaskOutput() MaintenanceWindowTaskOutput {
return o
}
func (o MaintenanceWindowTaskOutput) ToMaintenanceWindowTaskOutputWithContext(ctx context.Context) MaintenanceWindowTaskOutput {
return o
}
func (o MaintenanceWindowTaskOutput) ToMaintenanceWindowTaskPtrOutput() MaintenanceWindowTaskPtrOutput {
return o.ToMaintenanceWindowTaskPtrOutputWithContext(context.Background())
}
func (o MaintenanceWindowTaskOutput) ToMaintenanceWindowTaskPtrOutputWithContext(ctx context.Context) MaintenanceWindowTaskPtrOutput {
return o.ApplyT(func(v MaintenanceWindowTask) *MaintenanceWindowTask {
return &v
}).(MaintenanceWindowTaskPtrOutput)
}
type MaintenanceWindowTaskPtrOutput struct {
*pulumi.OutputState
}
func (MaintenanceWindowTaskPtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MaintenanceWindowTask)(nil))
}
func (o MaintenanceWindowTaskPtrOutput) ToMaintenanceWindowTaskPtrOutput() MaintenanceWindowTaskPtrOutput {
return o
}
func (o MaintenanceWindowTaskPtrOutput) ToMaintenanceWindowTaskPtrOutputWithContext(ctx context.Context) MaintenanceWindowTaskPtrOutput {
return o
}
type MaintenanceWindowTaskArrayOutput struct{ *pulumi.OutputState }
func (MaintenanceWindowTaskArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]MaintenanceWindowTask)(nil))
}
func (o MaintenanceWindowTaskArrayOutput) ToMaintenanceWindowTaskArrayOutput() MaintenanceWindowTaskArrayOutput {
return o
}
func (o MaintenanceWindowTaskArrayOutput) ToMaintenanceWindowTaskArrayOutputWithContext(ctx context.Context) MaintenanceWindowTaskArrayOutput {
return o
}
func (o MaintenanceWindowTaskArrayOutput) Index(i pulumi.IntInput) MaintenanceWindowTaskOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) MaintenanceWindowTask {
return vs[0].([]MaintenanceWindowTask)[vs[1].(int)]
}).(MaintenanceWindowTaskOutput)
}
type MaintenanceWindowTaskMapOutput struct{ *pulumi.OutputState }
func (MaintenanceWindowTaskMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]MaintenanceWindowTask)(nil))
}
func (o MaintenanceWindowTaskMapOutput) ToMaintenanceWindowTaskMapOutput() MaintenanceWindowTaskMapOutput {
return o
}
func (o MaintenanceWindowTaskMapOutput) ToMaintenanceWindowTaskMapOutputWithContext(ctx context.Context) MaintenanceWindowTaskMapOutput {
return o
}
func (o MaintenanceWindowTaskMapOutput) MapIndex(k pulumi.StringInput) MaintenanceWindowTaskOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) MaintenanceWindowTask {
return vs[0].(map[string]MaintenanceWindowTask)[vs[1].(string)]
}).(MaintenanceWindowTaskOutput)
}
func init() {
pulumi.RegisterOutputType(MaintenanceWindowTaskOutput{})
pulumi.RegisterOutputType(MaintenanceWindowTaskPtrOutput{})
pulumi.RegisterOutputType(MaintenanceWindowTaskArrayOutput{})
pulumi.RegisterOutputType(MaintenanceWindowTaskMapOutput{})
}