github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ssmincidents/responsePlan.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 ssmincidents 5 6 import ( 7 "context" 8 "reflect" 9 10 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Provides a resource to manage response plans in AWS Systems Manager Incident Manager. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssmincidents" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := ssmincidents.NewResponsePlan(ctx, "example", &ssmincidents.ResponsePlanArgs{ 35 // Name: pulumi.String("name"), 36 // IncidentTemplate: &ssmincidents.ResponsePlanIncidentTemplateArgs{ 37 // Title: pulumi.String("title"), 38 // Impact: pulumi.Int(3), 39 // }, 40 // Tags: pulumi.StringMap{ 41 // "key": pulumi.String("value"), 42 // }, 43 // }, pulumi.DependsOn([]pulumi.Resource{ 44 // exampleAwsSsmincidentsReplicationSet, 45 // })) 46 // if err != nil { 47 // return err 48 // } 49 // return nil 50 // }) 51 // } 52 // 53 // ``` 54 // <!--End PulumiCodeChooser --> 55 // 56 // ### Usage With All Fields 57 // 58 // <!--Start PulumiCodeChooser --> 59 // ```go 60 // package main 61 // 62 // import ( 63 // 64 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssmincidents" 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 := ssmincidents.NewResponsePlan(ctx, "example", &ssmincidents.ResponsePlanArgs{ 72 // Name: pulumi.String("name"), 73 // IncidentTemplate: &ssmincidents.ResponsePlanIncidentTemplateArgs{ 74 // Title: pulumi.String("title"), 75 // Impact: pulumi.Int(3), 76 // DedupeString: pulumi.String("dedupe"), 77 // IncidentTags: pulumi.StringMap{ 78 // "key": pulumi.String("value"), 79 // }, 80 // NotificationTargets: ssmincidents.ResponsePlanIncidentTemplateNotificationTargetArray{ 81 // &ssmincidents.ResponsePlanIncidentTemplateNotificationTargetArgs{ 82 // SnsTopicArn: pulumi.Any(example1.Arn), 83 // }, 84 // &ssmincidents.ResponsePlanIncidentTemplateNotificationTargetArgs{ 85 // SnsTopicArn: pulumi.Any(example2.Arn), 86 // }, 87 // }, 88 // Summary: pulumi.String("summary"), 89 // }, 90 // DisplayName: pulumi.String("display name"), 91 // ChatChannels: pulumi.StringArray{ 92 // topic.Arn, 93 // }, 94 // Engagements: pulumi.StringArray{ 95 // pulumi.String("arn:aws:ssm-contacts:us-east-2:111122223333:contact/test1"), 96 // }, 97 // Action: &ssmincidents.ResponsePlanActionArgs{ 98 // SsmAutomations: ssmincidents.ResponsePlanActionSsmAutomationArray{ 99 // &ssmincidents.ResponsePlanActionSsmAutomationArgs{ 100 // DocumentName: pulumi.Any(document1.Name), 101 // RoleArn: pulumi.Any(role1.Arn), 102 // DocumentVersion: pulumi.String("version1"), 103 // TargetAccount: pulumi.String("RESPONSE_PLAN_OWNER_ACCOUNT"), 104 // Parameters: ssmincidents.ResponsePlanActionSsmAutomationParameterArray{ 105 // &ssmincidents.ResponsePlanActionSsmAutomationParameterArgs{ 106 // Name: pulumi.String("key"), 107 // Values: pulumi.StringArray{ 108 // pulumi.String("value1"), 109 // pulumi.String("value2"), 110 // }, 111 // }, 112 // &ssmincidents.ResponsePlanActionSsmAutomationParameterArgs{ 113 // Name: pulumi.String("foo"), 114 // Values: pulumi.StringArray{ 115 // pulumi.String("bar"), 116 // }, 117 // }, 118 // }, 119 // DynamicParameters: pulumi.StringMap{ 120 // "someKey": pulumi.String("INVOLVED_RESOURCES"), 121 // "anotherKey": pulumi.String("INCIDENT_RECORD_ARN"), 122 // }, 123 // }, 124 // }, 125 // }, 126 // Integration: &ssmincidents.ResponsePlanIntegrationArgs{ 127 // Pagerduties: ssmincidents.ResponsePlanIntegrationPagerdutyArray{ 128 // &ssmincidents.ResponsePlanIntegrationPagerdutyArgs{ 129 // Name: pulumi.String("pagerdutyIntergration"), 130 // ServiceId: pulumi.String("example"), 131 // SecretId: pulumi.String("example"), 132 // }, 133 // }, 134 // }, 135 // Tags: pulumi.StringMap{ 136 // "key": pulumi.String("value"), 137 // }, 138 // }, pulumi.DependsOn([]pulumi.Resource{ 139 // exampleAwsSsmincidentsReplicationSet, 140 // })) 141 // if err != nil { 142 // return err 143 // } 144 // return nil 145 // }) 146 // } 147 // 148 // ``` 149 // <!--End PulumiCodeChooser --> 150 // 151 // ## Import 152 // 153 // Using `pulumi import`, import an Incident Manager response plan using the response plan ARN. You can find the response plan ARN in the AWS Management Console. For example: 154 // 155 // ```sh 156 // $ pulumi import aws:ssmincidents/responsePlan:ResponsePlan responsePlanName ARNValue 157 // ``` 158 type ResponsePlan struct { 159 pulumi.CustomResourceState 160 161 // The actions that the response plan starts at the beginning of an incident. 162 Action ResponsePlanActionPtrOutput `pulumi:"action"` 163 // The ARN of the response plan. 164 Arn pulumi.StringOutput `pulumi:"arn"` 165 // The Chatbot chat channel used for collaboration during an incident. 166 ChatChannels pulumi.StringArrayOutput `pulumi:"chatChannels"` 167 // The long format of the response plan name. This field can contain spaces. 168 DisplayName pulumi.StringPtrOutput `pulumi:"displayName"` 169 // The Amazon Resource Name (ARN) for the contacts and escalation plans that the response plan engages during an incident. 170 Engagements pulumi.StringArrayOutput `pulumi:"engagements"` 171 IncidentTemplate ResponsePlanIncidentTemplateOutput `pulumi:"incidentTemplate"` 172 // Information about third-party services integrated into the response plan. The following values are supported: 173 Integration ResponsePlanIntegrationPtrOutput `pulumi:"integration"` 174 // The name of the response plan. 175 Name pulumi.StringOutput `pulumi:"name"` 176 // The tags applied to the response plan. 177 Tags pulumi.StringMapOutput `pulumi:"tags"` 178 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 179 // 180 // Deprecated: Please use `tags` instead. 181 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 182 } 183 184 // NewResponsePlan registers a new resource with the given unique name, arguments, and options. 185 func NewResponsePlan(ctx *pulumi.Context, 186 name string, args *ResponsePlanArgs, opts ...pulumi.ResourceOption) (*ResponsePlan, error) { 187 if args == nil { 188 return nil, errors.New("missing one or more required arguments") 189 } 190 191 if args.IncidentTemplate == nil { 192 return nil, errors.New("invalid value for required argument 'IncidentTemplate'") 193 } 194 opts = internal.PkgResourceDefaultOpts(opts) 195 var resource ResponsePlan 196 err := ctx.RegisterResource("aws:ssmincidents/responsePlan:ResponsePlan", name, args, &resource, opts...) 197 if err != nil { 198 return nil, err 199 } 200 return &resource, nil 201 } 202 203 // GetResponsePlan gets an existing ResponsePlan resource's state with the given name, ID, and optional 204 // state properties that are used to uniquely qualify the lookup (nil if not required). 205 func GetResponsePlan(ctx *pulumi.Context, 206 name string, id pulumi.IDInput, state *ResponsePlanState, opts ...pulumi.ResourceOption) (*ResponsePlan, error) { 207 var resource ResponsePlan 208 err := ctx.ReadResource("aws:ssmincidents/responsePlan:ResponsePlan", name, id, state, &resource, opts...) 209 if err != nil { 210 return nil, err 211 } 212 return &resource, nil 213 } 214 215 // Input properties used for looking up and filtering ResponsePlan resources. 216 type responsePlanState struct { 217 // The actions that the response plan starts at the beginning of an incident. 218 Action *ResponsePlanAction `pulumi:"action"` 219 // The ARN of the response plan. 220 Arn *string `pulumi:"arn"` 221 // The Chatbot chat channel used for collaboration during an incident. 222 ChatChannels []string `pulumi:"chatChannels"` 223 // The long format of the response plan name. This field can contain spaces. 224 DisplayName *string `pulumi:"displayName"` 225 // The Amazon Resource Name (ARN) for the contacts and escalation plans that the response plan engages during an incident. 226 Engagements []string `pulumi:"engagements"` 227 IncidentTemplate *ResponsePlanIncidentTemplate `pulumi:"incidentTemplate"` 228 // Information about third-party services integrated into the response plan. The following values are supported: 229 Integration *ResponsePlanIntegration `pulumi:"integration"` 230 // The name of the response plan. 231 Name *string `pulumi:"name"` 232 // The tags applied to the response plan. 233 Tags map[string]string `pulumi:"tags"` 234 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 235 // 236 // Deprecated: Please use `tags` instead. 237 TagsAll map[string]string `pulumi:"tagsAll"` 238 } 239 240 type ResponsePlanState struct { 241 // The actions that the response plan starts at the beginning of an incident. 242 Action ResponsePlanActionPtrInput 243 // The ARN of the response plan. 244 Arn pulumi.StringPtrInput 245 // The Chatbot chat channel used for collaboration during an incident. 246 ChatChannels pulumi.StringArrayInput 247 // The long format of the response plan name. This field can contain spaces. 248 DisplayName pulumi.StringPtrInput 249 // The Amazon Resource Name (ARN) for the contacts and escalation plans that the response plan engages during an incident. 250 Engagements pulumi.StringArrayInput 251 IncidentTemplate ResponsePlanIncidentTemplatePtrInput 252 // Information about third-party services integrated into the response plan. The following values are supported: 253 Integration ResponsePlanIntegrationPtrInput 254 // The name of the response plan. 255 Name pulumi.StringPtrInput 256 // The tags applied to the response plan. 257 Tags pulumi.StringMapInput 258 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 259 // 260 // Deprecated: Please use `tags` instead. 261 TagsAll pulumi.StringMapInput 262 } 263 264 func (ResponsePlanState) ElementType() reflect.Type { 265 return reflect.TypeOf((*responsePlanState)(nil)).Elem() 266 } 267 268 type responsePlanArgs struct { 269 // The actions that the response plan starts at the beginning of an incident. 270 Action *ResponsePlanAction `pulumi:"action"` 271 // The Chatbot chat channel used for collaboration during an incident. 272 ChatChannels []string `pulumi:"chatChannels"` 273 // The long format of the response plan name. This field can contain spaces. 274 DisplayName *string `pulumi:"displayName"` 275 // The Amazon Resource Name (ARN) for the contacts and escalation plans that the response plan engages during an incident. 276 Engagements []string `pulumi:"engagements"` 277 IncidentTemplate ResponsePlanIncidentTemplate `pulumi:"incidentTemplate"` 278 // Information about third-party services integrated into the response plan. The following values are supported: 279 Integration *ResponsePlanIntegration `pulumi:"integration"` 280 // The name of the response plan. 281 Name *string `pulumi:"name"` 282 // The tags applied to the response plan. 283 Tags map[string]string `pulumi:"tags"` 284 } 285 286 // The set of arguments for constructing a ResponsePlan resource. 287 type ResponsePlanArgs struct { 288 // The actions that the response plan starts at the beginning of an incident. 289 Action ResponsePlanActionPtrInput 290 // The Chatbot chat channel used for collaboration during an incident. 291 ChatChannels pulumi.StringArrayInput 292 // The long format of the response plan name. This field can contain spaces. 293 DisplayName pulumi.StringPtrInput 294 // The Amazon Resource Name (ARN) for the contacts and escalation plans that the response plan engages during an incident. 295 Engagements pulumi.StringArrayInput 296 IncidentTemplate ResponsePlanIncidentTemplateInput 297 // Information about third-party services integrated into the response plan. The following values are supported: 298 Integration ResponsePlanIntegrationPtrInput 299 // The name of the response plan. 300 Name pulumi.StringPtrInput 301 // The tags applied to the response plan. 302 Tags pulumi.StringMapInput 303 } 304 305 func (ResponsePlanArgs) ElementType() reflect.Type { 306 return reflect.TypeOf((*responsePlanArgs)(nil)).Elem() 307 } 308 309 type ResponsePlanInput interface { 310 pulumi.Input 311 312 ToResponsePlanOutput() ResponsePlanOutput 313 ToResponsePlanOutputWithContext(ctx context.Context) ResponsePlanOutput 314 } 315 316 func (*ResponsePlan) ElementType() reflect.Type { 317 return reflect.TypeOf((**ResponsePlan)(nil)).Elem() 318 } 319 320 func (i *ResponsePlan) ToResponsePlanOutput() ResponsePlanOutput { 321 return i.ToResponsePlanOutputWithContext(context.Background()) 322 } 323 324 func (i *ResponsePlan) ToResponsePlanOutputWithContext(ctx context.Context) ResponsePlanOutput { 325 return pulumi.ToOutputWithContext(ctx, i).(ResponsePlanOutput) 326 } 327 328 // ResponsePlanArrayInput is an input type that accepts ResponsePlanArray and ResponsePlanArrayOutput values. 329 // You can construct a concrete instance of `ResponsePlanArrayInput` via: 330 // 331 // ResponsePlanArray{ ResponsePlanArgs{...} } 332 type ResponsePlanArrayInput interface { 333 pulumi.Input 334 335 ToResponsePlanArrayOutput() ResponsePlanArrayOutput 336 ToResponsePlanArrayOutputWithContext(context.Context) ResponsePlanArrayOutput 337 } 338 339 type ResponsePlanArray []ResponsePlanInput 340 341 func (ResponsePlanArray) ElementType() reflect.Type { 342 return reflect.TypeOf((*[]*ResponsePlan)(nil)).Elem() 343 } 344 345 func (i ResponsePlanArray) ToResponsePlanArrayOutput() ResponsePlanArrayOutput { 346 return i.ToResponsePlanArrayOutputWithContext(context.Background()) 347 } 348 349 func (i ResponsePlanArray) ToResponsePlanArrayOutputWithContext(ctx context.Context) ResponsePlanArrayOutput { 350 return pulumi.ToOutputWithContext(ctx, i).(ResponsePlanArrayOutput) 351 } 352 353 // ResponsePlanMapInput is an input type that accepts ResponsePlanMap and ResponsePlanMapOutput values. 354 // You can construct a concrete instance of `ResponsePlanMapInput` via: 355 // 356 // ResponsePlanMap{ "key": ResponsePlanArgs{...} } 357 type ResponsePlanMapInput interface { 358 pulumi.Input 359 360 ToResponsePlanMapOutput() ResponsePlanMapOutput 361 ToResponsePlanMapOutputWithContext(context.Context) ResponsePlanMapOutput 362 } 363 364 type ResponsePlanMap map[string]ResponsePlanInput 365 366 func (ResponsePlanMap) ElementType() reflect.Type { 367 return reflect.TypeOf((*map[string]*ResponsePlan)(nil)).Elem() 368 } 369 370 func (i ResponsePlanMap) ToResponsePlanMapOutput() ResponsePlanMapOutput { 371 return i.ToResponsePlanMapOutputWithContext(context.Background()) 372 } 373 374 func (i ResponsePlanMap) ToResponsePlanMapOutputWithContext(ctx context.Context) ResponsePlanMapOutput { 375 return pulumi.ToOutputWithContext(ctx, i).(ResponsePlanMapOutput) 376 } 377 378 type ResponsePlanOutput struct{ *pulumi.OutputState } 379 380 func (ResponsePlanOutput) ElementType() reflect.Type { 381 return reflect.TypeOf((**ResponsePlan)(nil)).Elem() 382 } 383 384 func (o ResponsePlanOutput) ToResponsePlanOutput() ResponsePlanOutput { 385 return o 386 } 387 388 func (o ResponsePlanOutput) ToResponsePlanOutputWithContext(ctx context.Context) ResponsePlanOutput { 389 return o 390 } 391 392 // The actions that the response plan starts at the beginning of an incident. 393 func (o ResponsePlanOutput) Action() ResponsePlanActionPtrOutput { 394 return o.ApplyT(func(v *ResponsePlan) ResponsePlanActionPtrOutput { return v.Action }).(ResponsePlanActionPtrOutput) 395 } 396 397 // The ARN of the response plan. 398 func (o ResponsePlanOutput) Arn() pulumi.StringOutput { 399 return o.ApplyT(func(v *ResponsePlan) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 400 } 401 402 // The Chatbot chat channel used for collaboration during an incident. 403 func (o ResponsePlanOutput) ChatChannels() pulumi.StringArrayOutput { 404 return o.ApplyT(func(v *ResponsePlan) pulumi.StringArrayOutput { return v.ChatChannels }).(pulumi.StringArrayOutput) 405 } 406 407 // The long format of the response plan name. This field can contain spaces. 408 func (o ResponsePlanOutput) DisplayName() pulumi.StringPtrOutput { 409 return o.ApplyT(func(v *ResponsePlan) pulumi.StringPtrOutput { return v.DisplayName }).(pulumi.StringPtrOutput) 410 } 411 412 // The Amazon Resource Name (ARN) for the contacts and escalation plans that the response plan engages during an incident. 413 func (o ResponsePlanOutput) Engagements() pulumi.StringArrayOutput { 414 return o.ApplyT(func(v *ResponsePlan) pulumi.StringArrayOutput { return v.Engagements }).(pulumi.StringArrayOutput) 415 } 416 417 func (o ResponsePlanOutput) IncidentTemplate() ResponsePlanIncidentTemplateOutput { 418 return o.ApplyT(func(v *ResponsePlan) ResponsePlanIncidentTemplateOutput { return v.IncidentTemplate }).(ResponsePlanIncidentTemplateOutput) 419 } 420 421 // Information about third-party services integrated into the response plan. The following values are supported: 422 func (o ResponsePlanOutput) Integration() ResponsePlanIntegrationPtrOutput { 423 return o.ApplyT(func(v *ResponsePlan) ResponsePlanIntegrationPtrOutput { return v.Integration }).(ResponsePlanIntegrationPtrOutput) 424 } 425 426 // The name of the response plan. 427 func (o ResponsePlanOutput) Name() pulumi.StringOutput { 428 return o.ApplyT(func(v *ResponsePlan) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 429 } 430 431 // The tags applied to the response plan. 432 func (o ResponsePlanOutput) Tags() pulumi.StringMapOutput { 433 return o.ApplyT(func(v *ResponsePlan) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 434 } 435 436 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 437 // 438 // Deprecated: Please use `tags` instead. 439 func (o ResponsePlanOutput) TagsAll() pulumi.StringMapOutput { 440 return o.ApplyT(func(v *ResponsePlan) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 441 } 442 443 type ResponsePlanArrayOutput struct{ *pulumi.OutputState } 444 445 func (ResponsePlanArrayOutput) ElementType() reflect.Type { 446 return reflect.TypeOf((*[]*ResponsePlan)(nil)).Elem() 447 } 448 449 func (o ResponsePlanArrayOutput) ToResponsePlanArrayOutput() ResponsePlanArrayOutput { 450 return o 451 } 452 453 func (o ResponsePlanArrayOutput) ToResponsePlanArrayOutputWithContext(ctx context.Context) ResponsePlanArrayOutput { 454 return o 455 } 456 457 func (o ResponsePlanArrayOutput) Index(i pulumi.IntInput) ResponsePlanOutput { 458 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ResponsePlan { 459 return vs[0].([]*ResponsePlan)[vs[1].(int)] 460 }).(ResponsePlanOutput) 461 } 462 463 type ResponsePlanMapOutput struct{ *pulumi.OutputState } 464 465 func (ResponsePlanMapOutput) ElementType() reflect.Type { 466 return reflect.TypeOf((*map[string]*ResponsePlan)(nil)).Elem() 467 } 468 469 func (o ResponsePlanMapOutput) ToResponsePlanMapOutput() ResponsePlanMapOutput { 470 return o 471 } 472 473 func (o ResponsePlanMapOutput) ToResponsePlanMapOutputWithContext(ctx context.Context) ResponsePlanMapOutput { 474 return o 475 } 476 477 func (o ResponsePlanMapOutput) MapIndex(k pulumi.StringInput) ResponsePlanOutput { 478 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ResponsePlan { 479 return vs[0].(map[string]*ResponsePlan)[vs[1].(string)] 480 }).(ResponsePlanOutput) 481 } 482 483 func init() { 484 pulumi.RegisterInputType(reflect.TypeOf((*ResponsePlanInput)(nil)).Elem(), &ResponsePlan{}) 485 pulumi.RegisterInputType(reflect.TypeOf((*ResponsePlanArrayInput)(nil)).Elem(), ResponsePlanArray{}) 486 pulumi.RegisterInputType(reflect.TypeOf((*ResponsePlanMapInput)(nil)).Elem(), ResponsePlanMap{}) 487 pulumi.RegisterOutputType(ResponsePlanOutput{}) 488 pulumi.RegisterOutputType(ResponsePlanArrayOutput{}) 489 pulumi.RegisterOutputType(ResponsePlanMapOutput{}) 490 }