Struct aws_sdk_wafv2::types::builders::RuleBuilder

source ·
#[non_exhaustive]
pub struct RuleBuilder { /* private fields */ }
Expand description

A builder for Rule.

Implementations§

source§

impl RuleBuilder

source

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

The name of the rule.

If you change the name of a Rule after you create it and you want the rule's metric name to reflect the change, update the metric name in the rule's VisibilityConfig settings. WAF doesn't automatically update the metric name when you update the rule name.

This field is required.
source

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

The name of the rule.

If you change the name of a Rule after you create it and you want the rule's metric name to reflect the change, update the metric name in the rule's VisibilityConfig settings. WAF doesn't automatically update the metric name when you update the rule name.

source

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

The name of the rule.

If you change the name of a Rule after you create it and you want the rule's metric name to reflect the change, update the metric name in the rule's VisibilityConfig settings. WAF doesn't automatically update the metric name when you update the rule name.

source

pub fn priority(self, input: i32) -> Self

If you define more than one Rule in a WebACL, WAF evaluates each request against the Rules in order based on the value of Priority. WAF processes rules with lower priority first. The priorities don't need to be consecutive, but they must all be different.

This field is required.
source

pub fn set_priority(self, input: Option<i32>) -> Self

If you define more than one Rule in a WebACL, WAF evaluates each request against the Rules in order based on the value of Priority. WAF processes rules with lower priority first. The priorities don't need to be consecutive, but they must all be different.

source

pub fn get_priority(&self) -> &Option<i32>

If you define more than one Rule in a WebACL, WAF evaluates each request against the Rules in order based on the value of Priority. WAF processes rules with lower priority first. The priorities don't need to be consecutive, but they must all be different.

source

pub fn statement(self, input: Statement) -> Self

The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.

This field is required.
source

pub fn set_statement(self, input: Option<Statement>) -> Self

The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.

source

pub fn get_statement(&self) -> &Option<Statement>

The WAF processing statement for the rule, for example ByteMatchStatement or SizeConstraintStatement.

source

pub fn action(self, input: RuleAction) -> Self

The action that WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.

This is used only for rules whose statements do not reference a rule group. Rule statements that reference a rule group include RuleGroupReferenceStatement and ManagedRuleGroupStatement.

You must specify either this Action setting or the rule OverrideAction setting, but not both:

  • If the rule statement does not reference a rule group, use this rule action setting and not the rule override action setting.

  • If the rule statement references a rule group, use the override action setting and not this action setting.

source

pub fn set_action(self, input: Option<RuleAction>) -> Self

The action that WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.

This is used only for rules whose statements do not reference a rule group. Rule statements that reference a rule group include RuleGroupReferenceStatement and ManagedRuleGroupStatement.

You must specify either this Action setting or the rule OverrideAction setting, but not both:

  • If the rule statement does not reference a rule group, use this rule action setting and not the rule override action setting.

  • If the rule statement references a rule group, use the override action setting and not this action setting.

source

pub fn get_action(&self) -> &Option<RuleAction>

The action that WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.

This is used only for rules whose statements do not reference a rule group. Rule statements that reference a rule group include RuleGroupReferenceStatement and ManagedRuleGroupStatement.

You must specify either this Action setting or the rule OverrideAction setting, but not both:

  • If the rule statement does not reference a rule group, use this rule action setting and not the rule override action setting.

  • If the rule statement references a rule group, use the override action setting and not this action setting.

source

pub fn override_action(self, input: OverrideAction) -> Self

The action to use in the place of the action that results from the rule group evaluation. Set the override action to none to leave the result of the rule group alone. Set it to count to override the result to count only.

You can only use this for rule statements that reference a rule group, like RuleGroupReferenceStatement and ManagedRuleGroupStatement.

This option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you want the rules in the rule group to only count matches, do not use this and instead use the rule action override option, with Count action, in your rule group reference statement settings.

source

pub fn set_override_action(self, input: Option<OverrideAction>) -> Self

The action to use in the place of the action that results from the rule group evaluation. Set the override action to none to leave the result of the rule group alone. Set it to count to override the result to count only.

You can only use this for rule statements that reference a rule group, like RuleGroupReferenceStatement and ManagedRuleGroupStatement.

This option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you want the rules in the rule group to only count matches, do not use this and instead use the rule action override option, with Count action, in your rule group reference statement settings.

source

pub fn get_override_action(&self) -> &Option<OverrideAction>

The action to use in the place of the action that results from the rule group evaluation. Set the override action to none to leave the result of the rule group alone. Set it to count to override the result to count only.

You can only use this for rule statements that reference a rule group, like RuleGroupReferenceStatement and ManagedRuleGroupStatement.

This option is usually set to none. It does not affect how the rules in the rule group are evaluated. If you want the rules in the rule group to only count matches, do not use this and instead use the rule action override option, with Count action, in your rule group reference statement settings.

source

pub fn rule_labels(self, input: Label) -> Self

Appends an item to rule_labels.

To override the contents of this collection use set_rule_labels.

