github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ssm/association.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package ssm 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Associates an SSM Document to an instance or EC2 tag. 15 // 16 // ## Example Usage 17 // 18 // ### Create an association for a specific instance 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssm" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // _, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{ 34 // Name: pulumi.Any(exampleAwsSsmDocument.Name), 35 // Targets: ssm.AssociationTargetArray{ 36 // &ssm.AssociationTargetArgs{ 37 // Key: pulumi.String("InstanceIds"), 38 // Values: pulumi.StringArray{ 39 // exampleAwsInstance.Id, 40 // }, 41 // }, 42 // }, 43 // }) 44 // if err != nil { 45 // return err 46 // } 47 // return nil 48 // }) 49 // } 50 // 51 // ``` 52 // <!--End PulumiCodeChooser --> 53 // 54 // ### Create an association for all managed instances in an AWS account 55 // 56 // 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`. 57 // 58 // <!--Start PulumiCodeChooser --> 59 // ```go 60 // package main 61 // 62 // import ( 63 // 64 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssm" 65 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 66 // 67 // ) 68 // 69 // func main() { 70 // pulumi.Run(func(ctx *pulumi.Context) error { 71 // _, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{ 72 // Name: pulumi.String("AmazonCloudWatch-ManageAgent"), 73 // Targets: ssm.AssociationTargetArray{ 74 // &ssm.AssociationTargetArgs{ 75 // Key: pulumi.String("InstanceIds"), 76 // Values: pulumi.StringArray{ 77 // pulumi.String("*"), 78 // }, 79 // }, 80 // }, 81 // }) 82 // if err != nil { 83 // return err 84 // } 85 // return nil 86 // }) 87 // } 88 // 89 // ``` 90 // <!--End PulumiCodeChooser --> 91 // 92 // ### Create an association for a specific tag 93 // 94 // This example shows how to target all managed instances that are assigned a tag key of `Environment` and value of `Development`. 95 // 96 // <!--Start PulumiCodeChooser --> 97 // ```go 98 // package main 99 // 100 // import ( 101 // 102 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssm" 103 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 104 // 105 // ) 106 // 107 // func main() { 108 // pulumi.Run(func(ctx *pulumi.Context) error { 109 // _, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{ 110 // Name: pulumi.String("AmazonCloudWatch-ManageAgent"), 111 // Targets: ssm.AssociationTargetArray{ 112 // &ssm.AssociationTargetArgs{ 113 // Key: pulumi.String("tag:Environment"), 114 // Values: pulumi.StringArray{ 115 // pulumi.String("Development"), 116 // }, 117 // }, 118 // }, 119 // }) 120 // if err != nil { 121 // return err 122 // } 123 // return nil 124 // }) 125 // } 126 // 127 // ``` 128 // <!--End PulumiCodeChooser --> 129 // 130 // ### Create an association with a specific schedule 131 // 132 // This example shows how to schedule an association in various ways. 133 // 134 // <!--Start PulumiCodeChooser --> 135 // ```go 136 // package main 137 // 138 // import ( 139 // 140 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssm" 141 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 142 // 143 // ) 144 // 145 // func main() { 146 // pulumi.Run(func(ctx *pulumi.Context) error { 147 // _, err := ssm.NewAssociation(ctx, "example", &ssm.AssociationArgs{ 148 // Name: pulumi.Any(exampleAwsSsmDocument.Name), 149 // ScheduleExpression: pulumi.String("cron(0 2 ? * SUN *)"), 150 // Targets: ssm.AssociationTargetArray{ 151 // &ssm.AssociationTargetArgs{ 152 // Key: pulumi.String("InstanceIds"), 153 // Values: pulumi.StringArray{ 154 // exampleAwsInstance.Id, 155 // }, 156 // }, 157 // }, 158 // }) 159 // if err != nil { 160 // return err 161 // } 162 // return nil 163 // }) 164 // } 165 // 166 // ``` 167 // <!--End PulumiCodeChooser --> 168 // 169 // ## Import 170 // 171 // Using `pulumi import`, import SSM associations using the `association_id`. For example: 172 // 173 // ```sh 174 // $ pulumi import aws:ssm/association:Association test-association 10abcdef-0abc-1234-5678-90abcdef123456 175 // ``` 176 type Association struct { 177 pulumi.CustomResourceState 178 179 // 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`. 180 ApplyOnlyAtCronInterval pulumi.BoolPtrOutput `pulumi:"applyOnlyAtCronInterval"` 181 // The ARN of the SSM association 182 Arn pulumi.StringOutput `pulumi:"arn"` 183 // The ID of the SSM association. 184 AssociationId pulumi.StringOutput `pulumi:"associationId"` 185 // The descriptive name for the association. 186 AssociationName pulumi.StringPtrOutput `pulumi:"associationName"` 187 // 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. 188 AutomationTargetParameterName pulumi.StringPtrOutput `pulumi:"automationTargetParameterName"` 189 // The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL` 190 ComplianceSeverity pulumi.StringPtrOutput `pulumi:"complianceSeverity"` 191 // The document version you want to associate with the target(s). Can be a specific version or the default version. 192 DocumentVersion pulumi.StringOutput `pulumi:"documentVersion"` 193 // The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above. Use the `targets` attribute instead. 194 // 195 // Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId 196 InstanceId pulumi.StringPtrOutput `pulumi:"instanceId"` 197 // 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%. 198 MaxConcurrency pulumi.StringPtrOutput `pulumi:"maxConcurrency"` 199 // 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%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned. 200 MaxErrors pulumi.StringPtrOutput `pulumi:"maxErrors"` 201 // The name of the SSM document to apply. 202 Name pulumi.StringOutput `pulumi:"name"` 203 // An output location block. Output Location is documented below. 204 OutputLocation AssociationOutputLocationPtrOutput `pulumi:"outputLocation"` 205 // A block of arbitrary string parameters to pass to the SSM document. 206 Parameters pulumi.StringMapOutput `pulumi:"parameters"` 207 // 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. 208 ScheduleExpression pulumi.StringPtrOutput `pulumi:"scheduleExpression"` 209 // The mode for generating association compliance. You can specify `AUTO` or `MANUAL`. 210 SyncCompliance pulumi.StringPtrOutput `pulumi:"syncCompliance"` 211 // A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets. 212 Targets AssociationTargetArrayOutput `pulumi:"targets"` 213 // 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. 214 // 215 // Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association: 216 WaitForSuccessTimeoutSeconds pulumi.IntPtrOutput `pulumi:"waitForSuccessTimeoutSeconds"` 217 } 218 219 // NewAssociation registers a new resource with the given unique name, arguments, and options. 220 func NewAssociation(ctx *pulumi.Context, 221 name string, args *AssociationArgs, opts ...pulumi.ResourceOption) (*Association, error) { 222 if args == nil { 223 args = &AssociationArgs{} 224 } 225 226 opts = internal.PkgResourceDefaultOpts(opts) 227 var resource Association 228 err := ctx.RegisterResource("aws:ssm/association:Association", name, args, &resource, opts...) 229 if err != nil { 230 return nil, err 231 } 232 return &resource, nil 233 } 234 235 // GetAssociation gets an existing Association resource's state with the given name, ID, and optional 236 // state properties that are used to uniquely qualify the lookup (nil if not required). 237 func GetAssociation(ctx *pulumi.Context, 238 name string, id pulumi.IDInput, state *AssociationState, opts ...pulumi.ResourceOption) (*Association, error) { 239 var resource Association 240 err := ctx.ReadResource("aws:ssm/association:Association", name, id, state, &resource, opts...) 241 if err != nil { 242 return nil, err 243 } 244 return &resource, nil 245 } 246 247 // Input properties used for looking up and filtering Association resources. 248 type associationState struct { 249 // 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`. 250 ApplyOnlyAtCronInterval *bool `pulumi:"applyOnlyAtCronInterval"` 251 // The ARN of the SSM association 252 Arn *string `pulumi:"arn"` 253 // The ID of the SSM association. 254 AssociationId *string `pulumi:"associationId"` 255 // The descriptive name for the association. 256 AssociationName *string `pulumi:"associationName"` 257 // 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. 258 AutomationTargetParameterName *string `pulumi:"automationTargetParameterName"` 259 // The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL` 260 ComplianceSeverity *string `pulumi:"complianceSeverity"` 261 // The document version you want to associate with the target(s). Can be a specific version or the default version. 262 DocumentVersion *string `pulumi:"documentVersion"` 263 // The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above. Use the `targets` attribute instead. 264 // 265 // Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId 266 InstanceId *string `pulumi:"instanceId"` 267 // 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%. 268 MaxConcurrency *string `pulumi:"maxConcurrency"` 269 // 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%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned. 270 MaxErrors *string `pulumi:"maxErrors"` 271 // The name of the SSM document to apply. 272 Name *string `pulumi:"name"` 273 // An output location block. Output Location is documented below. 274 OutputLocation *AssociationOutputLocation `pulumi:"outputLocation"` 275 // A block of arbitrary string parameters to pass to the SSM document. 276 Parameters map[string]string `pulumi:"parameters"` 277 // 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. 278 ScheduleExpression *string `pulumi:"scheduleExpression"` 279 // The mode for generating association compliance. You can specify `AUTO` or `MANUAL`. 280 SyncCompliance *string `pulumi:"syncCompliance"` 281 // A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets. 282 Targets []AssociationTarget `pulumi:"targets"` 283 // 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. 284 // 285 // Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association: 286 WaitForSuccessTimeoutSeconds *int `pulumi:"waitForSuccessTimeoutSeconds"` 287 } 288 289 type AssociationState struct { 290 // 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`. 291 ApplyOnlyAtCronInterval pulumi.BoolPtrInput 292 // The ARN of the SSM association 293 Arn pulumi.StringPtrInput 294 // The ID of the SSM association. 295 AssociationId pulumi.StringPtrInput 296 // The descriptive name for the association. 297 AssociationName pulumi.StringPtrInput 298 // 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. 299 AutomationTargetParameterName pulumi.StringPtrInput 300 // The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL` 301 ComplianceSeverity pulumi.StringPtrInput 302 // The document version you want to associate with the target(s). Can be a specific version or the default version. 303 DocumentVersion pulumi.StringPtrInput 304 // The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above. Use the `targets` attribute instead. 305 // 306 // Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId 307 InstanceId pulumi.StringPtrInput 308 // 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%. 309 MaxConcurrency pulumi.StringPtrInput 310 // 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%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned. 311 MaxErrors pulumi.StringPtrInput 312 // The name of the SSM document to apply. 313 Name pulumi.StringPtrInput 314 // An output location block. Output Location is documented below. 315 OutputLocation AssociationOutputLocationPtrInput 316 // A block of arbitrary string parameters to pass to the SSM document. 317 Parameters pulumi.StringMapInput 318 // 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. 319 ScheduleExpression pulumi.StringPtrInput 320 // The mode for generating association compliance. You can specify `AUTO` or `MANUAL`. 321 SyncCompliance pulumi.StringPtrInput 322 // A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets. 323 Targets AssociationTargetArrayInput 324 // 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. 325 // 326 // Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association: 327 WaitForSuccessTimeoutSeconds pulumi.IntPtrInput 328 } 329 330 func (AssociationState) ElementType() reflect.Type { 331 return reflect.TypeOf((*associationState)(nil)).Elem() 332 } 333 334 type associationArgs struct { 335 // 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`. 336 ApplyOnlyAtCronInterval *bool `pulumi:"applyOnlyAtCronInterval"` 337 // The descriptive name for the association. 338 AssociationName *string `pulumi:"associationName"` 339 // 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. 340 AutomationTargetParameterName *string `pulumi:"automationTargetParameterName"` 341 // The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL` 342 ComplianceSeverity *string `pulumi:"complianceSeverity"` 343 // The document version you want to associate with the target(s). Can be a specific version or the default version. 344 DocumentVersion *string `pulumi:"documentVersion"` 345 // The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above. Use the `targets` attribute instead. 346 // 347 // Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId 348 InstanceId *string `pulumi:"instanceId"` 349 // 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%. 350 MaxConcurrency *string `pulumi:"maxConcurrency"` 351 // 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%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned. 352 MaxErrors *string `pulumi:"maxErrors"` 353 // The name of the SSM document to apply. 354 Name *string `pulumi:"name"` 355 // An output location block. Output Location is documented below. 356 OutputLocation *AssociationOutputLocation `pulumi:"outputLocation"` 357 // A block of arbitrary string parameters to pass to the SSM document. 358 Parameters map[string]string `pulumi:"parameters"` 359 // 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. 360 ScheduleExpression *string `pulumi:"scheduleExpression"` 361 // The mode for generating association compliance. You can specify `AUTO` or `MANUAL`. 362 SyncCompliance *string `pulumi:"syncCompliance"` 363 // A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets. 364 Targets []AssociationTarget `pulumi:"targets"` 365 // 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. 366 // 367 // Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association: 368 WaitForSuccessTimeoutSeconds *int `pulumi:"waitForSuccessTimeoutSeconds"` 369 } 370 371 // The set of arguments for constructing a Association resource. 372 type AssociationArgs struct { 373 // 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`. 374 ApplyOnlyAtCronInterval pulumi.BoolPtrInput 375 // The descriptive name for the association. 376 AssociationName pulumi.StringPtrInput 377 // 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. 378 AutomationTargetParameterName pulumi.StringPtrInput 379 // The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL` 380 ComplianceSeverity pulumi.StringPtrInput 381 // The document version you want to associate with the target(s). Can be a specific version or the default version. 382 DocumentVersion pulumi.StringPtrInput 383 // The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above. Use the `targets` attribute instead. 384 // 385 // Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId 386 InstanceId pulumi.StringPtrInput 387 // 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%. 388 MaxConcurrency pulumi.StringPtrInput 389 // 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%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned. 390 MaxErrors pulumi.StringPtrInput 391 // The name of the SSM document to apply. 392 Name pulumi.StringPtrInput 393 // An output location block. Output Location is documented below. 394 OutputLocation AssociationOutputLocationPtrInput 395 // A block of arbitrary string parameters to pass to the SSM document. 396 Parameters pulumi.StringMapInput 397 // 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. 398 ScheduleExpression pulumi.StringPtrInput 399 // The mode for generating association compliance. You can specify `AUTO` or `MANUAL`. 400 SyncCompliance pulumi.StringPtrInput 401 // A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets. 402 Targets AssociationTargetArrayInput 403 // 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. 404 // 405 // Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association: 406 WaitForSuccessTimeoutSeconds pulumi.IntPtrInput 407 } 408 409 func (AssociationArgs) ElementType() reflect.Type { 410 return reflect.TypeOf((*associationArgs)(nil)).Elem() 411 } 412 413 type AssociationInput interface { 414 pulumi.Input 415 416 ToAssociationOutput() AssociationOutput 417 ToAssociationOutputWithContext(ctx context.Context) AssociationOutput 418 } 419 420 func (*Association) ElementType() reflect.Type { 421 return reflect.TypeOf((**Association)(nil)).Elem() 422 } 423 424 func (i *Association) ToAssociationOutput() AssociationOutput { 425 return i.ToAssociationOutputWithContext(context.Background()) 426 } 427 428 func (i *Association) ToAssociationOutputWithContext(ctx context.Context) AssociationOutput { 429 return pulumi.ToOutputWithContext(ctx, i).(AssociationOutput) 430 } 431 432 // AssociationArrayInput is an input type that accepts AssociationArray and AssociationArrayOutput values. 433 // You can construct a concrete instance of `AssociationArrayInput` via: 434 // 435 // AssociationArray{ AssociationArgs{...} } 436 type AssociationArrayInput interface { 437 pulumi.Input 438 439 ToAssociationArrayOutput() AssociationArrayOutput 440 ToAssociationArrayOutputWithContext(context.Context) AssociationArrayOutput 441 } 442 443 type AssociationArray []AssociationInput 444 445 func (AssociationArray) ElementType() reflect.Type { 446 return reflect.TypeOf((*[]*Association)(nil)).Elem() 447 } 448 449 func (i AssociationArray) ToAssociationArrayOutput() AssociationArrayOutput { 450 return i.ToAssociationArrayOutputWithContext(context.Background()) 451 } 452 453 func (i AssociationArray) ToAssociationArrayOutputWithContext(ctx context.Context) AssociationArrayOutput { 454 return pulumi.ToOutputWithContext(ctx, i).(AssociationArrayOutput) 455 } 456 457 // AssociationMapInput is an input type that accepts AssociationMap and AssociationMapOutput values. 458 // You can construct a concrete instance of `AssociationMapInput` via: 459 // 460 // AssociationMap{ "key": AssociationArgs{...} } 461 type AssociationMapInput interface { 462 pulumi.Input 463 464 ToAssociationMapOutput() AssociationMapOutput 465 ToAssociationMapOutputWithContext(context.Context) AssociationMapOutput 466 } 467 468 type AssociationMap map[string]AssociationInput 469 470 func (AssociationMap) ElementType() reflect.Type { 471 return reflect.TypeOf((*map[string]*Association)(nil)).Elem() 472 } 473 474 func (i AssociationMap) ToAssociationMapOutput() AssociationMapOutput { 475 return i.ToAssociationMapOutputWithContext(context.Background()) 476 } 477 478 func (i AssociationMap) ToAssociationMapOutputWithContext(ctx context.Context) AssociationMapOutput { 479 return pulumi.ToOutputWithContext(ctx, i).(AssociationMapOutput) 480 } 481 482 type AssociationOutput struct{ *pulumi.OutputState } 483 484 func (AssociationOutput) ElementType() reflect.Type { 485 return reflect.TypeOf((**Association)(nil)).Elem() 486 } 487 488 func (o AssociationOutput) ToAssociationOutput() AssociationOutput { 489 return o 490 } 491 492 func (o AssociationOutput) ToAssociationOutputWithContext(ctx context.Context) AssociationOutput { 493 return o 494 } 495 496 // 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`. 497 func (o AssociationOutput) ApplyOnlyAtCronInterval() pulumi.BoolPtrOutput { 498 return o.ApplyT(func(v *Association) pulumi.BoolPtrOutput { return v.ApplyOnlyAtCronInterval }).(pulumi.BoolPtrOutput) 499 } 500 501 // The ARN of the SSM association 502 func (o AssociationOutput) Arn() pulumi.StringOutput { 503 return o.ApplyT(func(v *Association) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 504 } 505 506 // The ID of the SSM association. 507 func (o AssociationOutput) AssociationId() pulumi.StringOutput { 508 return o.ApplyT(func(v *Association) pulumi.StringOutput { return v.AssociationId }).(pulumi.StringOutput) 509 } 510 511 // The descriptive name for the association. 512 func (o AssociationOutput) AssociationName() pulumi.StringPtrOutput { 513 return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.AssociationName }).(pulumi.StringPtrOutput) 514 } 515 516 // 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. 517 func (o AssociationOutput) AutomationTargetParameterName() pulumi.StringPtrOutput { 518 return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.AutomationTargetParameterName }).(pulumi.StringPtrOutput) 519 } 520 521 // The compliance severity for the association. Can be one of the following: `UNSPECIFIED`, `LOW`, `MEDIUM`, `HIGH` or `CRITICAL` 522 func (o AssociationOutput) ComplianceSeverity() pulumi.StringPtrOutput { 523 return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.ComplianceSeverity }).(pulumi.StringPtrOutput) 524 } 525 526 // The document version you want to associate with the target(s). Can be a specific version or the default version. 527 func (o AssociationOutput) DocumentVersion() pulumi.StringOutput { 528 return o.ApplyT(func(v *Association) pulumi.StringOutput { return v.DocumentVersion }).(pulumi.StringOutput) 529 } 530 531 // The instance ID to apply an SSM document to. Use `targets` with key `InstanceIds` for document schema versions 2.0 and above. Use the `targets` attribute instead. 532 // 533 // Deprecated: use 'targets' argument instead. https://docs.aws.amazon.com/systems-manager/latest/APIReference/API_CreateAssociation.html#systemsmanager-CreateAssociation-request-InstanceId 534 func (o AssociationOutput) InstanceId() pulumi.StringPtrOutput { 535 return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.InstanceId }).(pulumi.StringPtrOutput) 536 } 537 538 // 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%. 539 func (o AssociationOutput) MaxConcurrency() pulumi.StringPtrOutput { 540 return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.MaxConcurrency }).(pulumi.StringPtrOutput) 541 } 542 543 // 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%. If you specify a threshold of 3, the stop command is sent when the fourth error is returned. If you specify a threshold of 10% for 50 associations, the stop command is sent when the sixth error is returned. 544 func (o AssociationOutput) MaxErrors() pulumi.StringPtrOutput { 545 return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.MaxErrors }).(pulumi.StringPtrOutput) 546 } 547 548 // The name of the SSM document to apply. 549 func (o AssociationOutput) Name() pulumi.StringOutput { 550 return o.ApplyT(func(v *Association) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 551 } 552 553 // An output location block. Output Location is documented below. 554 func (o AssociationOutput) OutputLocation() AssociationOutputLocationPtrOutput { 555 return o.ApplyT(func(v *Association) AssociationOutputLocationPtrOutput { return v.OutputLocation }).(AssociationOutputLocationPtrOutput) 556 } 557 558 // A block of arbitrary string parameters to pass to the SSM document. 559 func (o AssociationOutput) Parameters() pulumi.StringMapOutput { 560 return o.ApplyT(func(v *Association) pulumi.StringMapOutput { return v.Parameters }).(pulumi.StringMapOutput) 561 } 562 563 // 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. 564 func (o AssociationOutput) ScheduleExpression() pulumi.StringPtrOutput { 565 return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.ScheduleExpression }).(pulumi.StringPtrOutput) 566 } 567 568 // The mode for generating association compliance. You can specify `AUTO` or `MANUAL`. 569 func (o AssociationOutput) SyncCompliance() pulumi.StringPtrOutput { 570 return o.ApplyT(func(v *Association) pulumi.StringPtrOutput { return v.SyncCompliance }).(pulumi.StringPtrOutput) 571 } 572 573 // A block containing the targets of the SSM association. Targets are documented below. AWS currently supports a maximum of 5 targets. 574 func (o AssociationOutput) Targets() AssociationTargetArrayOutput { 575 return o.ApplyT(func(v *Association) AssociationTargetArrayOutput { return v.Targets }).(AssociationTargetArrayOutput) 576 } 577 578 // 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. 579 // 580 // Output Location (`outputLocation`) is an S3 bucket where you want to store the results of this association: 581 func (o AssociationOutput) WaitForSuccessTimeoutSeconds() pulumi.IntPtrOutput { 582 return o.ApplyT(func(v *Association) pulumi.IntPtrOutput { return v.WaitForSuccessTimeoutSeconds }).(pulumi.IntPtrOutput) 583 } 584 585 type AssociationArrayOutput struct{ *pulumi.OutputState } 586 587 func (AssociationArrayOutput) ElementType() reflect.Type { 588 return reflect.TypeOf((*[]*Association)(nil)).Elem() 589 } 590 591 func (o AssociationArrayOutput) ToAssociationArrayOutput() AssociationArrayOutput { 592 return o 593 } 594 595 func (o AssociationArrayOutput) ToAssociationArrayOutputWithContext(ctx context.Context) AssociationArrayOutput { 596 return o 597 } 598 599 func (o AssociationArrayOutput) Index(i pulumi.IntInput) AssociationOutput { 600 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Association { 601 return vs[0].([]*Association)[vs[1].(int)] 602 }).(AssociationOutput) 603 } 604 605 type AssociationMapOutput struct{ *pulumi.OutputState } 606 607 func (AssociationMapOutput) ElementType() reflect.Type { 608 return reflect.TypeOf((*map[string]*Association)(nil)).Elem() 609 } 610 611 func (o AssociationMapOutput) ToAssociationMapOutput() AssociationMapOutput { 612 return o 613 } 614 615 func (o AssociationMapOutput) ToAssociationMapOutputWithContext(ctx context.Context) AssociationMapOutput { 616 return o 617 } 618 619 func (o AssociationMapOutput) MapIndex(k pulumi.StringInput) AssociationOutput { 620 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Association { 621 return vs[0].(map[string]*Association)[vs[1].(string)] 622 }).(AssociationOutput) 623 } 624 625 func init() { 626 pulumi.RegisterInputType(reflect.TypeOf((*AssociationInput)(nil)).Elem(), &Association{}) 627 pulumi.RegisterInputType(reflect.TypeOf((*AssociationArrayInput)(nil)).Elem(), AssociationArray{}) 628 pulumi.RegisterInputType(reflect.TypeOf((*AssociationMapInput)(nil)).Elem(), AssociationMap{}) 629 pulumi.RegisterOutputType(AssociationOutput{}) 630 pulumi.RegisterOutputType(AssociationArrayOutput{}) 631 pulumi.RegisterOutputType(AssociationMapOutput{}) 632 }