github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sesv2/configurationSetEventDestination.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 sesv2 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 an AWS SESv2 (Simple Email V2) Configuration Set Event Destination. 16 // 17 // ## Example Usage 18 // 19 // ### Cloud Watch Destination 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sesv2" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // example, err := sesv2.NewConfigurationSet(ctx, "example", &sesv2.ConfigurationSetArgs{ 35 // ConfigurationSetName: pulumi.String("example"), 36 // }) 37 // if err != nil { 38 // return err 39 // } 40 // _, err = sesv2.NewConfigurationSetEventDestination(ctx, "example", &sesv2.ConfigurationSetEventDestinationArgs{ 41 // ConfigurationSetName: example.ConfigurationSetName, 42 // EventDestinationName: pulumi.String("example"), 43 // EventDestination: &sesv2.ConfigurationSetEventDestinationEventDestinationArgs{ 44 // CloudWatchDestination: &sesv2.ConfigurationSetEventDestinationEventDestinationCloudWatchDestinationArgs{ 45 // DimensionConfigurations: sesv2.ConfigurationSetEventDestinationEventDestinationCloudWatchDestinationDimensionConfigurationArray{ 46 // &sesv2.ConfigurationSetEventDestinationEventDestinationCloudWatchDestinationDimensionConfigurationArgs{ 47 // DefaultDimensionValue: pulumi.String("example"), 48 // DimensionName: pulumi.String("example"), 49 // DimensionValueSource: pulumi.String("MESSAGE_TAG"), 50 // }, 51 // }, 52 // }, 53 // Enabled: pulumi.Bool(true), 54 // MatchingEventTypes: pulumi.StringArray{ 55 // pulumi.String("SEND"), 56 // }, 57 // }, 58 // }) 59 // if err != nil { 60 // return err 61 // } 62 // return nil 63 // }) 64 // } 65 // 66 // ``` 67 // <!--End PulumiCodeChooser --> 68 // 69 // ### Kinesis Firehose Destination 70 // 71 // <!--Start PulumiCodeChooser --> 72 // ```go 73 // package main 74 // 75 // import ( 76 // 77 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sesv2" 78 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 79 // 80 // ) 81 // 82 // func main() { 83 // pulumi.Run(func(ctx *pulumi.Context) error { 84 // example, err := sesv2.NewConfigurationSet(ctx, "example", &sesv2.ConfigurationSetArgs{ 85 // ConfigurationSetName: pulumi.String("example"), 86 // }) 87 // if err != nil { 88 // return err 89 // } 90 // _, err = sesv2.NewConfigurationSetEventDestination(ctx, "example", &sesv2.ConfigurationSetEventDestinationArgs{ 91 // ConfigurationSetName: example.ConfigurationSetName, 92 // EventDestinationName: pulumi.String("example"), 93 // EventDestination: &sesv2.ConfigurationSetEventDestinationEventDestinationArgs{ 94 // KinesisFirehoseDestination: &sesv2.ConfigurationSetEventDestinationEventDestinationKinesisFirehoseDestinationArgs{ 95 // DeliveryStreamArn: pulumi.Any(exampleAwsKinesisFirehoseDeliveryStream.Arn), 96 // IamRoleArn: pulumi.Any(exampleAwsIamRole.Arn), 97 // }, 98 // Enabled: pulumi.Bool(true), 99 // MatchingEventTypes: pulumi.StringArray{ 100 // pulumi.String("SEND"), 101 // }, 102 // }, 103 // }) 104 // if err != nil { 105 // return err 106 // } 107 // return nil 108 // }) 109 // } 110 // 111 // ``` 112 // <!--End PulumiCodeChooser --> 113 // 114 // ### Pinpoint Destination 115 // 116 // <!--Start PulumiCodeChooser --> 117 // ```go 118 // package main 119 // 120 // import ( 121 // 122 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sesv2" 123 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 124 // 125 // ) 126 // 127 // func main() { 128 // pulumi.Run(func(ctx *pulumi.Context) error { 129 // example, err := sesv2.NewConfigurationSet(ctx, "example", &sesv2.ConfigurationSetArgs{ 130 // ConfigurationSetName: pulumi.String("example"), 131 // }) 132 // if err != nil { 133 // return err 134 // } 135 // _, err = sesv2.NewConfigurationSetEventDestination(ctx, "example", &sesv2.ConfigurationSetEventDestinationArgs{ 136 // ConfigurationSetName: example.ConfigurationSetName, 137 // EventDestinationName: pulumi.String("example"), 138 // EventDestination: &sesv2.ConfigurationSetEventDestinationEventDestinationArgs{ 139 // PinpointDestination: &sesv2.ConfigurationSetEventDestinationEventDestinationPinpointDestinationArgs{ 140 // ApplicationArn: pulumi.Any(exampleAwsPinpointApp.Arn), 141 // }, 142 // Enabled: pulumi.Bool(true), 143 // MatchingEventTypes: pulumi.StringArray{ 144 // pulumi.String("SEND"), 145 // }, 146 // }, 147 // }) 148 // if err != nil { 149 // return err 150 // } 151 // return nil 152 // }) 153 // } 154 // 155 // ``` 156 // <!--End PulumiCodeChooser --> 157 // 158 // ### SNS Destination 159 // 160 // <!--Start PulumiCodeChooser --> 161 // ```go 162 // package main 163 // 164 // import ( 165 // 166 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sesv2" 167 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 168 // 169 // ) 170 // 171 // func main() { 172 // pulumi.Run(func(ctx *pulumi.Context) error { 173 // example, err := sesv2.NewConfigurationSet(ctx, "example", &sesv2.ConfigurationSetArgs{ 174 // ConfigurationSetName: pulumi.String("example"), 175 // }) 176 // if err != nil { 177 // return err 178 // } 179 // _, err = sesv2.NewConfigurationSetEventDestination(ctx, "example", &sesv2.ConfigurationSetEventDestinationArgs{ 180 // ConfigurationSetName: example.ConfigurationSetName, 181 // EventDestinationName: pulumi.String("example"), 182 // EventDestination: &sesv2.ConfigurationSetEventDestinationEventDestinationArgs{ 183 // SnsDestination: &sesv2.ConfigurationSetEventDestinationEventDestinationSnsDestinationArgs{ 184 // TopicArn: pulumi.Any(exampleAwsSnsTopic.Arn), 185 // }, 186 // Enabled: pulumi.Bool(true), 187 // MatchingEventTypes: pulumi.StringArray{ 188 // pulumi.String("SEND"), 189 // }, 190 // }, 191 // }) 192 // if err != nil { 193 // return err 194 // } 195 // return nil 196 // }) 197 // } 198 // 199 // ``` 200 // <!--End PulumiCodeChooser --> 201 // 202 // ## Import 203 // 204 // Using `pulumi import`, import SESv2 (Simple Email V2) Configuration Set Event Destination using the `id` (`configuration_set_name|event_destination_name`). For example: 205 // 206 // ```sh 207 // $ pulumi import aws:sesv2/configurationSetEventDestination:ConfigurationSetEventDestination example example_configuration_set|example_event_destination 208 // ``` 209 type ConfigurationSetEventDestination struct { 210 pulumi.CustomResourceState 211 212 // The name of the configuration set. 213 ConfigurationSetName pulumi.StringOutput `pulumi:"configurationSetName"` 214 // A name that identifies the event destination within the configuration set. 215 EventDestination ConfigurationSetEventDestinationEventDestinationOutput `pulumi:"eventDestination"` 216 // An object that defines the event destination. See eventDestination below. 217 EventDestinationName pulumi.StringOutput `pulumi:"eventDestinationName"` 218 } 219 220 // NewConfigurationSetEventDestination registers a new resource with the given unique name, arguments, and options. 221 func NewConfigurationSetEventDestination(ctx *pulumi.Context, 222 name string, args *ConfigurationSetEventDestinationArgs, opts ...pulumi.ResourceOption) (*ConfigurationSetEventDestination, error) { 223 if args == nil { 224 return nil, errors.New("missing one or more required arguments") 225 } 226 227 if args.ConfigurationSetName == nil { 228 return nil, errors.New("invalid value for required argument 'ConfigurationSetName'") 229 } 230 if args.EventDestination == nil { 231 return nil, errors.New("invalid value for required argument 'EventDestination'") 232 } 233 if args.EventDestinationName == nil { 234 return nil, errors.New("invalid value for required argument 'EventDestinationName'") 235 } 236 opts = internal.PkgResourceDefaultOpts(opts) 237 var resource ConfigurationSetEventDestination 238 err := ctx.RegisterResource("aws:sesv2/configurationSetEventDestination:ConfigurationSetEventDestination", name, args, &resource, opts...) 239 if err != nil { 240 return nil, err 241 } 242 return &resource, nil 243 } 244 245 // GetConfigurationSetEventDestination gets an existing ConfigurationSetEventDestination resource's state with the given name, ID, and optional 246 // state properties that are used to uniquely qualify the lookup (nil if not required). 247 func GetConfigurationSetEventDestination(ctx *pulumi.Context, 248 name string, id pulumi.IDInput, state *ConfigurationSetEventDestinationState, opts ...pulumi.ResourceOption) (*ConfigurationSetEventDestination, error) { 249 var resource ConfigurationSetEventDestination 250 err := ctx.ReadResource("aws:sesv2/configurationSetEventDestination:ConfigurationSetEventDestination", name, id, state, &resource, opts...) 251 if err != nil { 252 return nil, err 253 } 254 return &resource, nil 255 } 256 257 // Input properties used for looking up and filtering ConfigurationSetEventDestination resources. 258 type configurationSetEventDestinationState struct { 259 // The name of the configuration set. 260 ConfigurationSetName *string `pulumi:"configurationSetName"` 261 // A name that identifies the event destination within the configuration set. 262 EventDestination *ConfigurationSetEventDestinationEventDestination `pulumi:"eventDestination"` 263 // An object that defines the event destination. See eventDestination below. 264 EventDestinationName *string `pulumi:"eventDestinationName"` 265 } 266 267 type ConfigurationSetEventDestinationState struct { 268 // The name of the configuration set. 269 ConfigurationSetName pulumi.StringPtrInput 270 // A name that identifies the event destination within the configuration set. 271 EventDestination ConfigurationSetEventDestinationEventDestinationPtrInput 272 // An object that defines the event destination. See eventDestination below. 273 EventDestinationName pulumi.StringPtrInput 274 } 275 276 func (ConfigurationSetEventDestinationState) ElementType() reflect.Type { 277 return reflect.TypeOf((*configurationSetEventDestinationState)(nil)).Elem() 278 } 279 280 type configurationSetEventDestinationArgs struct { 281 // The name of the configuration set. 282 ConfigurationSetName string `pulumi:"configurationSetName"` 283 // A name that identifies the event destination within the configuration set. 284 EventDestination ConfigurationSetEventDestinationEventDestination `pulumi:"eventDestination"` 285 // An object that defines the event destination. See eventDestination below. 286 EventDestinationName string `pulumi:"eventDestinationName"` 287 } 288 289 // The set of arguments for constructing a ConfigurationSetEventDestination resource. 290 type ConfigurationSetEventDestinationArgs struct { 291 // The name of the configuration set. 292 ConfigurationSetName pulumi.StringInput 293 // A name that identifies the event destination within the configuration set. 294 EventDestination ConfigurationSetEventDestinationEventDestinationInput 295 // An object that defines the event destination. See eventDestination below. 296 EventDestinationName pulumi.StringInput 297 } 298 299 func (ConfigurationSetEventDestinationArgs) ElementType() reflect.Type { 300 return reflect.TypeOf((*configurationSetEventDestinationArgs)(nil)).Elem() 301 } 302 303 type ConfigurationSetEventDestinationInput interface { 304 pulumi.Input 305 306 ToConfigurationSetEventDestinationOutput() ConfigurationSetEventDestinationOutput 307 ToConfigurationSetEventDestinationOutputWithContext(ctx context.Context) ConfigurationSetEventDestinationOutput 308 } 309 310 func (*ConfigurationSetEventDestination) ElementType() reflect.Type { 311 return reflect.TypeOf((**ConfigurationSetEventDestination)(nil)).Elem() 312 } 313 314 func (i *ConfigurationSetEventDestination) ToConfigurationSetEventDestinationOutput() ConfigurationSetEventDestinationOutput { 315 return i.ToConfigurationSetEventDestinationOutputWithContext(context.Background()) 316 } 317 318 func (i *ConfigurationSetEventDestination) ToConfigurationSetEventDestinationOutputWithContext(ctx context.Context) ConfigurationSetEventDestinationOutput { 319 return pulumi.ToOutputWithContext(ctx, i).(ConfigurationSetEventDestinationOutput) 320 } 321 322 // ConfigurationSetEventDestinationArrayInput is an input type that accepts ConfigurationSetEventDestinationArray and ConfigurationSetEventDestinationArrayOutput values. 323 // You can construct a concrete instance of `ConfigurationSetEventDestinationArrayInput` via: 324 // 325 // ConfigurationSetEventDestinationArray{ ConfigurationSetEventDestinationArgs{...} } 326 type ConfigurationSetEventDestinationArrayInput interface { 327 pulumi.Input 328 329 ToConfigurationSetEventDestinationArrayOutput() ConfigurationSetEventDestinationArrayOutput 330 ToConfigurationSetEventDestinationArrayOutputWithContext(context.Context) ConfigurationSetEventDestinationArrayOutput 331 } 332 333 type ConfigurationSetEventDestinationArray []ConfigurationSetEventDestinationInput 334 335 func (ConfigurationSetEventDestinationArray) ElementType() reflect.Type { 336 return reflect.TypeOf((*[]*ConfigurationSetEventDestination)(nil)).Elem() 337 } 338 339 func (i ConfigurationSetEventDestinationArray) ToConfigurationSetEventDestinationArrayOutput() ConfigurationSetEventDestinationArrayOutput { 340 return i.ToConfigurationSetEventDestinationArrayOutputWithContext(context.Background()) 341 } 342 343 func (i ConfigurationSetEventDestinationArray) ToConfigurationSetEventDestinationArrayOutputWithContext(ctx context.Context) ConfigurationSetEventDestinationArrayOutput { 344 return pulumi.ToOutputWithContext(ctx, i).(ConfigurationSetEventDestinationArrayOutput) 345 } 346 347 // ConfigurationSetEventDestinationMapInput is an input type that accepts ConfigurationSetEventDestinationMap and ConfigurationSetEventDestinationMapOutput values. 348 // You can construct a concrete instance of `ConfigurationSetEventDestinationMapInput` via: 349 // 350 // ConfigurationSetEventDestinationMap{ "key": ConfigurationSetEventDestinationArgs{...} } 351 type ConfigurationSetEventDestinationMapInput interface { 352 pulumi.Input 353 354 ToConfigurationSetEventDestinationMapOutput() ConfigurationSetEventDestinationMapOutput 355 ToConfigurationSetEventDestinationMapOutputWithContext(context.Context) ConfigurationSetEventDestinationMapOutput 356 } 357 358 type ConfigurationSetEventDestinationMap map[string]ConfigurationSetEventDestinationInput 359 360 func (ConfigurationSetEventDestinationMap) ElementType() reflect.Type { 361 return reflect.TypeOf((*map[string]*ConfigurationSetEventDestination)(nil)).Elem() 362 } 363 364 func (i ConfigurationSetEventDestinationMap) ToConfigurationSetEventDestinationMapOutput() ConfigurationSetEventDestinationMapOutput { 365 return i.ToConfigurationSetEventDestinationMapOutputWithContext(context.Background()) 366 } 367 368 func (i ConfigurationSetEventDestinationMap) ToConfigurationSetEventDestinationMapOutputWithContext(ctx context.Context) ConfigurationSetEventDestinationMapOutput { 369 return pulumi.ToOutputWithContext(ctx, i).(ConfigurationSetEventDestinationMapOutput) 370 } 371 372 type ConfigurationSetEventDestinationOutput struct{ *pulumi.OutputState } 373 374 func (ConfigurationSetEventDestinationOutput) ElementType() reflect.Type { 375 return reflect.TypeOf((**ConfigurationSetEventDestination)(nil)).Elem() 376 } 377 378 func (o ConfigurationSetEventDestinationOutput) ToConfigurationSetEventDestinationOutput() ConfigurationSetEventDestinationOutput { 379 return o 380 } 381 382 func (o ConfigurationSetEventDestinationOutput) ToConfigurationSetEventDestinationOutputWithContext(ctx context.Context) ConfigurationSetEventDestinationOutput { 383 return o 384 } 385 386 // The name of the configuration set. 387 func (o ConfigurationSetEventDestinationOutput) ConfigurationSetName() pulumi.StringOutput { 388 return o.ApplyT(func(v *ConfigurationSetEventDestination) pulumi.StringOutput { return v.ConfigurationSetName }).(pulumi.StringOutput) 389 } 390 391 // A name that identifies the event destination within the configuration set. 392 func (o ConfigurationSetEventDestinationOutput) EventDestination() ConfigurationSetEventDestinationEventDestinationOutput { 393 return o.ApplyT(func(v *ConfigurationSetEventDestination) ConfigurationSetEventDestinationEventDestinationOutput { 394 return v.EventDestination 395 }).(ConfigurationSetEventDestinationEventDestinationOutput) 396 } 397 398 // An object that defines the event destination. See eventDestination below. 399 func (o ConfigurationSetEventDestinationOutput) EventDestinationName() pulumi.StringOutput { 400 return o.ApplyT(func(v *ConfigurationSetEventDestination) pulumi.StringOutput { return v.EventDestinationName }).(pulumi.StringOutput) 401 } 402 403 type ConfigurationSetEventDestinationArrayOutput struct{ *pulumi.OutputState } 404 405 func (ConfigurationSetEventDestinationArrayOutput) ElementType() reflect.Type { 406 return reflect.TypeOf((*[]*ConfigurationSetEventDestination)(nil)).Elem() 407 } 408 409 func (o ConfigurationSetEventDestinationArrayOutput) ToConfigurationSetEventDestinationArrayOutput() ConfigurationSetEventDestinationArrayOutput { 410 return o 411 } 412 413 func (o ConfigurationSetEventDestinationArrayOutput) ToConfigurationSetEventDestinationArrayOutputWithContext(ctx context.Context) ConfigurationSetEventDestinationArrayOutput { 414 return o 415 } 416 417 func (o ConfigurationSetEventDestinationArrayOutput) Index(i pulumi.IntInput) ConfigurationSetEventDestinationOutput { 418 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ConfigurationSetEventDestination { 419 return vs[0].([]*ConfigurationSetEventDestination)[vs[1].(int)] 420 }).(ConfigurationSetEventDestinationOutput) 421 } 422 423 type ConfigurationSetEventDestinationMapOutput struct{ *pulumi.OutputState } 424 425 func (ConfigurationSetEventDestinationMapOutput) ElementType() reflect.Type { 426 return reflect.TypeOf((*map[string]*ConfigurationSetEventDestination)(nil)).Elem() 427 } 428 429 func (o ConfigurationSetEventDestinationMapOutput) ToConfigurationSetEventDestinationMapOutput() ConfigurationSetEventDestinationMapOutput { 430 return o 431 } 432 433 func (o ConfigurationSetEventDestinationMapOutput) ToConfigurationSetEventDestinationMapOutputWithContext(ctx context.Context) ConfigurationSetEventDestinationMapOutput { 434 return o 435 } 436 437 func (o ConfigurationSetEventDestinationMapOutput) MapIndex(k pulumi.StringInput) ConfigurationSetEventDestinationOutput { 438 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ConfigurationSetEventDestination { 439 return vs[0].(map[string]*ConfigurationSetEventDestination)[vs[1].(string)] 440 }).(ConfigurationSetEventDestinationOutput) 441 } 442 443 func init() { 444 pulumi.RegisterInputType(reflect.TypeOf((*ConfigurationSetEventDestinationInput)(nil)).Elem(), &ConfigurationSetEventDestination{}) 445 pulumi.RegisterInputType(reflect.TypeOf((*ConfigurationSetEventDestinationArrayInput)(nil)).Elem(), ConfigurationSetEventDestinationArray{}) 446 pulumi.RegisterInputType(reflect.TypeOf((*ConfigurationSetEventDestinationMapInput)(nil)).Elem(), ConfigurationSetEventDestinationMap{}) 447 pulumi.RegisterOutputType(ConfigurationSetEventDestinationOutput{}) 448 pulumi.RegisterOutputType(ConfigurationSetEventDestinationArrayOutput{}) 449 pulumi.RegisterOutputType(ConfigurationSetEventDestinationMapOutput{}) 450 }