Labels to apply to web requests that match the rule match statement. WAF applies fully qualified labels to matching web requests. A fully qualified label is the concatenation of a label namespace and a rule label. The rule's rule group or web ACL defines the label namespace.

Rules that run after this rule in the web ACL can match against these labels using a LabelMatchStatement.

For each label, provide a case-sensitive string containing optional namespaces and a label name, according to the following guidelines:

  • Separate each component of the label with a colon.

  • Each namespace or name can have up to 128 characters.

  • You can specify up to 5 namespaces in a label.

  • Don't use the following reserved words in your label specification: aws, waf, managed, rulegroup, webacl, regexpatternset, or ipset.

For example, myLabelName or nameSpace1:nameSpace2:myLabelName.

source

pub fn set_rule_labels(self, input: Option<Vec<Label>>) -> Self

Labels to apply to web requests that match the rule match statement. WAF applies fully qualified labels to matching web requests. A fully qualified label is the concatenation of a label namespace and a rule label. The rule's rule group or web ACL defines the label namespace.

Rules that run after this rule in the web ACL can match against these labels using a LabelMatchStatement.

For each label, provide a case-sensitive string containing optional namespaces and a label name, according to the following guidelines:

  • Separate each component of the label with a colon.

  • Each namespace or name can have up to 128 characters.

  • You can specify up to 5 namespaces in a label.

  • Don't use the following reserved words in your label specification: aws, waf, managed, rulegroup, webacl, regexpatternset, or ipset.

For example, myLabelName or nameSpace1:nameSpace2:myLabelName.

source

pub fn get_rule_labels(&self) -> &Option<Vec<Label>>

Labels to apply to web requests that match the rule match statement. WAF applies fully qualified labels to matching web requests. A fully qualified label is the concatenation of a label namespace and a rule label. The rule's rule group or web ACL defines the label namespace.

Rules that run after this rule in the web ACL can match against these labels using a LabelMatchStatement.

For each label, provide a case-sensitive string containing optional namespaces and a label name, according to the following guidelines:

  • Separate each component of the label with a colon.

  • Each namespace or name can have up to 128 characters.

  • You can specify up to 5 namespaces in a label.

  • Don't use the following reserved words in your label specification: aws, waf, managed, rulegroup, webacl, regexpatternset, or ipset.

For example, myLabelName or nameSpace1:nameSpace2:myLabelName.

source

pub fn visibility_config(self, input: VisibilityConfig) -> Self

Defines and enables Amazon CloudWatch metrics and web request sample collection.

If you change the name of a Rule after you create it and you want the rule's metric name to reflect the change, update the metric name as well. WAF doesn't automatically update the metric name.

This field is required.
source

pub fn set_visibility_config(self, input: Option<VisibilityConfig>) -> Self

Defines and enables Amazon CloudWatch metrics and web request sample collection.

If you change the name of a Rule after you create it and you want the rule's metric name to reflect the change, update the metric name as well. WAF doesn't automatically update the metric name.

source

pub fn get_visibility_config(&self) -> &Option<VisibilityConfig>

Defines and enables Amazon CloudWatch metrics and web request sample collection.

If you change the name of a Rule after you create it and you want the rule's metric name to reflect the change, update the metric name as well. WAF doesn't automatically update the metric name.

source

pub fn captcha_config(self, input: CaptchaConfig) -> Self

Specifies how WAF should handle CAPTCHA evaluations. If you don't specify this, WAF uses the CAPTCHA configuration that's defined for the web ACL.

source

pub fn set_captcha_config(self, input: Option<CaptchaConfig>) -> Self

Specifies how WAF should handle CAPTCHA evaluations. If you don't specify this, WAF uses the CAPTCHA configuration that's defined for the web ACL.

source

pub fn get_captcha_config(&self) -> &Option<CaptchaConfig>

Specifies how WAF should handle CAPTCHA evaluations. If you don't specify this, WAF uses the CAPTCHA configuration that's defined for the web ACL.

source

pub fn challenge_config(self, input: ChallengeConfig) -> Self

Specifies how WAF should handle Challenge evaluations. If you don't specify this, WAF uses the challenge configuration that's defined for the web ACL.

source

pub fn set_challenge_config(self, input: Option<ChallengeConfig>) -> Self

Specifies how WAF should handle Challenge evaluations. If you don't specify this, WAF uses the challenge configuration that's defined for the web ACL.

source

pub fn get_challenge_config(&self) -> &Option<ChallengeConfig>

Specifies how WAF should handle Challenge evaluations. If you don't specify this, WAF uses the challenge configuration that's defined for the web ACL.

source

pub fn build(self) -> Result<Rule, BuildError>

Consumes the builder and constructs a Rule. This method will fail if any of the following fields are not set:

Trait Implementations§

source§

impl Clone for RuleBuilder

source§

fn clone(&self) -> RuleBuilder

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 RuleBuilder

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for RuleBuilder

source§

fn default() -> RuleBuilder

Returns the “default value” for a type. Read more
source§

impl PartialEq for RuleBuilder

source§

fn eq(&self, other: &RuleBuilder) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for RuleBuilder

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<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