aws_sdk_cloudwatch/client/put_insight_rule.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3 /// Constructs a fluent builder for the [`PutInsightRule`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder) operation.
4 ///
5 /// - The fluent builder is configurable:
6 /// - [`rule_name(impl Into<String>)`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::rule_name) / [`set_rule_name(Option<String>)`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::set_rule_name):<br>required: **true**<br><p>A unique name for the rule.</p><br>
7 /// - [`rule_state(impl Into<String>)`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::rule_state) / [`set_rule_state(Option<String>)`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::set_rule_state):<br>required: **false**<br><p>The state of the rule. Valid values are ENABLED and DISABLED.</p><br>
8 /// - [`rule_definition(impl Into<String>)`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::rule_definition) / [`set_rule_definition(Option<String>)`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::set_rule_definition):<br>required: **true**<br><p>The definition of the rule, as a JSON object. For details on the valid syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html">Contributor Insights Rule Syntax</a>.</p><br>
9 /// - [`tags(Tag)`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::tags) / [`set_tags(Option<Vec::<Tag>>)`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::set_tags):<br>required: **false**<br><p>A list of key-value pairs to associate with the Contributor Insights rule. You can associate as many as 50 tags with a rule.</p> <p>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 the resources that have certain tag values.</p> <p>To be able to associate tags with a rule, you must have the <code>cloudwatch:TagResource</code> permission in addition to the <code>cloudwatch:PutInsightRule</code> permission.</p> <p>If you are using this operation to update an existing Contributor Insights rule, any tags you specify in this parameter are ignored. To change the tags of an existing rule, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a>.</p><br>
10 /// - [`apply_on_transformed_logs(bool)`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::apply_on_transformed_logs) / [`set_apply_on_transformed_logs(Option<bool>)`](crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::set_apply_on_transformed_logs):<br>required: **false**<br><p>Specify <code>true</code> to have this rule evaluate log events after they have been transformed by <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html">Log transformation</a>. If you specify <code>true</code>, then the log events in log groups that have transformers will be evaluated by Contributor Insights after being transformed. Log groups that don't have transformers will still have their original log events evaluated by Contributor Insights.</p> <p>The default is <code>false</code></p><note> <p>If a log group has a transformer, and transformation fails for some log events, those log events won't be evaluated by Contributor Insights. For information about investigating log transformation failures, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Transformation-Errors-Metrics.html">Transformation metrics and errors</a>.</p> </note><br>
11 /// - On success, responds with [`PutInsightRuleOutput`](crate::operation::put_insight_rule::PutInsightRuleOutput)
12 /// - On failure, responds with [`SdkError<PutInsightRuleError>`](crate::operation::put_insight_rule::PutInsightRuleError)
13 pub fn put_insight_rule(&self) -> crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder {
14 crate::operation::put_insight_rule::builders::PutInsightRuleFluentBuilder::new(self.handle.clone())
15 }
16}