EventBridgeClient.put_rule
rboto-eventbridge==0.4.0 · Service index · Types
Model summary (excerpt): Creates or updates the specified rule. Rules are enabled by default, or based on value of the state. You can disable a rule using DisableRule . A single rule watches for events from a single event bus. Events generated by Amazon Web Services services go to your account's default event bus. Events generated by SaaS partner services or applications go to the matching partner event bus. If you...
Install and imports
from rboto import EventBridgeClient
from collections.abc import Sequence
from rboto_eventbridge.types import (
PutRuleOutput,
RuleState,
Tag,
)
Signature
async def put_rule(
*,
name: str,
schedule_expression: str | None = None,
event_pattern: str | None = None,
state: RuleState | None = None,
description: str | None = None,
role_arn: str | None = None,
tags: Sequence[Tag] | None = None,
event_bus_name: str | None = None,
) -> PutRuleOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
name |
Yes | The name of the rule that you are creating or updating. |
schedule_expression |
No | The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)". |
event_pattern |
No | The event pattern. For more information, see Amazon EventBridge event patterns in the Amazon EventBridge User Guide . |
state |
No | The state of the rule. Valid values include: DISABLED : The rule is disabled. EventBridge does not match any events against the rule. ENABLED : The rule is enabled. EventBridge matches events against the rule, except for Amazon Web Services management events delivered through CloudTrail. ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS : The rule is enabled for all events, including Amazon Web... |
description |
No | A description of the rule. |
role_arn |
No | The Amazon Resource Name (ARN) of the IAM role associated with the rule. If you're setting an event bus in another account as the target and that account granted permission to your account through an organization instead of directly by the account ID, you must specify a RoleArn with proper permissions in the Target structure, instead of here in this parameter. |
tags |
No | The list of key-value pairs to associate with the rule. |
event_bus_name |
No | The name or ARN of the event bus to associate with this rule. If you omit this, the default event bus is used. |
Output
PutRuleOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
rule_arn |
str | None |
Always present | — |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
No output stream.
Errors
Import from rboto_eventbridge.exceptions:
ConcurrentModificationError, InternalError, InvalidEventPatternError, LimitExceededError, ManagedRuleError, ResourceNotFoundError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.