github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/cloudwatch/eventRule.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 cloudwatch
     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  // Provides an EventBridge Rule resource.
    15  //
    16  // > **Note:** EventBridge was formerly known as CloudWatch Events. The functionality is identical.
    17  //
    18  // ## Example Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"encoding/json"
    27  //
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
    29  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    30  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns"
    31  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    32  //
    33  // )
    34  // func main() {
    35  // pulumi.Run(func(ctx *pulumi.Context) error {
    36  // tmpJSON0, err := json.Marshal(map[string]interface{}{
    37  // "detail-type": []string{
    38  // "AWS Console Sign In via CloudTrail",
    39  // },
    40  // })
    41  // if err != nil {
    42  // return err
    43  // }
    44  // json0 := string(tmpJSON0)
    45  // console, err := cloudwatch.NewEventRule(ctx, "console", &cloudwatch.EventRuleArgs{
    46  // Name: pulumi.String("capture-aws-sign-in"),
    47  // Description: pulumi.String("Capture each AWS Console Sign In"),
    48  // EventPattern: pulumi.String(json0),
    49  // })
    50  // if err != nil {
    51  // return err
    52  // }
    53  // awsLogins, err := sns.NewTopic(ctx, "aws_logins", &sns.TopicArgs{
    54  // Name: pulumi.String("aws-console-logins"),
    55  // })
    56  // if err != nil {
    57  // return err
    58  // }
    59  // _, err = cloudwatch.NewEventTarget(ctx, "sns", &cloudwatch.EventTargetArgs{
    60  // Rule: console.Name,
    61  // TargetId: pulumi.String("SendToSNS"),
    62  // Arn: awsLogins.Arn,
    63  // })
    64  // if err != nil {
    65  // return err
    66  // }
    67  // snsTopicPolicy := awsLogins.Arn.ApplyT(func(arn string) (iam.GetPolicyDocumentResult, error) {
    68  // return iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{
    69  // Statements: []iam.GetPolicyDocumentStatement{
    70  // {
    71  // Effect: "Allow",
    72  // Actions: []string{
    73  // "SNS:Publish",
    74  // },
    75  // Principals: []iam.GetPolicyDocumentStatementPrincipal{
    76  // {
    77  // Type: "Service",
    78  // Identifiers: []string{
    79  // "events.amazonaws.com",
    80  // },
    81  // },
    82  // },
    83  // Resources: interface{}{
    84  // arn,
    85  // },
    86  // },
    87  // },
    88  // }, nil), nil
    89  // }).(iam.GetPolicyDocumentResultOutput)
    90  // _, err = sns.NewTopicPolicy(ctx, "default", &sns.TopicPolicyArgs{
    91  // Arn: awsLogins.Arn,
    92  // Policy: snsTopicPolicy.ApplyT(func(snsTopicPolicy iam.GetPolicyDocumentResult) (*string, error) {
    93  // return &snsTopicPolicy.Json, nil
    94  // }).(pulumi.StringPtrOutput),
    95  // })
    96  // if err != nil {
    97  // return err
    98  // }
    99  // return nil
   100  // })
   101  // }
   102  // ```
   103  // <!--End PulumiCodeChooser -->
   104  //
   105  // ## Import
   106  //
   107  // Using `pulumi import`, import EventBridge Rules using the `event_bus_name/rule_name` (if you omit `event_bus_name`, the `default` event bus will be used). For example:
   108  //
   109  // ```sh
   110  // $ pulumi import aws:cloudwatch/eventRule:EventRule console example-event-bus/capture-console-sign-in
   111  // ```
   112  type EventRule struct {
   113  	pulumi.CustomResourceState
   114  
   115  	// The Amazon Resource Name (ARN) of the rule.
   116  	Arn pulumi.StringOutput `pulumi:"arn"`
   117  	// The description of the rule.
   118  	Description pulumi.StringPtrOutput `pulumi:"description"`
   119  	// The name or ARN of the event bus to associate with this rule.
   120  	// If you omit this, the `default` event bus is used.
   121  	EventBusName pulumi.StringPtrOutput `pulumi:"eventBusName"`
   122  	// The event pattern described a JSON object. At least one of `scheduleExpression` or `eventPattern` is required. See full documentation of [Events and Event Patterns in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) for details. **Note**: The event pattern size is 2048 by default but it is adjustable up to 4096 characters by submitting a service quota increase request. See [Amazon EventBridge quotas](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-quota.html) for details.
   123  	EventPattern pulumi.StringPtrOutput `pulumi:"eventPattern"`
   124  	// Used to delete managed rules created by AWS. Defaults to `false`.
   125  	ForceDestroy pulumi.BoolPtrOutput `pulumi:"forceDestroy"`
   126  	// Whether the rule should be enabled.
   127  	// Defaults to `true`.
   128  	// Conflicts with `state`.
   129  	//
   130  	// Deprecated: Use "state" instead
   131  	IsEnabled pulumi.BoolPtrOutput `pulumi:"isEnabled"`
   132  	// The name of the rule. If omitted, this provider will assign a random, unique name. Conflicts with `namePrefix`.
   133  	Name pulumi.StringOutput `pulumi:"name"`
   134  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`. **Note**: Due to the length of the generated suffix, must be 38 characters or less.
   135  	NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
   136  	// The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
   137  	RoleArn pulumi.StringPtrOutput `pulumi:"roleArn"`
   138  	// The scheduling expression. For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`. At least one of `scheduleExpression` or `eventPattern` is required. Can only be used on the default event bus. For more information, refer to the AWS documentation [Schedule Expressions for Rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html).
   139  	ScheduleExpression pulumi.StringPtrOutput `pulumi:"scheduleExpression"`
   140  	// State of the rule.
   141  	// Valid values are `DISABLED`, `ENABLED`, and `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   142  	// When state is `ENABLED`, the rule is enabled for all events except those delivered by CloudTrail.
   143  	// To also enable the rule for events delivered by CloudTrail, set `state` to `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   144  	// Defaults to `ENABLED`.
   145  	// Conflicts with `isEnabled`.
   146  	//
   147  	// **NOTE:** The rule state  `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS` cannot be used in conjunction with the `scheduleExpression` argument.
   148  	State pulumi.StringPtrOutput `pulumi:"state"`
   149  	// A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   150  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   151  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   152  	//
   153  	// Deprecated: Please use `tags` instead.
   154  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   155  }
   156  
   157  // NewEventRule registers a new resource with the given unique name, arguments, and options.
   158  func NewEventRule(ctx *pulumi.Context,
   159  	name string, args *EventRuleArgs, opts ...pulumi.ResourceOption) (*EventRule, error) {
   160  	if args == nil {
   161  		args = &EventRuleArgs{}
   162  	}
   163  
   164  	opts = internal.PkgResourceDefaultOpts(opts)
   165  	var resource EventRule
   166  	err := ctx.RegisterResource("aws:cloudwatch/eventRule:EventRule", name, args, &resource, opts...)
   167  	if err != nil {
   168  		return nil, err
   169  	}
   170  	return &resource, nil
   171  }
   172  
   173  // GetEventRule gets an existing EventRule resource's state with the given name, ID, and optional
   174  // state properties that are used to uniquely qualify the lookup (nil if not required).
   175  func GetEventRule(ctx *pulumi.Context,
   176  	name string, id pulumi.IDInput, state *EventRuleState, opts ...pulumi.ResourceOption) (*EventRule, error) {
   177  	var resource EventRule
   178  	err := ctx.ReadResource("aws:cloudwatch/eventRule:EventRule", name, id, state, &resource, opts...)
   179  	if err != nil {
   180  		return nil, err
   181  	}
   182  	return &resource, nil
   183  }
   184  
   185  // Input properties used for looking up and filtering EventRule resources.
   186  type eventRuleState struct {
   187  	// The Amazon Resource Name (ARN) of the rule.
   188  	Arn *string `pulumi:"arn"`
   189  	// The description of the rule.
   190  	Description *string `pulumi:"description"`
   191  	// The name or ARN of the event bus to associate with this rule.
   192  	// If you omit this, the `default` event bus is used.
   193  	EventBusName *string `pulumi:"eventBusName"`
   194  	// The event pattern described a JSON object. At least one of `scheduleExpression` or `eventPattern` is required. See full documentation of [Events and Event Patterns in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) for details. **Note**: The event pattern size is 2048 by default but it is adjustable up to 4096 characters by submitting a service quota increase request. See [Amazon EventBridge quotas](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-quota.html) for details.
   195  	EventPattern *string `pulumi:"eventPattern"`
   196  	// Used to delete managed rules created by AWS. Defaults to `false`.
   197  	ForceDestroy *bool `pulumi:"forceDestroy"`
   198  	// Whether the rule should be enabled.
   199  	// Defaults to `true`.
   200  	// Conflicts with `state`.
   201  	//
   202  	// Deprecated: Use "state" instead
   203  	IsEnabled *bool `pulumi:"isEnabled"`
   204  	// The name of the rule. If omitted, this provider will assign a random, unique name. Conflicts with `namePrefix`.
   205  	Name *string `pulumi:"name"`
   206  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`. **Note**: Due to the length of the generated suffix, must be 38 characters or less.
   207  	NamePrefix *string `pulumi:"namePrefix"`
   208  	// The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
   209  	RoleArn *string `pulumi:"roleArn"`
   210  	// The scheduling expression. For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`. At least one of `scheduleExpression` or `eventPattern` is required. Can only be used on the default event bus. For more information, refer to the AWS documentation [Schedule Expressions for Rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html).
   211  	ScheduleExpression *string `pulumi:"scheduleExpression"`
   212  	// State of the rule.
   213  	// Valid values are `DISABLED`, `ENABLED`, and `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   214  	// When state is `ENABLED`, the rule is enabled for all events except those delivered by CloudTrail.
   215  	// To also enable the rule for events delivered by CloudTrail, set `state` to `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   216  	// Defaults to `ENABLED`.
   217  	// Conflicts with `isEnabled`.
   218  	//
   219  	// **NOTE:** The rule state  `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS` cannot be used in conjunction with the `scheduleExpression` argument.
   220  	State *string `pulumi:"state"`
   221  	// A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   222  	Tags map[string]string `pulumi:"tags"`
   223  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   224  	//
   225  	// Deprecated: Please use `tags` instead.
   226  	TagsAll map[string]string `pulumi:"tagsAll"`
   227  }
   228  
   229  type EventRuleState struct {
   230  	// The Amazon Resource Name (ARN) of the rule.
   231  	Arn pulumi.StringPtrInput
   232  	// The description of the rule.
   233  	Description pulumi.StringPtrInput
   234  	// The name or ARN of the event bus to associate with this rule.
   235  	// If you omit this, the `default` event bus is used.
   236  	EventBusName pulumi.StringPtrInput
   237  	// The event pattern described a JSON object. At least one of `scheduleExpression` or `eventPattern` is required. See full documentation of [Events and Event Patterns in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) for details. **Note**: The event pattern size is 2048 by default but it is adjustable up to 4096 characters by submitting a service quota increase request. See [Amazon EventBridge quotas](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-quota.html) for details.
   238  	EventPattern pulumi.StringPtrInput
   239  	// Used to delete managed rules created by AWS. Defaults to `false`.
   240  	ForceDestroy pulumi.BoolPtrInput
   241  	// Whether the rule should be enabled.
   242  	// Defaults to `true`.
   243  	// Conflicts with `state`.
   244  	//
   245  	// Deprecated: Use "state" instead
   246  	IsEnabled pulumi.BoolPtrInput
   247  	// The name of the rule. If omitted, this provider will assign a random, unique name. Conflicts with `namePrefix`.
   248  	Name pulumi.StringPtrInput
   249  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`. **Note**: Due to the length of the generated suffix, must be 38 characters or less.
   250  	NamePrefix pulumi.StringPtrInput
   251  	// The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
   252  	RoleArn pulumi.StringPtrInput
   253  	// The scheduling expression. For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`. At least one of `scheduleExpression` or `eventPattern` is required. Can only be used on the default event bus. For more information, refer to the AWS documentation [Schedule Expressions for Rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html).
   254  	ScheduleExpression pulumi.StringPtrInput
   255  	// State of the rule.
   256  	// Valid values are `DISABLED`, `ENABLED`, and `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   257  	// When state is `ENABLED`, the rule is enabled for all events except those delivered by CloudTrail.
   258  	// To also enable the rule for events delivered by CloudTrail, set `state` to `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   259  	// Defaults to `ENABLED`.
   260  	// Conflicts with `isEnabled`.
   261  	//
   262  	// **NOTE:** The rule state  `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS` cannot be used in conjunction with the `scheduleExpression` argument.
   263  	State pulumi.StringPtrInput
   264  	// A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   265  	Tags pulumi.StringMapInput
   266  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   267  	//
   268  	// Deprecated: Please use `tags` instead.
   269  	TagsAll pulumi.StringMapInput
   270  }
   271  
   272  func (EventRuleState) ElementType() reflect.Type {
   273  	return reflect.TypeOf((*eventRuleState)(nil)).Elem()
   274  }
   275  
   276  type eventRuleArgs struct {
   277  	// The description of the rule.
   278  	Description *string `pulumi:"description"`
   279  	// The name or ARN of the event bus to associate with this rule.
   280  	// If you omit this, the `default` event bus is used.
   281  	EventBusName *string `pulumi:"eventBusName"`
   282  	// The event pattern described a JSON object. At least one of `scheduleExpression` or `eventPattern` is required. See full documentation of [Events and Event Patterns in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) for details. **Note**: The event pattern size is 2048 by default but it is adjustable up to 4096 characters by submitting a service quota increase request. See [Amazon EventBridge quotas](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-quota.html) for details.
   283  	EventPattern *string `pulumi:"eventPattern"`
   284  	// Used to delete managed rules created by AWS. Defaults to `false`.
   285  	ForceDestroy *bool `pulumi:"forceDestroy"`
   286  	// Whether the rule should be enabled.
   287  	// Defaults to `true`.
   288  	// Conflicts with `state`.
   289  	//
   290  	// Deprecated: Use "state" instead
   291  	IsEnabled *bool `pulumi:"isEnabled"`
   292  	// The name of the rule. If omitted, this provider will assign a random, unique name. Conflicts with `namePrefix`.
   293  	Name *string `pulumi:"name"`
   294  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`. **Note**: Due to the length of the generated suffix, must be 38 characters or less.
   295  	NamePrefix *string `pulumi:"namePrefix"`
   296  	// The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
   297  	RoleArn *string `pulumi:"roleArn"`
   298  	// The scheduling expression. For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`. At least one of `scheduleExpression` or `eventPattern` is required. Can only be used on the default event bus. For more information, refer to the AWS documentation [Schedule Expressions for Rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html).
   299  	ScheduleExpression *string `pulumi:"scheduleExpression"`
   300  	// State of the rule.
   301  	// Valid values are `DISABLED`, `ENABLED`, and `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   302  	// When state is `ENABLED`, the rule is enabled for all events except those delivered by CloudTrail.
   303  	// To also enable the rule for events delivered by CloudTrail, set `state` to `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   304  	// Defaults to `ENABLED`.
   305  	// Conflicts with `isEnabled`.
   306  	//
   307  	// **NOTE:** The rule state  `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS` cannot be used in conjunction with the `scheduleExpression` argument.
   308  	State *string `pulumi:"state"`
   309  	// A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   310  	Tags map[string]string `pulumi:"tags"`
   311  }
   312  
   313  // The set of arguments for constructing a EventRule resource.
   314  type EventRuleArgs struct {
   315  	// The description of the rule.
   316  	Description pulumi.StringPtrInput
   317  	// The name or ARN of the event bus to associate with this rule.
   318  	// If you omit this, the `default` event bus is used.
   319  	EventBusName pulumi.StringPtrInput
   320  	// The event pattern described a JSON object. At least one of `scheduleExpression` or `eventPattern` is required. See full documentation of [Events and Event Patterns in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) for details. **Note**: The event pattern size is 2048 by default but it is adjustable up to 4096 characters by submitting a service quota increase request. See [Amazon EventBridge quotas](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-quota.html) for details.
   321  	EventPattern pulumi.StringPtrInput
   322  	// Used to delete managed rules created by AWS. Defaults to `false`.
   323  	ForceDestroy pulumi.BoolPtrInput
   324  	// Whether the rule should be enabled.
   325  	// Defaults to `true`.
   326  	// Conflicts with `state`.
   327  	//
   328  	// Deprecated: Use "state" instead
   329  	IsEnabled pulumi.BoolPtrInput
   330  	// The name of the rule. If omitted, this provider will assign a random, unique name. Conflicts with `namePrefix`.
   331  	Name pulumi.StringPtrInput
   332  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`. **Note**: Due to the length of the generated suffix, must be 38 characters or less.
   333  	NamePrefix pulumi.StringPtrInput
   334  	// The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
   335  	RoleArn pulumi.StringPtrInput
   336  	// The scheduling expression. For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`. At least one of `scheduleExpression` or `eventPattern` is required. Can only be used on the default event bus. For more information, refer to the AWS documentation [Schedule Expressions for Rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html).
   337  	ScheduleExpression pulumi.StringPtrInput
   338  	// State of the rule.
   339  	// Valid values are `DISABLED`, `ENABLED`, and `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   340  	// When state is `ENABLED`, the rule is enabled for all events except those delivered by CloudTrail.
   341  	// To also enable the rule for events delivered by CloudTrail, set `state` to `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   342  	// Defaults to `ENABLED`.
   343  	// Conflicts with `isEnabled`.
   344  	//
   345  	// **NOTE:** The rule state  `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS` cannot be used in conjunction with the `scheduleExpression` argument.
   346  	State pulumi.StringPtrInput
   347  	// A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   348  	Tags pulumi.StringMapInput
   349  }
   350  
   351  func (EventRuleArgs) ElementType() reflect.Type {
   352  	return reflect.TypeOf((*eventRuleArgs)(nil)).Elem()
   353  }
   354  
   355  type EventRuleInput interface {
   356  	pulumi.Input
   357  
   358  	ToEventRuleOutput() EventRuleOutput
   359  	ToEventRuleOutputWithContext(ctx context.Context) EventRuleOutput
   360  }
   361  
   362  func (*EventRule) ElementType() reflect.Type {
   363  	return reflect.TypeOf((**EventRule)(nil)).Elem()
   364  }
   365  
   366  func (i *EventRule) ToEventRuleOutput() EventRuleOutput {
   367  	return i.ToEventRuleOutputWithContext(context.Background())
   368  }
   369  
   370  func (i *EventRule) ToEventRuleOutputWithContext(ctx context.Context) EventRuleOutput {
   371  	return pulumi.ToOutputWithContext(ctx, i).(EventRuleOutput)
   372  }
   373  
   374  // EventRuleArrayInput is an input type that accepts EventRuleArray and EventRuleArrayOutput values.
   375  // You can construct a concrete instance of `EventRuleArrayInput` via:
   376  //
   377  //	EventRuleArray{ EventRuleArgs{...} }
   378  type EventRuleArrayInput interface {
   379  	pulumi.Input
   380  
   381  	ToEventRuleArrayOutput() EventRuleArrayOutput
   382  	ToEventRuleArrayOutputWithContext(context.Context) EventRuleArrayOutput
   383  }
   384  
   385  type EventRuleArray []EventRuleInput
   386  
   387  func (EventRuleArray) ElementType() reflect.Type {
   388  	return reflect.TypeOf((*[]*EventRule)(nil)).Elem()
   389  }
   390  
   391  func (i EventRuleArray) ToEventRuleArrayOutput() EventRuleArrayOutput {
   392  	return i.ToEventRuleArrayOutputWithContext(context.Background())
   393  }
   394  
   395  func (i EventRuleArray) ToEventRuleArrayOutputWithContext(ctx context.Context) EventRuleArrayOutput {
   396  	return pulumi.ToOutputWithContext(ctx, i).(EventRuleArrayOutput)
   397  }
   398  
   399  // EventRuleMapInput is an input type that accepts EventRuleMap and EventRuleMapOutput values.
   400  // You can construct a concrete instance of `EventRuleMapInput` via:
   401  //
   402  //	EventRuleMap{ "key": EventRuleArgs{...} }
   403  type EventRuleMapInput interface {
   404  	pulumi.Input
   405  
   406  	ToEventRuleMapOutput() EventRuleMapOutput
   407  	ToEventRuleMapOutputWithContext(context.Context) EventRuleMapOutput
   408  }
   409  
   410  type EventRuleMap map[string]EventRuleInput
   411  
   412  func (EventRuleMap) ElementType() reflect.Type {
   413  	return reflect.TypeOf((*map[string]*EventRule)(nil)).Elem()
   414  }
   415  
   416  func (i EventRuleMap) ToEventRuleMapOutput() EventRuleMapOutput {
   417  	return i.ToEventRuleMapOutputWithContext(context.Background())
   418  }
   419  
   420  func (i EventRuleMap) ToEventRuleMapOutputWithContext(ctx context.Context) EventRuleMapOutput {
   421  	return pulumi.ToOutputWithContext(ctx, i).(EventRuleMapOutput)
   422  }
   423  
   424  type EventRuleOutput struct{ *pulumi.OutputState }
   425  
   426  func (EventRuleOutput) ElementType() reflect.Type {
   427  	return reflect.TypeOf((**EventRule)(nil)).Elem()
   428  }
   429  
   430  func (o EventRuleOutput) ToEventRuleOutput() EventRuleOutput {
   431  	return o
   432  }
   433  
   434  func (o EventRuleOutput) ToEventRuleOutputWithContext(ctx context.Context) EventRuleOutput {
   435  	return o
   436  }
   437  
   438  // The Amazon Resource Name (ARN) of the rule.
   439  func (o EventRuleOutput) Arn() pulumi.StringOutput {
   440  	return o.ApplyT(func(v *EventRule) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   441  }
   442  
   443  // The description of the rule.
   444  func (o EventRuleOutput) Description() pulumi.StringPtrOutput {
   445  	return o.ApplyT(func(v *EventRule) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   446  }
   447  
   448  // The name or ARN of the event bus to associate with this rule.
   449  // If you omit this, the `default` event bus is used.
   450  func (o EventRuleOutput) EventBusName() pulumi.StringPtrOutput {
   451  	return o.ApplyT(func(v *EventRule) pulumi.StringPtrOutput { return v.EventBusName }).(pulumi.StringPtrOutput)
   452  }
   453  
   454  // The event pattern described a JSON object. At least one of `scheduleExpression` or `eventPattern` is required. See full documentation of [Events and Event Patterns in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) for details. **Note**: The event pattern size is 2048 by default but it is adjustable up to 4096 characters by submitting a service quota increase request. See [Amazon EventBridge quotas](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-quota.html) for details.
   455  func (o EventRuleOutput) EventPattern() pulumi.StringPtrOutput {
   456  	return o.ApplyT(func(v *EventRule) pulumi.StringPtrOutput { return v.EventPattern }).(pulumi.StringPtrOutput)
   457  }
   458  
   459  // Used to delete managed rules created by AWS. Defaults to `false`.
   460  func (o EventRuleOutput) ForceDestroy() pulumi.BoolPtrOutput {
   461  	return o.ApplyT(func(v *EventRule) pulumi.BoolPtrOutput { return v.ForceDestroy }).(pulumi.BoolPtrOutput)
   462  }
   463  
   464  // Whether the rule should be enabled.
   465  // Defaults to `true`.
   466  // Conflicts with `state`.
   467  //
   468  // Deprecated: Use "state" instead
   469  func (o EventRuleOutput) IsEnabled() pulumi.BoolPtrOutput {
   470  	return o.ApplyT(func(v *EventRule) pulumi.BoolPtrOutput { return v.IsEnabled }).(pulumi.BoolPtrOutput)
   471  }
   472  
   473  // The name of the rule. If omitted, this provider will assign a random, unique name. Conflicts with `namePrefix`.
   474  func (o EventRuleOutput) Name() pulumi.StringOutput {
   475  	return o.ApplyT(func(v *EventRule) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   476  }
   477  
   478  // Creates a unique name beginning with the specified prefix. Conflicts with `name`. **Note**: Due to the length of the generated suffix, must be 38 characters or less.
   479  func (o EventRuleOutput) NamePrefix() pulumi.StringOutput {
   480  	return o.ApplyT(func(v *EventRule) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)
   481  }
   482  
   483  // The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
   484  func (o EventRuleOutput) RoleArn() pulumi.StringPtrOutput {
   485  	return o.ApplyT(func(v *EventRule) pulumi.StringPtrOutput { return v.RoleArn }).(pulumi.StringPtrOutput)
   486  }
   487  
   488  // The scheduling expression. For example, `cron(0 20 * * ? *)` or `rate(5 minutes)`. At least one of `scheduleExpression` or `eventPattern` is required. Can only be used on the default event bus. For more information, refer to the AWS documentation [Schedule Expressions for Rules](https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html).
   489  func (o EventRuleOutput) ScheduleExpression() pulumi.StringPtrOutput {
   490  	return o.ApplyT(func(v *EventRule) pulumi.StringPtrOutput { return v.ScheduleExpression }).(pulumi.StringPtrOutput)
   491  }
   492  
   493  // State of the rule.
   494  // Valid values are `DISABLED`, `ENABLED`, and `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   495  // When state is `ENABLED`, the rule is enabled for all events except those delivered by CloudTrail.
   496  // To also enable the rule for events delivered by CloudTrail, set `state` to `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS`.
   497  // Defaults to `ENABLED`.
   498  // Conflicts with `isEnabled`.
   499  //
   500  // **NOTE:** The rule state  `ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS` cannot be used in conjunction with the `scheduleExpression` argument.
   501  func (o EventRuleOutput) State() pulumi.StringPtrOutput {
   502  	return o.ApplyT(func(v *EventRule) pulumi.StringPtrOutput { return v.State }).(pulumi.StringPtrOutput)
   503  }
   504  
   505  // A map of tags to assign to the resource. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   506  func (o EventRuleOutput) Tags() pulumi.StringMapOutput {
   507  	return o.ApplyT(func(v *EventRule) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   508  }
   509  
   510  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   511  //
   512  // Deprecated: Please use `tags` instead.
   513  func (o EventRuleOutput) TagsAll() pulumi.StringMapOutput {
   514  	return o.ApplyT(func(v *EventRule) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   515  }
   516  
   517  type EventRuleArrayOutput struct{ *pulumi.OutputState }
   518  
   519  func (EventRuleArrayOutput) ElementType() reflect.Type {
   520  	return reflect.TypeOf((*[]*EventRule)(nil)).Elem()
   521  }
   522  
   523  func (o EventRuleArrayOutput) ToEventRuleArrayOutput() EventRuleArrayOutput {
   524  	return o
   525  }
   526  
   527  func (o EventRuleArrayOutput) ToEventRuleArrayOutputWithContext(ctx context.Context) EventRuleArrayOutput {
   528  	return o
   529  }
   530  
   531  func (o EventRuleArrayOutput) Index(i pulumi.IntInput) EventRuleOutput {
   532  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EventRule {
   533  		return vs[0].([]*EventRule)[vs[1].(int)]
   534  	}).(EventRuleOutput)
   535  }
   536  
   537  type EventRuleMapOutput struct{ *pulumi.OutputState }
   538  
   539  func (EventRuleMapOutput) ElementType() reflect.Type {
   540  	return reflect.TypeOf((*map[string]*EventRule)(nil)).Elem()
   541  }
   542  
   543  func (o EventRuleMapOutput) ToEventRuleMapOutput() EventRuleMapOutput {
   544  	return o
   545  }
   546  
   547  func (o EventRuleMapOutput) ToEventRuleMapOutputWithContext(ctx context.Context) EventRuleMapOutput {
   548  	return o
   549  }
   550  
   551  func (o EventRuleMapOutput) MapIndex(k pulumi.StringInput) EventRuleOutput {
   552  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EventRule {
   553  		return vs[0].(map[string]*EventRule)[vs[1].(string)]
   554  	}).(EventRuleOutput)
   555  }
   556  
   557  func init() {
   558  	pulumi.RegisterInputType(reflect.TypeOf((*EventRuleInput)(nil)).Elem(), &EventRule{})
   559  	pulumi.RegisterInputType(reflect.TypeOf((*EventRuleArrayInput)(nil)).Elem(), EventRuleArray{})
   560  	pulumi.RegisterInputType(reflect.TypeOf((*EventRuleMapInput)(nil)).Elem(), EventRuleMap{})
   561  	pulumi.RegisterOutputType(EventRuleOutput{})
   562  	pulumi.RegisterOutputType(EventRuleArrayOutput{})
   563  	pulumi.RegisterOutputType(EventRuleMapOutput{})
   564  }