github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appconfig/eventIntegration.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 appconfig
     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 an Amazon AppIntegrations Event Integration resource.
    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/appconfig"
    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 := appconfig.NewEventIntegration(ctx, "example", &appconfig.EventIntegrationArgs{
    33  //				Name:           pulumi.String("example-name"),
    34  //				Description:    pulumi.String("Example Description"),
    35  //				EventbridgeBus: pulumi.String("default"),
    36  //				EventFilter: &appconfig.EventIntegrationEventFilterArgs{
    37  //					Source: pulumi.String("aws.partner/examplepartner.com"),
    38  //				},
    39  //				Tags: pulumi.StringMap{
    40  //					"Name": pulumi.String("Example Event Integration"),
    41  //				},
    42  //			})
    43  //			if err != nil {
    44  //				return err
    45  //			}
    46  //			return nil
    47  //		})
    48  //	}
    49  //
    50  // ```
    51  // <!--End PulumiCodeChooser -->
    52  //
    53  // ## Import
    54  //
    55  // Using `pulumi import`, import Amazon AppIntegrations Event Integrations using the `name`. For example:
    56  //
    57  // ```sh
    58  // $ pulumi import aws:appconfig/eventIntegration:EventIntegration example example-name
    59  // ```
    60  type EventIntegration struct {
    61  	pulumi.CustomResourceState
    62  
    63  	// ARN of the Event Integration.
    64  	Arn pulumi.StringOutput `pulumi:"arn"`
    65  	// Description of the Event Integration.
    66  	Description pulumi.StringPtrOutput `pulumi:"description"`
    67  	// Block that defines the configuration information for the event filter. The Event Filter block is documented below.
    68  	EventFilter EventIntegrationEventFilterOutput `pulumi:"eventFilter"`
    69  	// EventBridge bus.
    70  	EventbridgeBus pulumi.StringOutput `pulumi:"eventbridgeBus"`
    71  	// Name of the Event Integration.
    72  	Name pulumi.StringOutput `pulumi:"name"`
    73  	// Tags to apply to the Event Integration. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    74  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    75  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    76  	//
    77  	// Deprecated: Please use `tags` instead.
    78  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    79  }
    80  
    81  // NewEventIntegration registers a new resource with the given unique name, arguments, and options.
    82  func NewEventIntegration(ctx *pulumi.Context,
    83  	name string, args *EventIntegrationArgs, opts ...pulumi.ResourceOption) (*EventIntegration, error) {
    84  	if args == nil {
    85  		return nil, errors.New("missing one or more required arguments")
    86  	}
    87  
    88  	if args.EventFilter == nil {
    89  		return nil, errors.New("invalid value for required argument 'EventFilter'")
    90  	}
    91  	if args.EventbridgeBus == nil {
    92  		return nil, errors.New("invalid value for required argument 'EventbridgeBus'")
    93  	}
    94  	opts = internal.PkgResourceDefaultOpts(opts)
    95  	var resource EventIntegration
    96  	err := ctx.RegisterResource("aws:appconfig/eventIntegration:EventIntegration", name, args, &resource, opts...)
    97  	if err != nil {
    98  		return nil, err
    99  	}
   100  	return &resource, nil
   101  }
   102  
   103  // GetEventIntegration gets an existing EventIntegration resource's state with the given name, ID, and optional
   104  // state properties that are used to uniquely qualify the lookup (nil if not required).
   105  func GetEventIntegration(ctx *pulumi.Context,
   106  	name string, id pulumi.IDInput, state *EventIntegrationState, opts ...pulumi.ResourceOption) (*EventIntegration, error) {
   107  	var resource EventIntegration
   108  	err := ctx.ReadResource("aws:appconfig/eventIntegration:EventIntegration", name, id, state, &resource, opts...)
   109  	if err != nil {
   110  		return nil, err
   111  	}
   112  	return &resource, nil
   113  }
   114  
   115  // Input properties used for looking up and filtering EventIntegration resources.
   116  type eventIntegrationState struct {
   117  	// ARN of the Event Integration.
   118  	Arn *string `pulumi:"arn"`
   119  	// Description of the Event Integration.
   120  	Description *string `pulumi:"description"`
   121  	// Block that defines the configuration information for the event filter. The Event Filter block is documented below.
   122  	EventFilter *EventIntegrationEventFilter `pulumi:"eventFilter"`
   123  	// EventBridge bus.
   124  	EventbridgeBus *string `pulumi:"eventbridgeBus"`
   125  	// Name of the Event Integration.
   126  	Name *string `pulumi:"name"`
   127  	// Tags to apply to the Event Integration. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   128  	Tags map[string]string `pulumi:"tags"`
   129  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   130  	//
   131  	// Deprecated: Please use `tags` instead.
   132  	TagsAll map[string]string `pulumi:"tagsAll"`
   133  }
   134  
   135  type EventIntegrationState struct {
   136  	// ARN of the Event Integration.
   137  	Arn pulumi.StringPtrInput
   138  	// Description of the Event Integration.
   139  	Description pulumi.StringPtrInput
   140  	// Block that defines the configuration information for the event filter. The Event Filter block is documented below.
   141  	EventFilter EventIntegrationEventFilterPtrInput
   142  	// EventBridge bus.
   143  	EventbridgeBus pulumi.StringPtrInput
   144  	// Name of the Event Integration.
   145  	Name pulumi.StringPtrInput
   146  	// Tags to apply to the Event Integration. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   147  	Tags pulumi.StringMapInput
   148  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   149  	//
   150  	// Deprecated: Please use `tags` instead.
   151  	TagsAll pulumi.StringMapInput
   152  }
   153  
   154  func (EventIntegrationState) ElementType() reflect.Type {
   155  	return reflect.TypeOf((*eventIntegrationState)(nil)).Elem()
   156  }
   157  
   158  type eventIntegrationArgs struct {
   159  	// Description of the Event Integration.
   160  	Description *string `pulumi:"description"`
   161  	// Block that defines the configuration information for the event filter. The Event Filter block is documented below.
   162  	EventFilter EventIntegrationEventFilter `pulumi:"eventFilter"`
   163  	// EventBridge bus.
   164  	EventbridgeBus string `pulumi:"eventbridgeBus"`
   165  	// Name of the Event Integration.
   166  	Name *string `pulumi:"name"`
   167  	// Tags to apply to the Event Integration. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   168  	Tags map[string]string `pulumi:"tags"`
   169  }
   170  
   171  // The set of arguments for constructing a EventIntegration resource.
   172  type EventIntegrationArgs struct {
   173  	// Description of the Event Integration.
   174  	Description pulumi.StringPtrInput
   175  	// Block that defines the configuration information for the event filter. The Event Filter block is documented below.
   176  	EventFilter EventIntegrationEventFilterInput
   177  	// EventBridge bus.
   178  	EventbridgeBus pulumi.StringInput
   179  	// Name of the Event Integration.
   180  	Name pulumi.StringPtrInput
   181  	// Tags to apply to the Event Integration. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   182  	Tags pulumi.StringMapInput
   183  }
   184  
   185  func (EventIntegrationArgs) ElementType() reflect.Type {
   186  	return reflect.TypeOf((*eventIntegrationArgs)(nil)).Elem()
   187  }
   188  
   189  type EventIntegrationInput interface {
   190  	pulumi.Input
   191  
   192  	ToEventIntegrationOutput() EventIntegrationOutput
   193  	ToEventIntegrationOutputWithContext(ctx context.Context) EventIntegrationOutput
   194  }
   195  
   196  func (*EventIntegration) ElementType() reflect.Type {
   197  	return reflect.TypeOf((**EventIntegration)(nil)).Elem()
   198  }
   199  
   200  func (i *EventIntegration) ToEventIntegrationOutput() EventIntegrationOutput {
   201  	return i.ToEventIntegrationOutputWithContext(context.Background())
   202  }
   203  
   204  func (i *EventIntegration) ToEventIntegrationOutputWithContext(ctx context.Context) EventIntegrationOutput {
   205  	return pulumi.ToOutputWithContext(ctx, i).(EventIntegrationOutput)
   206  }
   207  
   208  // EventIntegrationArrayInput is an input type that accepts EventIntegrationArray and EventIntegrationArrayOutput values.
   209  // You can construct a concrete instance of `EventIntegrationArrayInput` via:
   210  //
   211  //	EventIntegrationArray{ EventIntegrationArgs{...} }
   212  type EventIntegrationArrayInput interface {
   213  	pulumi.Input
   214  
   215  	ToEventIntegrationArrayOutput() EventIntegrationArrayOutput
   216  	ToEventIntegrationArrayOutputWithContext(context.Context) EventIntegrationArrayOutput
   217  }
   218  
   219  type EventIntegrationArray []EventIntegrationInput
   220  
   221  func (EventIntegrationArray) ElementType() reflect.Type {
   222  	return reflect.TypeOf((*[]*EventIntegration)(nil)).Elem()
   223  }
   224  
   225  func (i EventIntegrationArray) ToEventIntegrationArrayOutput() EventIntegrationArrayOutput {
   226  	return i.ToEventIntegrationArrayOutputWithContext(context.Background())
   227  }
   228  
   229  func (i EventIntegrationArray) ToEventIntegrationArrayOutputWithContext(ctx context.Context) EventIntegrationArrayOutput {
   230  	return pulumi.ToOutputWithContext(ctx, i).(EventIntegrationArrayOutput)
   231  }
   232  
   233  // EventIntegrationMapInput is an input type that accepts EventIntegrationMap and EventIntegrationMapOutput values.
   234  // You can construct a concrete instance of `EventIntegrationMapInput` via:
   235  //
   236  //	EventIntegrationMap{ "key": EventIntegrationArgs{...} }
   237  type EventIntegrationMapInput interface {
   238  	pulumi.Input
   239  
   240  	ToEventIntegrationMapOutput() EventIntegrationMapOutput
   241  	ToEventIntegrationMapOutputWithContext(context.Context) EventIntegrationMapOutput
   242  }
   243  
   244  type EventIntegrationMap map[string]EventIntegrationInput
   245  
   246  func (EventIntegrationMap) ElementType() reflect.Type {
   247  	return reflect.TypeOf((*map[string]*EventIntegration)(nil)).Elem()
   248  }
   249  
   250  func (i EventIntegrationMap) ToEventIntegrationMapOutput() EventIntegrationMapOutput {
   251  	return i.ToEventIntegrationMapOutputWithContext(context.Background())
   252  }
   253  
   254  func (i EventIntegrationMap) ToEventIntegrationMapOutputWithContext(ctx context.Context) EventIntegrationMapOutput {
   255  	return pulumi.ToOutputWithContext(ctx, i).(EventIntegrationMapOutput)
   256  }
   257  
   258  type EventIntegrationOutput struct{ *pulumi.OutputState }
   259  
   260  func (EventIntegrationOutput) ElementType() reflect.Type {
   261  	return reflect.TypeOf((**EventIntegration)(nil)).Elem()
   262  }
   263  
   264  func (o EventIntegrationOutput) ToEventIntegrationOutput() EventIntegrationOutput {
   265  	return o
   266  }
   267  
   268  func (o EventIntegrationOutput) ToEventIntegrationOutputWithContext(ctx context.Context) EventIntegrationOutput {
   269  	return o
   270  }
   271  
   272  // ARN of the Event Integration.
   273  func (o EventIntegrationOutput) Arn() pulumi.StringOutput {
   274  	return o.ApplyT(func(v *EventIntegration) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   275  }
   276  
   277  // Description of the Event Integration.
   278  func (o EventIntegrationOutput) Description() pulumi.StringPtrOutput {
   279  	return o.ApplyT(func(v *EventIntegration) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   280  }
   281  
   282  // Block that defines the configuration information for the event filter. The Event Filter block is documented below.
   283  func (o EventIntegrationOutput) EventFilter() EventIntegrationEventFilterOutput {
   284  	return o.ApplyT(func(v *EventIntegration) EventIntegrationEventFilterOutput { return v.EventFilter }).(EventIntegrationEventFilterOutput)
   285  }
   286  
   287  // EventBridge bus.
   288  func (o EventIntegrationOutput) EventbridgeBus() pulumi.StringOutput {
   289  	return o.ApplyT(func(v *EventIntegration) pulumi.StringOutput { return v.EventbridgeBus }).(pulumi.StringOutput)
   290  }
   291  
   292  // Name of the Event Integration.
   293  func (o EventIntegrationOutput) Name() pulumi.StringOutput {
   294  	return o.ApplyT(func(v *EventIntegration) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   295  }
   296  
   297  // Tags to apply to the Event Integration. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   298  func (o EventIntegrationOutput) Tags() pulumi.StringMapOutput {
   299  	return o.ApplyT(func(v *EventIntegration) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   300  }
   301  
   302  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   303  //
   304  // Deprecated: Please use `tags` instead.
   305  func (o EventIntegrationOutput) TagsAll() pulumi.StringMapOutput {
   306  	return o.ApplyT(func(v *EventIntegration) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   307  }
   308  
   309  type EventIntegrationArrayOutput struct{ *pulumi.OutputState }
   310  
   311  func (EventIntegrationArrayOutput) ElementType() reflect.Type {
   312  	return reflect.TypeOf((*[]*EventIntegration)(nil)).Elem()
   313  }
   314  
   315  func (o EventIntegrationArrayOutput) ToEventIntegrationArrayOutput() EventIntegrationArrayOutput {
   316  	return o
   317  }
   318  
   319  func (o EventIntegrationArrayOutput) ToEventIntegrationArrayOutputWithContext(ctx context.Context) EventIntegrationArrayOutput {
   320  	return o
   321  }
   322  
   323  func (o EventIntegrationArrayOutput) Index(i pulumi.IntInput) EventIntegrationOutput {
   324  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EventIntegration {
   325  		return vs[0].([]*EventIntegration)[vs[1].(int)]
   326  	}).(EventIntegrationOutput)
   327  }
   328  
   329  type EventIntegrationMapOutput struct{ *pulumi.OutputState }
   330  
   331  func (EventIntegrationMapOutput) ElementType() reflect.Type {
   332  	return reflect.TypeOf((*map[string]*EventIntegration)(nil)).Elem()
   333  }
   334  
   335  func (o EventIntegrationMapOutput) ToEventIntegrationMapOutput() EventIntegrationMapOutput {
   336  	return o
   337  }
   338  
   339  func (o EventIntegrationMapOutput) ToEventIntegrationMapOutputWithContext(ctx context.Context) EventIntegrationMapOutput {
   340  	return o
   341  }
   342  
   343  func (o EventIntegrationMapOutput) MapIndex(k pulumi.StringInput) EventIntegrationOutput {
   344  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EventIntegration {
   345  		return vs[0].(map[string]*EventIntegration)[vs[1].(string)]
   346  	}).(EventIntegrationOutput)
   347  }
   348  
   349  func init() {
   350  	pulumi.RegisterInputType(reflect.TypeOf((*EventIntegrationInput)(nil)).Elem(), &EventIntegration{})
   351  	pulumi.RegisterInputType(reflect.TypeOf((*EventIntegrationArrayInput)(nil)).Elem(), EventIntegrationArray{})
   352  	pulumi.RegisterInputType(reflect.TypeOf((*EventIntegrationMapInput)(nil)).Elem(), EventIntegrationMap{})
   353  	pulumi.RegisterOutputType(EventIntegrationOutput{})
   354  	pulumi.RegisterOutputType(EventIntegrationArrayOutput{})
   355  	pulumi.RegisterOutputType(EventIntegrationMapOutput{})
   356  }