/
association.go
601 lines (539 loc) · 30.3 KB
/
association.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
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package ssm
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Associates an SSM Document to an instance or EC2 tag.
//
// ## Example Usage
// ### Create an association for a specific instance
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ssm"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{
// Targets: ssm.AssociationTargetArray{
// &ssm.AssociationTargetArgs{
// Key: pulumi.String("InstanceIds"),
// Values: pulumi.StringArray{
// aws_instance.Example.Id,
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Create an association for all managed instances in an AWS account
//
// To target all managed instances in an AWS account, set the `key` as `"InstanceIds"` with `values` set as `["*"]`. This example also illustrates how to use an Amazon owned SSM document named `AmazonCloudWatch-ManageAgent`.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ssm"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{
// Targets: ssm.AssociationTargetArray{
// &ssm.AssociationTargetArgs{
// Key: pulumi.String("InstanceIds"),
// Values: pulumi.StringArray{
// pulumi.String("*"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Create an association for a specific tag
//
// This example shows how to target all managed instances that are assigned a tag key of `Environment` and value of `Development`.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ssm"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{
// Targets: ssm.AssociationTargetArray{
// &ssm.AssociationTargetArgs{
// Key: pulumi.String("tag:Environment"),
// Values: pulumi.StringArray{
// pulumi.String("Development"),
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// ### Create an association with a specific schedule
//
// This example shows how to schedule an association in various ways.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ssm"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{
// ScheduleExpression: pulumi.String("cron(0 2 ? * SUN *)"),
// Targets: ssm.AssociationTargetArray{
// &ssm.AssociationTargetArgs{
// Key: pulumi.String("InstanceIds"),
// Values: pulumi.StringArray{
// aws_instance.Example.Id,
// },
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// SSM associations can be imported using the `association_id`, e.g.,
//
// ```sh
//
// $ pulumi import aws:ssm/association:Association test-association 10abcdef-0abc-1234-5678-90abcdef123456
//
// ```
type Association struct {
pulumi.CustomResourceState
// By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default: `false`.
ApplyOnlyAtCronInterval pulumi.BoolPtrOutput `pulumi:"applyOnlyAtCronInterval"`
// The ARN of the SSM association
Arn pulumi.StringOutput `pulumi:"arn"`
// The ID of the SSM association.
AssociationId pulumi.StringOutput `pulumi:"associationId"`
// The descriptive name for the association.
AssociationName pulumi.StringPtrOutput `pulumi:"associationName"`
// Specify the target for the association. This target is required for associations that use an `Automation` document and target resources by using rate controls. This should be set to the SSM document `parameter` that will define how your automation will branch out.
AutomationTargetParameterName pulumi.StringPtrOutput `pulumi:"automationTargetParameterName"`
// The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL`
ComplianceSeverity pulumi.StringPtrOutput `pulumi:"complianceSeverity"`
// The document version you want to associate with the target(s). Can be a specific version or the default version.
DocumentVersion pulumi.StringOutput `pulumi:"documentVersion"`
// The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above.
//
// Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId
InstanceId pulumi.StringPtrOutput `pulumi:"instanceId"`
// The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
MaxConcurrency pulumi.StringPtrOutput `pulumi:"maxConcurrency"`
// The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
MaxErrors pulumi.StringPtrOutput `pulumi:"maxErrors"`
// The name of the SSM document to apply.
Name pulumi.StringOutput `pulumi:"name"`
// An output location block. Output Location is documented below.
OutputLocation AssociationOutputLocationPtrOutput `pulumi:"outputLocation"`
// A block of arbitrary string parameters to pass to the SSM document.
Parameters pulumi.StringMapOutput `pulumi:"parameters"`
// A [cron or rate expression](https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html) that specifies when the association runs.
ScheduleExpression pulumi.StringPtrOutput `pulumi:"scheduleExpression"`
// A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
Targets AssociationTargetArrayOutput `pulumi:"targets"`
// The number of seconds to wait for the association status to be `Success`. If `Success` status is not reached within the given time, create opration will fail.
//
// Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association:
WaitForSuccessTimeoutSeconds pulumi.IntPtrOutput `pulumi:"waitForSuccessTimeoutSeconds"`
}
// NewAssociation registers a new resource with the given unique name, arguments, and options.
func NewAssociation(ctx *pulumi.Context,
name string, args *AssociationArgs, opts ...pulumi.ResourceOption) (*Association, error) {
if args == nil {
args = &AssociationArgs{}
}
var resource Association
err := ctx.RegisterResource("aws:ssm/association:Association", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAssociation gets an existing Association 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 GetAssociation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AssociationState, opts ...pulumi.ResourceOption) (*Association, error) {
var resource Association
err := ctx.ReadResource("aws:ssm/association:Association", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Association resources.
type associationState struct {
// By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default: `false`.
ApplyOnlyAtCronInterval *bool `pulumi:"applyOnlyAtCronInterval"`
// The ARN of the SSM association
Arn *string `pulumi:"arn"`
// The ID of the SSM association.
AssociationId *string `pulumi:"associationId"`
// The descriptive name for the association.
AssociationName *string `pulumi:"associationName"`
// Specify the target for the association. This target is required for associations that use an `Automation` document and target resources by using rate controls. This should be set to the SSM document `parameter` that will define how your automation will branch out.
AutomationTargetParameterName *string `pulumi:"automationTargetParameterName"`
// The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL`
ComplianceSeverity *string `pulumi:"complianceSeverity"`
// The document version you want to associate with the target(s). Can be a specific version or the default version.
DocumentVersion *string `pulumi:"documentVersion"`
// The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above.
//
// Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId
InstanceId *string `pulumi:"instanceId"`
// The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
MaxConcurrency *string `pulumi:"maxConcurrency"`
// The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
MaxErrors *string `pulumi:"maxErrors"`
// The name of the SSM document to apply.
Name *string `pulumi:"name"`
// An output location block. Output Location is documented below.
OutputLocation *AssociationOutputLocation `pulumi:"outputLocation"`
// A block of arbitrary string parameters to pass to the SSM document.
Parameters map[string]string `pulumi:"parameters"`
// A [cron or rate expression](https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html) that specifies when the association runs.
ScheduleExpression *string `pulumi:"scheduleExpression"`
// A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
Targets []AssociationTarget `pulumi:"targets"`
// The number of seconds to wait for the association status to be `Success`. If `Success` status is not reached within the given time, create opration will fail.
//
// Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association:
WaitForSuccessTimeoutSeconds *int `pulumi:"waitForSuccessTimeoutSeconds"`
}
type AssociationState struct {
// By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default: `false`.
ApplyOnlyAtCronInterval pulumi.BoolPtrInput
// The ARN of the SSM association
Arn pulumi.StringPtrInput
// The ID of the SSM association.
AssociationId pulumi.StringPtrInput
// The descriptive name for the association.
AssociationName pulumi.StringPtrInput
// Specify the target for the association. This target is required for associations that use an `Automation` document and target resources by using rate controls. This should be set to the SSM document `parameter` that will define how your automation will branch out.
AutomationTargetParameterName pulumi.StringPtrInput
// The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL`
ComplianceSeverity pulumi.StringPtrInput
// The document version you want to associate with the target(s). Can be a specific version or the default version.
DocumentVersion pulumi.StringPtrInput
// The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above.
//
// Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId
InstanceId pulumi.StringPtrInput
// The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
MaxConcurrency pulumi.StringPtrInput
// The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
MaxErrors pulumi.StringPtrInput
// The name of the SSM document to apply.
Name pulumi.StringPtrInput
// An output location block. Output Location is documented below.
OutputLocation AssociationOutputLocationPtrInput
// A block of arbitrary string parameters to pass to the SSM document.
Parameters pulumi.StringMapInput
// A [cron or rate expression](https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html) that specifies when the association runs.
ScheduleExpression pulumi.StringPtrInput
// A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
Targets AssociationTargetArrayInput
// The number of seconds to wait for the association status to be `Success`. If `Success` status is not reached within the given time, create opration will fail.
//
// Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association:
WaitForSuccessTimeoutSeconds pulumi.IntPtrInput
}
func (AssociationState) ElementType() reflect.Type {
return reflect.TypeOf((*associationState)(nil)).Elem()
}
type associationArgs struct {
// By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default: `false`.
ApplyOnlyAtCronInterval *bool `pulumi:"applyOnlyAtCronInterval"`
// The descriptive name for the association.
AssociationName *string `pulumi:"associationName"`
// Specify the target for the association. This target is required for associations that use an `Automation` document and target resources by using rate controls. This should be set to the SSM document `parameter` that will define how your automation will branch out.
AutomationTargetParameterName *string `pulumi:"automationTargetParameterName"`
// The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL`
ComplianceSeverity *string `pulumi:"complianceSeverity"`
// The document version you want to associate with the target(s). Can be a specific version or the default version.
DocumentVersion *string `pulumi:"documentVersion"`
// The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above.
//
// Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId
InstanceId *string `pulumi:"instanceId"`
// The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
MaxConcurrency *string `pulumi:"maxConcurrency"`
// The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
MaxErrors *string `pulumi:"maxErrors"`
// The name of the SSM document to apply.
Name *string `pulumi:"name"`
// An output location block. Output Location is documented below.
OutputLocation *AssociationOutputLocation `pulumi:"outputLocation"`
// A block of arbitrary string parameters to pass to the SSM document.
Parameters map[string]string `pulumi:"parameters"`
// A [cron or rate expression](https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html) that specifies when the association runs.
ScheduleExpression *string `pulumi:"scheduleExpression"`
// A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
Targets []AssociationTarget `pulumi:"targets"`
// The number of seconds to wait for the association status to be `Success`. If `Success` status is not reached within the given time, create opration will fail.
//
// Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association:
WaitForSuccessTimeoutSeconds *int `pulumi:"waitForSuccessTimeoutSeconds"`
}
// The set of arguments for constructing a Association resource.
type AssociationArgs struct {
// By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default: `false`.
ApplyOnlyAtCronInterval pulumi.BoolPtrInput
// The descriptive name for the association.
AssociationName pulumi.StringPtrInput
// Specify the target for the association. This target is required for associations that use an `Automation` document and target resources by using rate controls. This should be set to the SSM document `parameter` that will define how your automation will branch out.
AutomationTargetParameterName pulumi.StringPtrInput
// The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL`
ComplianceSeverity pulumi.StringPtrInput
// The document version you want to associate with the target(s). Can be a specific version or the default version.
DocumentVersion pulumi.StringPtrInput
// The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above.
//
// Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId
InstanceId pulumi.StringPtrInput
// The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
MaxConcurrency pulumi.StringPtrInput
// The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
MaxErrors pulumi.StringPtrInput
// The name of the SSM document to apply.
Name pulumi.StringPtrInput
// An output location block. Output Location is documented below.
OutputLocation AssociationOutputLocationPtrInput
// A block of arbitrary string parameters to pass to the SSM document.
Parameters pulumi.StringMapInput
// A [cron or rate expression](https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html) that specifies when the association runs.
ScheduleExpression pulumi.StringPtrInput
// A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
Targets AssociationTargetArrayInput
// The number of seconds to wait for the association status to be `Success`. If `Success` status is not reached within the given time, create opration will fail.
//
// Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association:
WaitForSuccessTimeoutSeconds pulumi.IntPtrInput
}
func (AssociationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*associationArgs)(nil)).Elem()
}
type AssociationInput interface {
pulumi.Input
ToAssociationOutput() AssociationOutput
ToAssociationOutputWithContext(ctx context.Context) AssociationOutput
}
func (*Association) ElementType() reflect.Type {
return reflect.TypeOf((**Association)(nil)).Elem()
}
func (i *Association) ToAssociationOutput() AssociationOutput {
return i.ToAssociationOutputWithContext(context.Background())
}
func (i *Association) ToAssociationOutputWithContext(ctx context.Context) AssociationOutput {
return pulumi.ToOutputWithContext(ctx, i).(AssociationOutput)
}
// AssociationArrayInput is an input type that accepts AssociationArray and AssociationArrayOutput values.
// You can construct a concrete instance of `AssociationArrayInput` via:
//
// AssociationArray{ AssociationArgs{...} }
type AssociationArrayInput interface {
pulumi.Input
ToAssociationArrayOutput() AssociationArrayOutput
ToAssociationArrayOutputWithContext(context.Context) AssociationArrayOutput
}
type AssociationArray []AssociationInput
func (AssociationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Association)(nil)).Elem()
}
func (i AssociationArray) ToAssociationArrayOutput() AssociationArrayOutput {
return i.ToAssociationArrayOutputWithContext(context.Background())
}
func (i AssociationArray) ToAssociationArrayOutputWithContext(ctx context.Context) AssociationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AssociationArrayOutput)
}
// AssociationMapInput is an input type that accepts AssociationMap and AssociationMapOutput values.
// You can construct a concrete instance of `AssociationMapInput` via:
//
// AssociationMap{ "key": AssociationArgs{...} }
type AssociationMapInput interface {
pulumi.Input
ToAssociationMapOutput() AssociationMapOutput
ToAssociationMapOutputWithContext(context.Context) AssociationMapOutput
}
type AssociationMap map[string]AssociationInput
func (AssociationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Association)(nil)).Elem()
}
func (i AssociationMap) ToAssociationMapOutput() AssociationMapOutput {
return i.ToAssociationMapOutputWithContext(context.Background())
}
func (i AssociationMap) ToAssociationMapOutputWithContext(ctx context.Context) AssociationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AssociationMapOutput)
}
type AssociationOutput struct{ *pulumi.OutputState }
func (AssociationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Association)(nil)).Elem()
}
func (o AssociationOutput) ToAssociationOutput() AssociationOutput {
return o
}
func (o AssociationOutput) ToAssociationOutputWithContext(ctx context.Context) AssociationOutput {
return o
}
// By default, when you create a new or update associations, the system runs it immediately and then according to the schedule you specified. Enable this option if you do not want an association to run immediately after you create or update it. This parameter is not supported for rate expressions. Default: `false`.
func (o AssociationOutput) ApplyOnlyAtCronInterval() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Association) pulumi.BoolPtrOutput { return v.ApplyOnlyAtCronInterval }).(pulumi.BoolPtrOutput)
}
// The ARN of the SSM association
func (o AssociationOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *Association) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// The ID of the SSM association.
func (o AssociationOutput) AssociationId() pulumi.StringOutput {
return o.ApplyT(func(v *Association) pulumi.StringOutput { return v.AssociationId }).(pulumi.StringOutput)
}
// The descriptive name for the association.
func (o AssociationOutput) AssociationName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.AssociationName }).(pulumi.StringPtrOutput)
}
// Specify the target for the association. This target is required for associations that use an `Automation` document and target resources by using rate controls. This should be set to the SSM document `parameter` that will define how your automation will branch out.
func (o AssociationOutput) AutomationTargetParameterName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.AutomationTargetParameterName }).(pulumi.StringPtrOutput)
}
// The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL`
func (o AssociationOutput) ComplianceSeverity() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.ComplianceSeverity }).(pulumi.StringPtrOutput)
}
// The document version you want to associate with the target(s). Can be a specific version or the default version.
func (o AssociationOutput) DocumentVersion() pulumi.StringOutput {
return o.ApplyT(func(v *Association) pulumi.StringOutput { return v.DocumentVersion }).(pulumi.StringOutput)
}
// The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above.
//
// Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId
func (o AssociationOutput) InstanceId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.InstanceId }).(pulumi.StringPtrOutput)
}
// The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
func (o AssociationOutput) MaxConcurrency() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.MaxConcurrency }).(pulumi.StringPtrOutput)
}
// The number of errors that are allowed before the system stops sending requests to run the association on additional targets. You can specify a number, for example 10, or a percentage of the target set, for example 10%.
func (o AssociationOutput) MaxErrors() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.MaxErrors }).(pulumi.StringPtrOutput)
}
// The name of the SSM document to apply.
func (o AssociationOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Association) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// An output location block. Output Location is documented below.
func (o AssociationOutput) OutputLocation() AssociationOutputLocationPtrOutput {
return o.ApplyT(func(v *Association) AssociationOutputLocationPtrOutput { return v.OutputLocation }).(AssociationOutputLocationPtrOutput)
}
// A block of arbitrary string parameters to pass to the SSM document.
func (o AssociationOutput) Parameters() pulumi.StringMapOutput {
return o.ApplyT(func(v *Association) pulumi.StringMapOutput { return v.Parameters }).(pulumi.StringMapOutput)
}
// A [cron or rate expression](https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html) that specifies when the association runs.
func (o AssociationOutput) ScheduleExpression() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.ScheduleExpression }).(pulumi.StringPtrOutput)
}
// A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets.
func (o AssociationOutput) Targets() AssociationTargetArrayOutput {
return o.ApplyT(func(v *Association) AssociationTargetArrayOutput { return v.Targets }).(AssociationTargetArrayOutput)
}
// The number of seconds to wait for the association status to be `Success`. If `Success` status is not reached within the given time, create opration will fail.
//
// Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association:
func (o AssociationOutput) WaitForSuccessTimeoutSeconds() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Association) pulumi.IntPtrOutput { return v.WaitForSuccessTimeoutSeconds }).(pulumi.IntPtrOutput)
}
type AssociationArrayOutput struct{ *pulumi.OutputState }
func (AssociationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Association)(nil)).Elem()
}
func (o AssociationArrayOutput) ToAssociationArrayOutput() AssociationArrayOutput {
return o
}
func (o AssociationArrayOutput) ToAssociationArrayOutputWithContext(ctx context.Context) AssociationArrayOutput {
return o
}
func (o AssociationArrayOutput) Index(i pulumi.IntInput) AssociationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Association {
return vs[0].([]*Association)[vs[1].(int)]
}).(AssociationOutput)
}
type AssociationMapOutput struct{ *pulumi.OutputState }
func (AssociationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Association)(nil)).Elem()
}
func (o AssociationMapOutput) ToAssociationMapOutput() AssociationMapOutput {
return o
}
func (o AssociationMapOutput) ToAssociationMapOutputWithContext(ctx context.Context) AssociationMapOutput {
return o
}
func (o AssociationMapOutput) MapIndex(k pulumi.StringInput) AssociationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Association {
return vs[0].(map[string]*Association)[vs[1].(string)]
}).(AssociationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AssociationInput)(nil)).Elem(), &Association{})
pulumi.RegisterInputType(reflect.TypeOf((*AssociationArrayInput)(nil)).Elem(), AssociationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AssociationMapInput)(nil)).Elem(), AssociationMap{})
pulumi.RegisterOutputType(AssociationOutput{})
pulumi.RegisterOutputType(AssociationArrayOutput{})
pulumi.RegisterOutputType(AssociationMapOutput{})
}