#[non_exhaustive]pub struct ConfigRule {
pub config_rule_name: Option<String>,
pub config_rule_arn: Option<String>,
pub config_rule_id: Option<String>,
pub description: Option<String>,
pub scope: Option<Scope>,
pub source: Option<Source>,
pub input_parameters: Option<String>,
pub maximum_execution_frequency: Option<MaximumExecutionFrequency>,
pub config_rule_state: Option<ConfigRuleState>,
pub created_by: Option<String>,
pub evaluation_modes: Option<Vec<EvaluationModeConfiguration>>,
}
Expand description
Config rules evaluate the configuration settings of your Amazon Web Services resources. A rule can run when Config detects a configuration change to an Amazon Web Services resource or at a periodic frequency that you choose (for example, every 24 hours). There are two types of rules: Config Managed Rules and Config Custom Rules.
Config Managed Rules are predefined, customizable rules created by Config. For a list of managed rules, see List of Config Managed Rules.
Config Custom Rules are rules that you create from scratch. There are two ways to create Config custom rules: with Lambda functions ( Lambda Developer Guide) and with Guard (Guard GitHub Repository), a policy-as-code language. Config custom rules created with Lambda are called Config Custom Lambda Rules and Config custom rules created with Guard are called Config Custom Policy Rules.
For more information about developing and using Config rules, see Evaluating Resource with Config Rules in the Config Developer Guide.
You can use the Amazon Web Services CLI and Amazon Web Services SDKs if you want to create a rule that triggers evaluations for your resources when Config delivers the configuration snapshot. For more information, see ConfigSnapshotDeliveryProperties
.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.config_rule_name: Option<String>
The name that you assign to the Config rule. The name is required if you are adding a new rule.
config_rule_arn: Option<String>
The Amazon Resource Name (ARN) of the Config rule.
config_rule_id: Option<String>
The ID of the Config rule.
description: Option<String>
The description that you provide for the Config rule.
scope: Option<Scope>
Defines which resources can trigger an evaluation for the rule. The scope can include one or more resource types, a combination of one resource type and one resource ID, or a combination of a tag key and value. Specify a scope to constrain the resources that can trigger an evaluation for the rule. If you do not specify a scope, evaluations are triggered when any resource in the recording group changes.
The scope can be empty.
source: Option<Source>
Provides the rule owner (Amazon Web Services
for managed rules, CUSTOM_POLICY
for Custom Policy rules, and CUSTOM_LAMBDA
for Custom Lambda rules), the rule identifier, and the notifications that cause the function to evaluate your Amazon Web Services resources.
input_parameters: Option<String>
A string, in JSON format, that is passed to the Config rule Lambda function.
maximum_execution_frequency: Option<MaximumExecutionFrequency>
The maximum frequency with which Config runs evaluations for a rule. You can specify a value for MaximumExecutionFrequency
when:
-
This is for an Config managed rule that is triggered at a periodic frequency.
-
Your custom rule is triggered when Config delivers the configuration snapshot. For more information, see
ConfigSnapshotDeliveryProperties
.
By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the MaximumExecutionFrequency
parameter.
config_rule_state: Option<ConfigRuleState>
Indicates whether the Config rule is active or is currently being deleted by Config. It can also indicate the evaluation status for the Config rule.
Config sets the state of the rule to EVALUATING
temporarily after you use the StartConfigRulesEvaluation
request to evaluate your resources against the Config rule.
Config sets the state of the rule to DELETING_RESULTS
temporarily after you use the DeleteEvaluationResults
request to delete the current evaluation results for the Config rule.
Config temporarily sets the state of a rule to DELETING
after you use the DeleteConfigRule
request to delete the rule. After Config deletes the rule, the rule and all of its evaluations are erased and are no longer available.
created_by: Option<String>
Service principal name of the service that created the rule.
The field is populated only if the service-linked rule is created by a service. The field is empty if you create your own rule.
evaluation_modes: Option<Vec<EvaluationModeConfiguration>>
The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the value is Detective evaluation mode only.
Implementations§
Source§impl ConfigRule
impl ConfigRule
Sourcepub fn config_rule_name(&self) -> Option<&str>
pub fn config_rule_name(&self) -> Option<&str>
The name that you assign to the Config rule. The name is required if you are adding a new rule.
Sourcepub fn config_rule_arn(&self) -> Option<&str>
pub fn config_rule_arn(&self) -> Option<&str>
The Amazon Resource Name (ARN) of the Config rule.
Sourcepub fn config_rule_id(&self) -> Option<&str>
pub fn config_rule_id(&self) -> Option<&str>
The ID of the Config rule.
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
The description that you provide for the Config rule.
Sourcepub fn scope(&self) -> Option<&Scope>
pub fn scope(&self) -> Option<&Scope>
Defines which resources can trigger an evaluation for the rule. The scope can include one or more resource types, a combination of one resource type and one resource ID, or a combination of a tag key and value. Specify a scope to constrain the resources that can trigger an evaluation for the rule. If you do not specify a scope, evaluations are triggered when any resource in the recording group changes.
The scope can be empty.
Sourcepub fn source(&self) -> Option<&Source>
pub fn source(&self) -> Option<&Source>
Provides the rule owner (Amazon Web Services
for managed rules, CUSTOM_POLICY
for Custom Policy rules, and CUSTOM_LAMBDA
for Custom Lambda rules), the rule identifier, and the notifications that cause the function to evaluate your Amazon Web Services resources.
Sourcepub fn input_parameters(&self) -> Option<&str>
pub fn input_parameters(&self) -> Option<&str>
A string, in JSON format, that is passed to the Config rule Lambda function.
Sourcepub fn maximum_execution_frequency(&self) -> Option<&MaximumExecutionFrequency>
pub fn maximum_execution_frequency(&self) -> Option<&MaximumExecutionFrequency>
The maximum frequency with which Config runs evaluations for a rule. You can specify a value for MaximumExecutionFrequency
when:
-
This is for an Config managed rule that is triggered at a periodic frequency.
-
Your custom rule is triggered when Config delivers the configuration snapshot. For more information, see
ConfigSnapshotDeliveryProperties
.
By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the MaximumExecutionFrequency
parameter.
Sourcepub fn config_rule_state(&self) -> Option<&ConfigRuleState>
pub fn config_rule_state(&self) -> Option<&ConfigRuleState>
Indicates whether the Config rule is active or is currently being deleted by Config. It can also indicate the evaluation status for the Config rule.
Config sets the state of the rule to EVALUATING
temporarily after you use the StartConfigRulesEvaluation
request to evaluate your resources against the Config rule.
Config sets the state of the rule to DELETING_RESULTS
temporarily after you use the DeleteEvaluationResults
request to delete the current evaluation results for the Config rule.
Config temporarily sets the state of a rule to DELETING
after you use the DeleteConfigRule
request to delete the rule. After Config deletes the rule, the rule and all of its evaluations are erased and are no longer available.
Sourcepub fn created_by(&self) -> Option<&str>
pub fn created_by(&self) -> Option<&str>
Service principal name of the service that created the rule.
The field is populated only if the service-linked rule is created by a service. The field is empty if you create your own rule.
Sourcepub fn evaluation_modes(&self) -> &[EvaluationModeConfiguration]
pub fn evaluation_modes(&self) -> &[EvaluationModeConfiguration]
The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the value is Detective evaluation mode only.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .evaluation_modes.is_none()
.
Source§impl ConfigRule
impl ConfigRule
Sourcepub fn builder() -> ConfigRuleBuilder
pub fn builder() -> ConfigRuleBuilder
Creates a new builder-style object to manufacture ConfigRule
.
Trait Implementations§
Source§impl Clone for ConfigRule
impl Clone for ConfigRule
Source§fn clone(&self) -> ConfigRule
fn clone(&self) -> ConfigRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ConfigRule
impl Debug for ConfigRule
Source§impl PartialEq for ConfigRule
impl PartialEq for ConfigRule
impl StructuralPartialEq for ConfigRule
Auto Trait Implementations§
impl Freeze for ConfigRule
impl RefUnwindSafe for ConfigRule
impl Send for ConfigRule
impl Sync for ConfigRule
impl Unpin for ConfigRule
impl UnwindSafe for ConfigRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.bright_black());
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.bright_green());
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.bright_yellow());
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.bright_magenta());
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Returns self
with the
fg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.bright_white());
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlack
.
§Example
println!("{}", value.on_bright_black());
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightGreen
.
§Example
println!("{}", value.on_bright_green());
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightYellow
.
§Example
println!("{}", value.on_bright_yellow());
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightBlue
.
§Example
println!("{}", value.on_bright_blue());
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightMagenta
.
§Example
println!("{}", value.on_bright_magenta());
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightCyan
.
§Example
println!("{}", value.on_bright_cyan());
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Returns self
with the
bg()
set to
Color::BrightWhite
.
§Example
println!("{}", value.on_bright_white());
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn underline(&self) -> Painted<&T>
fn underline(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::Underline
.
§Example
println!("{}", value.underline());
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Returns self
with the
attr()
set to
Attribute::RapidBlink
.
§Example
println!("{}", value.rapid_blink());
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);