aws_sdk_wafv2/client/create_rule_group.rs
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
/// Constructs a fluent builder for the [`CreateRuleGroup`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder) operation.
///
/// - The fluent builder is configurable:
/// - [`name(impl Into<String>)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::name) / [`set_name(Option<String>)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::set_name):<br>required: **true**<br><p>The name of the rule group. You cannot change the name of a rule group after you create it.</p><br>
/// - [`scope(Scope)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::scope) / [`set_scope(Option<Scope>)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::set_scope):<br>required: **true**<br><p>Specifies whether this is for an Amazon CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito user pool, an App Runner service, or an Amazon Web Services Verified Access instance.</p> <p>To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:</p> <ul> <li> <p>CLI - Specify the Region when you use the CloudFront scope: <code>--scope=CLOUDFRONT --region=us-east-1</code>.</p></li> <li> <p>API and SDKs - For all calls, use the Region endpoint us-east-1.</p></li> </ul><br>
/// - [`capacity(i64)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::capacity) / [`set_capacity(Option<i64>)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::set_capacity):<br>required: **true**<br><p>The web ACL capacity units (WCUs) required for this rule group.</p> <p>When you create your own rule group, you define this, and you cannot change it after creation. When you add or modify the rules in a rule group, WAF enforces this limit. You can check the capacity for a set of rules using <code>CheckCapacity</code>.</p> <p>WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html">WAF web ACL capacity units (WCU)</a> in the <i>WAF Developer Guide</i>.</p><br>
/// - [`description(impl Into<String>)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::description) / [`set_description(Option<String>)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::set_description):<br>required: **false**<br><p>A description of the rule group that helps with identification.</p><br>
/// - [`rules(Rule)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::rules) / [`set_rules(Option<Vec::<Rule>>)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::set_rules):<br>required: **false**<br><p>The <code>Rule</code> statements used to identify the web requests that you want to manage. Each rule includes one top-level statement that WAF uses to identify matching web requests, and parameters that govern how WAF handles them.</p><br>
/// - [`visibility_config(VisibilityConfig)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::visibility_config) / [`set_visibility_config(Option<VisibilityConfig>)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::set_visibility_config):<br>required: **true**<br><p>Defines and enables Amazon CloudWatch metrics and web request sample collection.</p><br>
/// - [`tags(Tag)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::tags) / [`set_tags(Option<Vec::<Tag>>)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::set_tags):<br>required: **false**<br><p>An array of key:value pairs to associate with the resource.</p><br>
/// - [`custom_response_bodies(impl Into<String>, CustomResponseBody)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::custom_response_bodies) / [`set_custom_response_bodies(Option<HashMap::<String, CustomResponseBody>>)`](crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::set_custom_response_bodies):<br>required: **false**<br><p>A map of custom response keys and content bodies. When you create a rule with a block action, you can send a custom response to the web request. You define these for the rule group, and then use them in the rules that you define in the rule group.</p> <p>For information about customizing web requests and responses, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html">Customizing web requests and responses in WAF</a> in the <i>WAF Developer Guide</i>.</p> <p>For information about the limits on count and size for custom request and response settings, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/limits.html">WAF quotas</a> in the <i>WAF Developer Guide</i>.</p><br>
/// - On success, responds with [`CreateRuleGroupOutput`](crate::operation::create_rule_group::CreateRuleGroupOutput) with field(s):
/// - [`summary(Option<RuleGroupSummary>)`](crate::operation::create_rule_group::CreateRuleGroupOutput::summary): <p>High-level information about a <code>RuleGroup</code>, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage a <code>RuleGroup</code>, and the ARN, that you provide to the <code>RuleGroupReferenceStatement</code> to use the rule group in a <code>Rule</code>.</p>
/// - On failure, responds with [`SdkError<CreateRuleGroupError>`](crate::operation::create_rule_group::CreateRuleGroupError)
pub fn create_rule_group(&self) -> crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder {
crate::operation::create_rule_group::builders::CreateRuleGroupFluentBuilder::new(self.handle.clone())
}
}