github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ses/identityNotificationTopic.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 ses 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 // Resource for managing SES Identity Notification Topics 16 // 17 // ## Example Usage 18 // 19 // <!--Start PulumiCodeChooser --> 20 // ```go 21 // package main 22 // 23 // import ( 24 // 25 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ses" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := ses.NewIdentityNotificationTopic(ctx, "test", &ses.IdentityNotificationTopicArgs{ 33 // TopicArn: pulumi.Any(exampleAwsSnsTopic.Arn), 34 // NotificationType: pulumi.String("Bounce"), 35 // Identity: pulumi.Any(example.Domain), 36 // IncludeOriginalHeaders: pulumi.Bool(true), 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ## Import 49 // 50 // Using `pulumi import`, import Identity Notification Topics using the ID of the record. The ID is made up as `IDENTITY|TYPE` where `IDENTITY` is the SES Identity and `TYPE` is the Notification Type. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:ses/identityNotificationTopic:IdentityNotificationTopic test 'example.com|Bounce' 54 // ``` 55 type IdentityNotificationTopic struct { 56 pulumi.CustomResourceState 57 58 // The identity for which the Amazon SNS topic will be set. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). 59 Identity pulumi.StringOutput `pulumi:"identity"` 60 // Whether SES should include original email headers in SNS notifications of this type. `false` by default. 61 IncludeOriginalHeaders pulumi.BoolPtrOutput `pulumi:"includeOriginalHeaders"` 62 // The type of notifications that will be published to the specified Amazon SNS topic. Valid Values: `Bounce`, `Complaint` or `Delivery`. 63 NotificationType pulumi.StringOutput `pulumi:"notificationType"` 64 // The Amazon Resource Name (ARN) of the Amazon SNS topic. Can be set to `""` (an empty string) to disable publishing. 65 TopicArn pulumi.StringPtrOutput `pulumi:"topicArn"` 66 } 67 68 // NewIdentityNotificationTopic registers a new resource with the given unique name, arguments, and options. 69 func NewIdentityNotificationTopic(ctx *pulumi.Context, 70 name string, args *IdentityNotificationTopicArgs, opts ...pulumi.ResourceOption) (*IdentityNotificationTopic, error) { 71 if args == nil { 72 return nil, errors.New("missing one or more required arguments") 73 } 74 75 if args.Identity == nil { 76 return nil, errors.New("invalid value for required argument 'Identity'") 77 } 78 if args.NotificationType == nil { 79 return nil, errors.New("invalid value for required argument 'NotificationType'") 80 } 81 opts = internal.PkgResourceDefaultOpts(opts) 82 var resource IdentityNotificationTopic 83 err := ctx.RegisterResource("aws:ses/identityNotificationTopic:IdentityNotificationTopic", name, args, &resource, opts...) 84 if err != nil { 85 return nil, err 86 } 87 return &resource, nil 88 } 89 90 // GetIdentityNotificationTopic gets an existing IdentityNotificationTopic resource's state with the given name, ID, and optional 91 // state properties that are used to uniquely qualify the lookup (nil if not required). 92 func GetIdentityNotificationTopic(ctx *pulumi.Context, 93 name string, id pulumi.IDInput, state *IdentityNotificationTopicState, opts ...pulumi.ResourceOption) (*IdentityNotificationTopic, error) { 94 var resource IdentityNotificationTopic 95 err := ctx.ReadResource("aws:ses/identityNotificationTopic:IdentityNotificationTopic", name, id, state, &resource, opts...) 96 if err != nil { 97 return nil, err 98 } 99 return &resource, nil 100 } 101 102 // Input properties used for looking up and filtering IdentityNotificationTopic resources. 103 type identityNotificationTopicState struct { 104 // The identity for which the Amazon SNS topic will be set. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). 105 Identity *string `pulumi:"identity"` 106 // Whether SES should include original email headers in SNS notifications of this type. `false` by default. 107 IncludeOriginalHeaders *bool `pulumi:"includeOriginalHeaders"` 108 // The type of notifications that will be published to the specified Amazon SNS topic. Valid Values: `Bounce`, `Complaint` or `Delivery`. 109 NotificationType *string `pulumi:"notificationType"` 110 // The Amazon Resource Name (ARN) of the Amazon SNS topic. Can be set to `""` (an empty string) to disable publishing. 111 TopicArn *string `pulumi:"topicArn"` 112 } 113 114 type IdentityNotificationTopicState struct { 115 // The identity for which the Amazon SNS topic will be set. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). 116 Identity pulumi.StringPtrInput 117 // Whether SES should include original email headers in SNS notifications of this type. `false` by default. 118 IncludeOriginalHeaders pulumi.BoolPtrInput 119 // The type of notifications that will be published to the specified Amazon SNS topic. Valid Values: `Bounce`, `Complaint` or `Delivery`. 120 NotificationType pulumi.StringPtrInput 121 // The Amazon Resource Name (ARN) of the Amazon SNS topic. Can be set to `""` (an empty string) to disable publishing. 122 TopicArn pulumi.StringPtrInput 123 } 124 125 func (IdentityNotificationTopicState) ElementType() reflect.Type { 126 return reflect.TypeOf((*identityNotificationTopicState)(nil)).Elem() 127 } 128 129 type identityNotificationTopicArgs struct { 130 // The identity for which the Amazon SNS topic will be set. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). 131 Identity string `pulumi:"identity"` 132 // Whether SES should include original email headers in SNS notifications of this type. `false` by default. 133 IncludeOriginalHeaders *bool `pulumi:"includeOriginalHeaders"` 134 // The type of notifications that will be published to the specified Amazon SNS topic. Valid Values: `Bounce`, `Complaint` or `Delivery`. 135 NotificationType string `pulumi:"notificationType"` 136 // The Amazon Resource Name (ARN) of the Amazon SNS topic. Can be set to `""` (an empty string) to disable publishing. 137 TopicArn *string `pulumi:"topicArn"` 138 } 139 140 // The set of arguments for constructing a IdentityNotificationTopic resource. 141 type IdentityNotificationTopicArgs struct { 142 // The identity for which the Amazon SNS topic will be set. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). 143 Identity pulumi.StringInput 144 // Whether SES should include original email headers in SNS notifications of this type. `false` by default. 145 IncludeOriginalHeaders pulumi.BoolPtrInput 146 // The type of notifications that will be published to the specified Amazon SNS topic. Valid Values: `Bounce`, `Complaint` or `Delivery`. 147 NotificationType pulumi.StringInput 148 // The Amazon Resource Name (ARN) of the Amazon SNS topic. Can be set to `""` (an empty string) to disable publishing. 149 TopicArn pulumi.StringPtrInput 150 } 151 152 func (IdentityNotificationTopicArgs) ElementType() reflect.Type { 153 return reflect.TypeOf((*identityNotificationTopicArgs)(nil)).Elem() 154 } 155 156 type IdentityNotificationTopicInput interface { 157 pulumi.Input 158 159 ToIdentityNotificationTopicOutput() IdentityNotificationTopicOutput 160 ToIdentityNotificationTopicOutputWithContext(ctx context.Context) IdentityNotificationTopicOutput 161 } 162 163 func (*IdentityNotificationTopic) ElementType() reflect.Type { 164 return reflect.TypeOf((**IdentityNotificationTopic)(nil)).Elem() 165 } 166 167 func (i *IdentityNotificationTopic) ToIdentityNotificationTopicOutput() IdentityNotificationTopicOutput { 168 return i.ToIdentityNotificationTopicOutputWithContext(context.Background()) 169 } 170 171 func (i *IdentityNotificationTopic) ToIdentityNotificationTopicOutputWithContext(ctx context.Context) IdentityNotificationTopicOutput { 172 return pulumi.ToOutputWithContext(ctx, i).(IdentityNotificationTopicOutput) 173 } 174 175 // IdentityNotificationTopicArrayInput is an input type that accepts IdentityNotificationTopicArray and IdentityNotificationTopicArrayOutput values. 176 // You can construct a concrete instance of `IdentityNotificationTopicArrayInput` via: 177 // 178 // IdentityNotificationTopicArray{ IdentityNotificationTopicArgs{...} } 179 type IdentityNotificationTopicArrayInput interface { 180 pulumi.Input 181 182 ToIdentityNotificationTopicArrayOutput() IdentityNotificationTopicArrayOutput 183 ToIdentityNotificationTopicArrayOutputWithContext(context.Context) IdentityNotificationTopicArrayOutput 184 } 185 186 type IdentityNotificationTopicArray []IdentityNotificationTopicInput 187 188 func (IdentityNotificationTopicArray) ElementType() reflect.Type { 189 return reflect.TypeOf((*[]*IdentityNotificationTopic)(nil)).Elem() 190 } 191 192 func (i IdentityNotificationTopicArray) ToIdentityNotificationTopicArrayOutput() IdentityNotificationTopicArrayOutput { 193 return i.ToIdentityNotificationTopicArrayOutputWithContext(context.Background()) 194 } 195 196 func (i IdentityNotificationTopicArray) ToIdentityNotificationTopicArrayOutputWithContext(ctx context.Context) IdentityNotificationTopicArrayOutput { 197 return pulumi.ToOutputWithContext(ctx, i).(IdentityNotificationTopicArrayOutput) 198 } 199 200 // IdentityNotificationTopicMapInput is an input type that accepts IdentityNotificationTopicMap and IdentityNotificationTopicMapOutput values. 201 // You can construct a concrete instance of `IdentityNotificationTopicMapInput` via: 202 // 203 // IdentityNotificationTopicMap{ "key": IdentityNotificationTopicArgs{...} } 204 type IdentityNotificationTopicMapInput interface { 205 pulumi.Input 206 207 ToIdentityNotificationTopicMapOutput() IdentityNotificationTopicMapOutput 208 ToIdentityNotificationTopicMapOutputWithContext(context.Context) IdentityNotificationTopicMapOutput 209 } 210 211 type IdentityNotificationTopicMap map[string]IdentityNotificationTopicInput 212 213 func (IdentityNotificationTopicMap) ElementType() reflect.Type { 214 return reflect.TypeOf((*map[string]*IdentityNotificationTopic)(nil)).Elem() 215 } 216 217 func (i IdentityNotificationTopicMap) ToIdentityNotificationTopicMapOutput() IdentityNotificationTopicMapOutput { 218 return i.ToIdentityNotificationTopicMapOutputWithContext(context.Background()) 219 } 220 221 func (i IdentityNotificationTopicMap) ToIdentityNotificationTopicMapOutputWithContext(ctx context.Context) IdentityNotificationTopicMapOutput { 222 return pulumi.ToOutputWithContext(ctx, i).(IdentityNotificationTopicMapOutput) 223 } 224 225 type IdentityNotificationTopicOutput struct{ *pulumi.OutputState } 226 227 func (IdentityNotificationTopicOutput) ElementType() reflect.Type { 228 return reflect.TypeOf((**IdentityNotificationTopic)(nil)).Elem() 229 } 230 231 func (o IdentityNotificationTopicOutput) ToIdentityNotificationTopicOutput() IdentityNotificationTopicOutput { 232 return o 233 } 234 235 func (o IdentityNotificationTopicOutput) ToIdentityNotificationTopicOutputWithContext(ctx context.Context) IdentityNotificationTopicOutput { 236 return o 237 } 238 239 // The identity for which the Amazon SNS topic will be set. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). 240 func (o IdentityNotificationTopicOutput) Identity() pulumi.StringOutput { 241 return o.ApplyT(func(v *IdentityNotificationTopic) pulumi.StringOutput { return v.Identity }).(pulumi.StringOutput) 242 } 243 244 // Whether SES should include original email headers in SNS notifications of this type. `false` by default. 245 func (o IdentityNotificationTopicOutput) IncludeOriginalHeaders() pulumi.BoolPtrOutput { 246 return o.ApplyT(func(v *IdentityNotificationTopic) pulumi.BoolPtrOutput { return v.IncludeOriginalHeaders }).(pulumi.BoolPtrOutput) 247 } 248 249 // The type of notifications that will be published to the specified Amazon SNS topic. Valid Values: `Bounce`, `Complaint` or `Delivery`. 250 func (o IdentityNotificationTopicOutput) NotificationType() pulumi.StringOutput { 251 return o.ApplyT(func(v *IdentityNotificationTopic) pulumi.StringOutput { return v.NotificationType }).(pulumi.StringOutput) 252 } 253 254 // The Amazon Resource Name (ARN) of the Amazon SNS topic. Can be set to `""` (an empty string) to disable publishing. 255 func (o IdentityNotificationTopicOutput) TopicArn() pulumi.StringPtrOutput { 256 return o.ApplyT(func(v *IdentityNotificationTopic) pulumi.StringPtrOutput { return v.TopicArn }).(pulumi.StringPtrOutput) 257 } 258 259 type IdentityNotificationTopicArrayOutput struct{ *pulumi.OutputState } 260 261 func (IdentityNotificationTopicArrayOutput) ElementType() reflect.Type { 262 return reflect.TypeOf((*[]*IdentityNotificationTopic)(nil)).Elem() 263 } 264 265 func (o IdentityNotificationTopicArrayOutput) ToIdentityNotificationTopicArrayOutput() IdentityNotificationTopicArrayOutput { 266 return o 267 } 268 269 func (o IdentityNotificationTopicArrayOutput) ToIdentityNotificationTopicArrayOutputWithContext(ctx context.Context) IdentityNotificationTopicArrayOutput { 270 return o 271 } 272 273 func (o IdentityNotificationTopicArrayOutput) Index(i pulumi.IntInput) IdentityNotificationTopicOutput { 274 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *IdentityNotificationTopic { 275 return vs[0].([]*IdentityNotificationTopic)[vs[1].(int)] 276 }).(IdentityNotificationTopicOutput) 277 } 278 279 type IdentityNotificationTopicMapOutput struct{ *pulumi.OutputState } 280 281 func (IdentityNotificationTopicMapOutput) ElementType() reflect.Type { 282 return reflect.TypeOf((*map[string]*IdentityNotificationTopic)(nil)).Elem() 283 } 284 285 func (o IdentityNotificationTopicMapOutput) ToIdentityNotificationTopicMapOutput() IdentityNotificationTopicMapOutput { 286 return o 287 } 288 289 func (o IdentityNotificationTopicMapOutput) ToIdentityNotificationTopicMapOutputWithContext(ctx context.Context) IdentityNotificationTopicMapOutput { 290 return o 291 } 292 293 func (o IdentityNotificationTopicMapOutput) MapIndex(k pulumi.StringInput) IdentityNotificationTopicOutput { 294 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *IdentityNotificationTopic { 295 return vs[0].(map[string]*IdentityNotificationTopic)[vs[1].(string)] 296 }).(IdentityNotificationTopicOutput) 297 } 298 299 func init() { 300 pulumi.RegisterInputType(reflect.TypeOf((*IdentityNotificationTopicInput)(nil)).Elem(), &IdentityNotificationTopic{}) 301 pulumi.RegisterInputType(reflect.TypeOf((*IdentityNotificationTopicArrayInput)(nil)).Elem(), IdentityNotificationTopicArray{}) 302 pulumi.RegisterInputType(reflect.TypeOf((*IdentityNotificationTopicMapInput)(nil)).Elem(), IdentityNotificationTopicMap{}) 303 pulumi.RegisterOutputType(IdentityNotificationTopicOutput{}) 304 pulumi.RegisterOutputType(IdentityNotificationTopicArrayOutput{}) 305 pulumi.RegisterOutputType(IdentityNotificationTopicMapOutput{}) 306 }