pub struct PutRuleFluentBuilder { /* private fields */ }
Expand description

Fluent builder constructing a request to PutRule.

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 have custom applications or services, you can specify whether their events go to your default event bus or a custom event bus that you have created. For more information, see CreateEventBus.

If you are updating an existing rule, the rule is replaced with what you specify in this PutRule command. If you omit arguments in PutRule, the old values for those arguments are not kept. Instead, they are replaced with null values.

When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Allow a short period of time for changes to take effect.

A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, in which case the rule triggers on matching events as well as on a schedule.

When you initially create a rule, you can optionally assign one or more tags to the rule. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only rules with certain tag values. To use the PutRule operation and assign tags, you must have both the events:PutRule and events:TagResource permissions.

If you are updating an existing rule, any tags you specify in the PutRule operation are ignored. To update the tags of an existing rule, use TagResource and UntagResource.

Most services in Amazon Web Services treat : or / as the same character in Amazon Resource Names (ARNs). However, EventBridge uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.

In EventBridge, it is possible to create rules that lead to infinite loops, where a rule is fired repeatedly. For example, a rule might detect that ACLs have changed on an S3 bucket, and trigger software to change them to the desired state. If the rule is not written carefully, the subsequent change to the ACLs fires the rule again, creating an infinite loop.

To prevent this, write the rules so that the triggered actions do not re-fire the same rule. For example, your rule could fire only if ACLs are found to be in a bad state, instead of after any change.

An infinite loop can quickly cause higher than expected charges. We recommend that you use budgeting, which alerts you when charges exceed your specified limit. For more information, see Managing Your Costs with Budgets.

Implementations§

source§

impl PutRuleFluentBuilder

source

pub fn as_input(&self) -> &PutRuleInputBuilder

Access the PutRule as a reference.

source

pub async fn send( self ) -> Result<PutRuleOutput, SdkError<PutRuleError, HttpResponse>>

Sends the request and returns the response.

If an error occurs, an SdkError will be returned with additional details that can be matched against.

By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.

source

pub fn customize( self ) -> CustomizableOperation<PutRuleOutput, PutRuleError, Self>

Consumes this builder, creating a customizable operation that can be modified before being sent.

source

pub fn name(self, input: impl Into<String>) -> Self

The name of the rule that you are creating or updating.

source

pub fn set_name(self, input: Option<String>) -> Self

The name of the rule that you are creating or updating.

source

pub fn get_name(&self) -> &Option<String>

The name of the rule that you are creating or updating.

source

pub fn schedule_expression(self, input: impl Into<String>) -> Self

The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".

source

pub fn set_schedule_expression(self, input: Option<String>) -> Self

The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".

source

pub fn get_schedule_expression(&self) -> &Option<String>

The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".

source

pub fn event_pattern(self, input: impl Into<String>) -> Self

The event pattern. For more information, see Amazon EventBridge event patterns in the Amazon EventBridge User Guide.

source

pub fn set_event_pattern(self, input: Option<String>) -> Self

The event pattern. For more information, see Amazon EventBridge event patterns in the Amazon EventBridge User Guide.

source

pub fn get_event_pattern(&self) -> &Option<String>

The event pattern. For more information, see Amazon EventBridge event patterns in the Amazon EventBridge User Guide.

source

pub fn state(self, input: RuleState) -> Self

Indicates whether the rule is enabled or disabled.

source

pub fn set_state(self, input: Option<RuleState>) -> Self

Indicates whether the rule is enabled or disabled.

source

pub fn get_state(&self) -> &Option<RuleState>

Indicates whether the rule is enabled or disabled.

source

pub fn description(self, input: impl Into<String>) -> Self

A description of the rule.

source

pub fn set_description(self, input: Option<String>) -> Self

A description of the rule.

source

pub fn get_description(&self) -> &Option<String>

A description of the rule.

source

pub fn role_arn(self, input: impl Into<String>) -> Self

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.

source

pub fn set_role_arn(self, input: Option<String>) -> Self

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.

source

pub fn get_role_arn(&self) -> &Option<String>

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.

source

pub fn tags(self, input: Tag) -> Self

Appends an item to Tags.

To override the contents of this collection use set_tags.

The list of key-value pairs to associate with the rule.

source

pub fn set_tags(self, input: Option<Vec<Tag>>) -> Self

The list of key-value pairs to associate with the rule.

source

pub fn get_tags(&self) -> &Option<Vec<Tag>>

The list of key-value pairs to associate with the rule.

source

pub fn event_bus_name(self, input: impl Into<String>) -> Self

The name or ARN of the event bus to associate with this rule. If you omit this, the default event bus is used.

source

pub fn set_event_bus_name(self, input: Option<String>) -> Self

The name or ARN of the event bus to associate with this rule. If you omit this, the default event bus is used.

source

pub fn get_event_bus_name(&self) -> &Option<String>

The name or ARN of the event bus to associate with this rule. If you omit this, the default event bus is used.

Trait Implementations§

source§

impl Clone for PutRuleFluentBuilder

source§

fn clone(&self) -> PutRuleFluentBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PutRuleFluentBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more