github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/devopsguru/notificationChannel.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 devopsguru 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 // Resource for managing an AWS DevOps Guru Notification Channel. 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/devopsguru" 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 := devopsguru.NewNotificationChannel(ctx, "example", &devopsguru.NotificationChannelArgs{ 34 // Sns: &devopsguru.NotificationChannelSnsArgs{ 35 // TopicArn: pulumi.Any(exampleAwsSnsTopic.Arn), 36 // }, 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ### Filters 49 // 50 // <!--Start PulumiCodeChooser --> 51 // ```go 52 // package main 53 // 54 // import ( 55 // 56 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/devopsguru" 57 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 58 // 59 // ) 60 // 61 // func main() { 62 // pulumi.Run(func(ctx *pulumi.Context) error { 63 // _, err := devopsguru.NewNotificationChannel(ctx, "example", &devopsguru.NotificationChannelArgs{ 64 // Sns: &devopsguru.NotificationChannelSnsArgs{ 65 // TopicArn: pulumi.Any(exampleAwsSnsTopic.Arn), 66 // }, 67 // Filters: &devopsguru.NotificationChannelFiltersArgs{ 68 // MessageTypes: pulumi.StringArray{ 69 // pulumi.String("NEW_INSIGHT"), 70 // }, 71 // Severities: pulumi.StringArray{ 72 // pulumi.String("HIGH"), 73 // }, 74 // }, 75 // }) 76 // if err != nil { 77 // return err 78 // } 79 // return nil 80 // }) 81 // } 82 // 83 // ``` 84 // <!--End PulumiCodeChooser --> 85 // 86 // ## Import 87 // 88 // Using `pulumi import`, import DevOps Guru Notification Channel using the `id`. For example: 89 // 90 // ```sh 91 // $ pulumi import aws:devopsguru/notificationChannel:NotificationChannel example id-12345678 92 // ``` 93 type NotificationChannel struct { 94 pulumi.CustomResourceState 95 96 // Filter configurations for the Amazon SNS notification topic. See the `filters` argument reference below. 97 Filters NotificationChannelFiltersPtrOutput `pulumi:"filters"` 98 // SNS noficiation channel configurations. See the `sns` argument reference below. 99 // 100 // The following arguments are optional: 101 Sns NotificationChannelSnsPtrOutput `pulumi:"sns"` 102 } 103 104 // NewNotificationChannel registers a new resource with the given unique name, arguments, and options. 105 func NewNotificationChannel(ctx *pulumi.Context, 106 name string, args *NotificationChannelArgs, opts ...pulumi.ResourceOption) (*NotificationChannel, error) { 107 if args == nil { 108 args = &NotificationChannelArgs{} 109 } 110 111 opts = internal.PkgResourceDefaultOpts(opts) 112 var resource NotificationChannel 113 err := ctx.RegisterResource("aws:devopsguru/notificationChannel:NotificationChannel", name, args, &resource, opts...) 114 if err != nil { 115 return nil, err 116 } 117 return &resource, nil 118 } 119 120 // GetNotificationChannel gets an existing NotificationChannel resource's state with the given name, ID, and optional 121 // state properties that are used to uniquely qualify the lookup (nil if not required). 122 func GetNotificationChannel(ctx *pulumi.Context, 123 name string, id pulumi.IDInput, state *NotificationChannelState, opts ...pulumi.ResourceOption) (*NotificationChannel, error) { 124 var resource NotificationChannel 125 err := ctx.ReadResource("aws:devopsguru/notificationChannel:NotificationChannel", name, id, state, &resource, opts...) 126 if err != nil { 127 return nil, err 128 } 129 return &resource, nil 130 } 131 132 // Input properties used for looking up and filtering NotificationChannel resources. 133 type notificationChannelState struct { 134 // Filter configurations for the Amazon SNS notification topic. See the `filters` argument reference below. 135 Filters *NotificationChannelFilters `pulumi:"filters"` 136 // SNS noficiation channel configurations. See the `sns` argument reference below. 137 // 138 // The following arguments are optional: 139 Sns *NotificationChannelSns `pulumi:"sns"` 140 } 141 142 type NotificationChannelState struct { 143 // Filter configurations for the Amazon SNS notification topic. See the `filters` argument reference below. 144 Filters NotificationChannelFiltersPtrInput 145 // SNS noficiation channel configurations. See the `sns` argument reference below. 146 // 147 // The following arguments are optional: 148 Sns NotificationChannelSnsPtrInput 149 } 150 151 func (NotificationChannelState) ElementType() reflect.Type { 152 return reflect.TypeOf((*notificationChannelState)(nil)).Elem() 153 } 154 155 type notificationChannelArgs struct { 156 // Filter configurations for the Amazon SNS notification topic. See the `filters` argument reference below. 157 Filters *NotificationChannelFilters `pulumi:"filters"` 158 // SNS noficiation channel configurations. See the `sns` argument reference below. 159 // 160 // The following arguments are optional: 161 Sns *NotificationChannelSns `pulumi:"sns"` 162 } 163 164 // The set of arguments for constructing a NotificationChannel resource. 165 type NotificationChannelArgs struct { 166 // Filter configurations for the Amazon SNS notification topic. See the `filters` argument reference below. 167 Filters NotificationChannelFiltersPtrInput 168 // SNS noficiation channel configurations. See the `sns` argument reference below. 169 // 170 // The following arguments are optional: 171 Sns NotificationChannelSnsPtrInput 172 } 173 174 func (NotificationChannelArgs) ElementType() reflect.Type { 175 return reflect.TypeOf((*notificationChannelArgs)(nil)).Elem() 176 } 177 178 type NotificationChannelInput interface { 179 pulumi.Input 180 181 ToNotificationChannelOutput() NotificationChannelOutput 182 ToNotificationChannelOutputWithContext(ctx context.Context) NotificationChannelOutput 183 } 184 185 func (*NotificationChannel) ElementType() reflect.Type { 186 return reflect.TypeOf((**NotificationChannel)(nil)).Elem() 187 } 188 189 func (i *NotificationChannel) ToNotificationChannelOutput() NotificationChannelOutput { 190 return i.ToNotificationChannelOutputWithContext(context.Background()) 191 } 192 193 func (i *NotificationChannel) ToNotificationChannelOutputWithContext(ctx context.Context) NotificationChannelOutput { 194 return pulumi.ToOutputWithContext(ctx, i).(NotificationChannelOutput) 195 } 196 197 // NotificationChannelArrayInput is an input type that accepts NotificationChannelArray and NotificationChannelArrayOutput values. 198 // You can construct a concrete instance of `NotificationChannelArrayInput` via: 199 // 200 // NotificationChannelArray{ NotificationChannelArgs{...} } 201 type NotificationChannelArrayInput interface { 202 pulumi.Input 203 204 ToNotificationChannelArrayOutput() NotificationChannelArrayOutput 205 ToNotificationChannelArrayOutputWithContext(context.Context) NotificationChannelArrayOutput 206 } 207 208 type NotificationChannelArray []NotificationChannelInput 209 210 func (NotificationChannelArray) ElementType() reflect.Type { 211 return reflect.TypeOf((*[]*NotificationChannel)(nil)).Elem() 212 } 213 214 func (i NotificationChannelArray) ToNotificationChannelArrayOutput() NotificationChannelArrayOutput { 215 return i.ToNotificationChannelArrayOutputWithContext(context.Background()) 216 } 217 218 func (i NotificationChannelArray) ToNotificationChannelArrayOutputWithContext(ctx context.Context) NotificationChannelArrayOutput { 219 return pulumi.ToOutputWithContext(ctx, i).(NotificationChannelArrayOutput) 220 } 221 222 // NotificationChannelMapInput is an input type that accepts NotificationChannelMap and NotificationChannelMapOutput values. 223 // You can construct a concrete instance of `NotificationChannelMapInput` via: 224 // 225 // NotificationChannelMap{ "key": NotificationChannelArgs{...} } 226 type NotificationChannelMapInput interface { 227 pulumi.Input 228 229 ToNotificationChannelMapOutput() NotificationChannelMapOutput 230 ToNotificationChannelMapOutputWithContext(context.Context) NotificationChannelMapOutput 231 } 232 233 type NotificationChannelMap map[string]NotificationChannelInput 234 235 func (NotificationChannelMap) ElementType() reflect.Type { 236 return reflect.TypeOf((*map[string]*NotificationChannel)(nil)).Elem() 237 } 238 239 func (i NotificationChannelMap) ToNotificationChannelMapOutput() NotificationChannelMapOutput { 240 return i.ToNotificationChannelMapOutputWithContext(context.Background()) 241 } 242 243 func (i NotificationChannelMap) ToNotificationChannelMapOutputWithContext(ctx context.Context) NotificationChannelMapOutput { 244 return pulumi.ToOutputWithContext(ctx, i).(NotificationChannelMapOutput) 245 } 246 247 type NotificationChannelOutput struct{ *pulumi.OutputState } 248 249 func (NotificationChannelOutput) ElementType() reflect.Type { 250 return reflect.TypeOf((**NotificationChannel)(nil)).Elem() 251 } 252 253 func (o NotificationChannelOutput) ToNotificationChannelOutput() NotificationChannelOutput { 254 return o 255 } 256 257 func (o NotificationChannelOutput) ToNotificationChannelOutputWithContext(ctx context.Context) NotificationChannelOutput { 258 return o 259 } 260 261 // Filter configurations for the Amazon SNS notification topic. See the `filters` argument reference below. 262 func (o NotificationChannelOutput) Filters() NotificationChannelFiltersPtrOutput { 263 return o.ApplyT(func(v *NotificationChannel) NotificationChannelFiltersPtrOutput { return v.Filters }).(NotificationChannelFiltersPtrOutput) 264 } 265 266 // SNS noficiation channel configurations. See the `sns` argument reference below. 267 // 268 // The following arguments are optional: 269 func (o NotificationChannelOutput) Sns() NotificationChannelSnsPtrOutput { 270 return o.ApplyT(func(v *NotificationChannel) NotificationChannelSnsPtrOutput { return v.Sns }).(NotificationChannelSnsPtrOutput) 271 } 272 273 type NotificationChannelArrayOutput struct{ *pulumi.OutputState } 274 275 func (NotificationChannelArrayOutput) ElementType() reflect.Type { 276 return reflect.TypeOf((*[]*NotificationChannel)(nil)).Elem() 277 } 278 279 func (o NotificationChannelArrayOutput) ToNotificationChannelArrayOutput() NotificationChannelArrayOutput { 280 return o 281 } 282 283 func (o NotificationChannelArrayOutput) ToNotificationChannelArrayOutputWithContext(ctx context.Context) NotificationChannelArrayOutput { 284 return o 285 } 286 287 func (o NotificationChannelArrayOutput) Index(i pulumi.IntInput) NotificationChannelOutput { 288 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *NotificationChannel { 289 return vs[0].([]*NotificationChannel)[vs[1].(int)] 290 }).(NotificationChannelOutput) 291 } 292 293 type NotificationChannelMapOutput struct{ *pulumi.OutputState } 294 295 func (NotificationChannelMapOutput) ElementType() reflect.Type { 296 return reflect.TypeOf((*map[string]*NotificationChannel)(nil)).Elem() 297 } 298 299 func (o NotificationChannelMapOutput) ToNotificationChannelMapOutput() NotificationChannelMapOutput { 300 return o 301 } 302 303 func (o NotificationChannelMapOutput) ToNotificationChannelMapOutputWithContext(ctx context.Context) NotificationChannelMapOutput { 304 return o 305 } 306 307 func (o NotificationChannelMapOutput) MapIndex(k pulumi.StringInput) NotificationChannelOutput { 308 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *NotificationChannel { 309 return vs[0].(map[string]*NotificationChannel)[vs[1].(string)] 310 }).(NotificationChannelOutput) 311 } 312 313 func init() { 314 pulumi.RegisterInputType(reflect.TypeOf((*NotificationChannelInput)(nil)).Elem(), &NotificationChannel{}) 315 pulumi.RegisterInputType(reflect.TypeOf((*NotificationChannelArrayInput)(nil)).Elem(), NotificationChannelArray{}) 316 pulumi.RegisterInputType(reflect.TypeOf((*NotificationChannelMapInput)(nil)).Elem(), NotificationChannelMap{}) 317 pulumi.RegisterOutputType(NotificationChannelOutput{}) 318 pulumi.RegisterOutputType(NotificationChannelArrayOutput{}) 319 pulumi.RegisterOutputType(NotificationChannelMapOutput{}) 320 }