github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ssmcontacts/getPlan.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 ssmcontacts 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 // Data source for managing a Plan of an AWS SSM Contact. 15 // 16 // ## Example Usage 17 // 18 // ### Basic Usage 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ssmcontacts" 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 := ssmcontacts.LookupPlan(ctx, &ssmcontacts.LookupPlanArgs{ 34 // ContactId: "arn:aws:ssm-contacts:us-west-2:123456789012:contact/contactalias", 35 // }, nil) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 func LookupPlan(ctx *pulumi.Context, args *LookupPlanArgs, opts ...pulumi.InvokeOption) (*LookupPlanResult, error) { 46 opts = internal.PkgInvokeDefaultOpts(opts) 47 var rv LookupPlanResult 48 err := ctx.Invoke("aws:ssmcontacts/getPlan:getPlan", args, &rv, opts...) 49 if err != nil { 50 return nil, err 51 } 52 return &rv, nil 53 } 54 55 // A collection of arguments for invoking getPlan. 56 type LookupPlanArgs struct { 57 // The Amazon Resource Name (ARN) of the contact or escalation plan. 58 ContactId string `pulumi:"contactId"` 59 } 60 61 // A collection of values returned by getPlan. 62 type LookupPlanResult struct { 63 ContactId string `pulumi:"contactId"` 64 // The provider-assigned unique ID for this managed resource. 65 Id string `pulumi:"id"` 66 // List of stages. A contact has an engagement plan with stages that contact specified contact channels. An escalation plan uses stages that contact specified contacts. 67 Stages []GetPlanStage `pulumi:"stages"` 68 } 69 70 func LookupPlanOutput(ctx *pulumi.Context, args LookupPlanOutputArgs, opts ...pulumi.InvokeOption) LookupPlanResultOutput { 71 return pulumi.ToOutputWithContext(context.Background(), args). 72 ApplyT(func(v interface{}) (LookupPlanResult, error) { 73 args := v.(LookupPlanArgs) 74 r, err := LookupPlan(ctx, &args, opts...) 75 var s LookupPlanResult 76 if r != nil { 77 s = *r 78 } 79 return s, err 80 }).(LookupPlanResultOutput) 81 } 82 83 // A collection of arguments for invoking getPlan. 84 type LookupPlanOutputArgs struct { 85 // The Amazon Resource Name (ARN) of the contact or escalation plan. 86 ContactId pulumi.StringInput `pulumi:"contactId"` 87 } 88 89 func (LookupPlanOutputArgs) ElementType() reflect.Type { 90 return reflect.TypeOf((*LookupPlanArgs)(nil)).Elem() 91 } 92 93 // A collection of values returned by getPlan. 94 type LookupPlanResultOutput struct{ *pulumi.OutputState } 95 96 func (LookupPlanResultOutput) ElementType() reflect.Type { 97 return reflect.TypeOf((*LookupPlanResult)(nil)).Elem() 98 } 99 100 func (o LookupPlanResultOutput) ToLookupPlanResultOutput() LookupPlanResultOutput { 101 return o 102 } 103 104 func (o LookupPlanResultOutput) ToLookupPlanResultOutputWithContext(ctx context.Context) LookupPlanResultOutput { 105 return o 106 } 107 108 func (o LookupPlanResultOutput) ContactId() pulumi.StringOutput { 109 return o.ApplyT(func(v LookupPlanResult) string { return v.ContactId }).(pulumi.StringOutput) 110 } 111 112 // The provider-assigned unique ID for this managed resource. 113 func (o LookupPlanResultOutput) Id() pulumi.StringOutput { 114 return o.ApplyT(func(v LookupPlanResult) string { return v.Id }).(pulumi.StringOutput) 115 } 116 117 // List of stages. A contact has an engagement plan with stages that contact specified contact channels. An escalation plan uses stages that contact specified contacts. 118 func (o LookupPlanResultOutput) Stages() GetPlanStageArrayOutput { 119 return o.ApplyT(func(v LookupPlanResult) []GetPlanStage { return v.Stages }).(GetPlanStageArrayOutput) 120 } 121 122 func init() { 123 pulumi.RegisterOutputType(LookupPlanResultOutput{}) 124 }