/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ConfigService { namespace Model { /** *

An Config rule represents an Lambda function that you create for a custom * rule or a predefined function for an Config managed rule. The function evaluates * configuration items to assess whether your Amazon Web Services resources comply * with your desired configurations. This function can run when Config detects a * configuration change to an Amazon Web Services resource and at a periodic * frequency that you choose (for example, every 24 hours).

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.

For more information * about developing and using Config rules, see Evaluating * Amazon Web Services resource Configurations with Config in the Config * Developer Guide.

See Also:

AWS * API Reference

*/ class AWS_CONFIGSERVICE_API ConfigRule { public: ConfigRule(); ConfigRule(Aws::Utils::Json::JsonView jsonValue); ConfigRule& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** *

The name that you assign to the Config rule. The name is required if you are * adding a new rule.

*/ inline const Aws::String& GetConfigRuleName() const{ return m_configRuleName; } /** *

The name that you assign to the Config rule. The name is required if you are * adding a new rule.

*/ inline bool ConfigRuleNameHasBeenSet() const { return m_configRuleNameHasBeenSet; } /** *

The name that you assign to the Config rule. The name is required if you are * adding a new rule.

*/ inline void SetConfigRuleName(const Aws::String& value) { m_configRuleNameHasBeenSet = true; m_configRuleName = value; } /** *

The name that you assign to the Config rule. The name is required if you are * adding a new rule.

*/ inline void SetConfigRuleName(Aws::String&& value) { m_configRuleNameHasBeenSet = true; m_configRuleName = std::move(value); } /** *

The name that you assign to the Config rule. The name is required if you are * adding a new rule.

*/ inline void SetConfigRuleName(const char* value) { m_configRuleNameHasBeenSet = true; m_configRuleName.assign(value); } /** *

The name that you assign to the Config rule. The name is required if you are * adding a new rule.

*/ inline ConfigRule& WithConfigRuleName(const Aws::String& value) { SetConfigRuleName(value); return *this;} /** *

The name that you assign to the Config rule. The name is required if you are * adding a new rule.

*/ inline ConfigRule& WithConfigRuleName(Aws::String&& value) { SetConfigRuleName(std::move(value)); return *this;} /** *

The name that you assign to the Config rule. The name is required if you are * adding a new rule.

*/ inline ConfigRule& WithConfigRuleName(const char* value) { SetConfigRuleName(value); return *this;} /** *

The Amazon Resource Name (ARN) of the Config rule.

*/ inline const Aws::String& GetConfigRuleArn() const{ return m_configRuleArn; } /** *

The Amazon Resource Name (ARN) of the Config rule.

*/ inline bool ConfigRuleArnHasBeenSet() const { return m_configRuleArnHasBeenSet; } /** *

The Amazon Resource Name (ARN) of the Config rule.

*/ inline void SetConfigRuleArn(const Aws::String& value) { m_configRuleArnHasBeenSet = true; m_configRuleArn = value; } /** *

The Amazon Resource Name (ARN) of the Config rule.

*/ inline void SetConfigRuleArn(Aws::String&& value) { m_configRuleArnHasBeenSet = true; m_configRuleArn = std::move(value); } /** *

The Amazon Resource Name (ARN) of the Config rule.

*/ inline void SetConfigRuleArn(const char* value) { m_configRuleArnHasBeenSet = true; m_configRuleArn.assign(value); } /** *

The Amazon Resource Name (ARN) of the Config rule.

*/ inline ConfigRule& WithConfigRuleArn(const Aws::String& value) { SetConfigRuleArn(value); return *this;} /** *

The Amazon Resource Name (ARN) of the Config rule.

*/ inline ConfigRule& WithConfigRuleArn(Aws::String&& value) { SetConfigRuleArn(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) of the Config rule.

*/ inline ConfigRule& WithConfigRuleArn(const char* value) { SetConfigRuleArn(value); return *this;} /** *

The ID of the Config rule.

*/ inline const Aws::String& GetConfigRuleId() const{ return m_configRuleId; } /** *

The ID of the Config rule.

*/ inline bool ConfigRuleIdHasBeenSet() const { return m_configRuleIdHasBeenSet; } /** *

The ID of the Config rule.

*/ inline void SetConfigRuleId(const Aws::String& value) { m_configRuleIdHasBeenSet = true; m_configRuleId = value; } /** *

The ID of the Config rule.

*/ inline void SetConfigRuleId(Aws::String&& value) { m_configRuleIdHasBeenSet = true; m_configRuleId = std::move(value); } /** *

The ID of the Config rule.

*/ inline void SetConfigRuleId(const char* value) { m_configRuleIdHasBeenSet = true; m_configRuleId.assign(value); } /** *

The ID of the Config rule.

*/ inline ConfigRule& WithConfigRuleId(const Aws::String& value) { SetConfigRuleId(value); return *this;} /** *

The ID of the Config rule.

*/ inline ConfigRule& WithConfigRuleId(Aws::String&& value) { SetConfigRuleId(std::move(value)); return *this;} /** *

The ID of the Config rule.

*/ inline ConfigRule& WithConfigRuleId(const char* value) { SetConfigRuleId(value); return *this;} /** *

The description that you provide for the Config rule.

*/ inline const Aws::String& GetDescription() const{ return m_description; } /** *

The description that you provide for the Config rule.

*/ inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; } /** *

The description that you provide for the Config rule.

*/ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** *

The description that you provide for the Config rule.

*/ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** *

The description that you provide for the Config rule.

*/ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** *

The description that you provide for the Config rule.

*/ inline ConfigRule& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** *

The description that you provide for the Config rule.

*/ inline ConfigRule& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** *

The description that you provide for the Config rule.

*/ inline ConfigRule& WithDescription(const char* value) { SetDescription(value); return *this;} /** *

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.

*/ inline const Scope& GetScope() const{ return m_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.

*/ inline bool ScopeHasBeenSet() const { return m_scopeHasBeenSet; } /** *

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.

*/ inline void SetScope(const Scope& value) { m_scopeHasBeenSet = true; m_scope = value; } /** *

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.

*/ inline void SetScope(Scope&& value) { m_scopeHasBeenSet = true; m_scope = std::move(value); } /** *

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.

*/ inline ConfigRule& WithScope(const Scope& value) { SetScope(value); return *this;} /** *

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.

*/ inline ConfigRule& WithScope(Scope&& value) { SetScope(std::move(value)); return *this;} /** *

Provides the rule owner (Amazon Web Services or customer), the rule * identifier, and the notifications that cause the function to evaluate your * Amazon Web Services resources.

*/ inline const Source& GetSource() const{ return m_source; } /** *

Provides the rule owner (Amazon Web Services or customer), the rule * identifier, and the notifications that cause the function to evaluate your * Amazon Web Services resources.

*/ inline bool SourceHasBeenSet() const { return m_sourceHasBeenSet; } /** *

Provides the rule owner (Amazon Web Services or customer), the rule * identifier, and the notifications that cause the function to evaluate your * Amazon Web Services resources.

*/ inline void SetSource(const Source& value) { m_sourceHasBeenSet = true; m_source = value; } /** *

Provides the rule owner (Amazon Web Services or customer), the rule * identifier, and the notifications that cause the function to evaluate your * Amazon Web Services resources.

*/ inline void SetSource(Source&& value) { m_sourceHasBeenSet = true; m_source = std::move(value); } /** *

Provides the rule owner (Amazon Web Services or customer), the rule * identifier, and the notifications that cause the function to evaluate your * Amazon Web Services resources.

*/ inline ConfigRule& WithSource(const Source& value) { SetSource(value); return *this;} /** *

Provides the rule owner (Amazon Web Services or customer), the rule * identifier, and the notifications that cause the function to evaluate your * Amazon Web Services resources.

*/ inline ConfigRule& WithSource(Source&& value) { SetSource(std::move(value)); return *this;} /** *

A string, in JSON format, that is passed to the Config rule Lambda * function.

*/ inline const Aws::String& GetInputParameters() const{ return m_inputParameters; } /** *

A string, in JSON format, that is passed to the Config rule Lambda * function.

*/ inline bool InputParametersHasBeenSet() const { return m_inputParametersHasBeenSet; } /** *

A string, in JSON format, that is passed to the Config rule Lambda * function.

*/ inline void SetInputParameters(const Aws::String& value) { m_inputParametersHasBeenSet = true; m_inputParameters = value; } /** *

A string, in JSON format, that is passed to the Config rule Lambda * function.

*/ inline void SetInputParameters(Aws::String&& value) { m_inputParametersHasBeenSet = true; m_inputParameters = std::move(value); } /** *

A string, in JSON format, that is passed to the Config rule Lambda * function.

*/ inline void SetInputParameters(const char* value) { m_inputParametersHasBeenSet = true; m_inputParameters.assign(value); } /** *

A string, in JSON format, that is passed to the Config rule Lambda * function.

*/ inline ConfigRule& WithInputParameters(const Aws::String& value) { SetInputParameters(value); return *this;} /** *

A string, in JSON format, that is passed to the Config rule Lambda * function.

*/ inline ConfigRule& WithInputParameters(Aws::String&& value) { SetInputParameters(std::move(value)); return *this;} /** *

A string, in JSON format, that is passed to the Config rule Lambda * function.

*/ inline ConfigRule& WithInputParameters(const char* value) { SetInputParameters(value); return *this;} /** *

The maximum frequency with which Config runs evaluations for a rule. You can * specify a value for MaximumExecutionFrequency when:

  • *

    You are using 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.

*/ inline const MaximumExecutionFrequency& GetMaximumExecutionFrequency() const{ return m_maximumExecutionFrequency; } /** *

The maximum frequency with which Config runs evaluations for a rule. You can * specify a value for MaximumExecutionFrequency when:

  • *

    You are using 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.

*/ inline bool MaximumExecutionFrequencyHasBeenSet() const { return m_maximumExecutionFrequencyHasBeenSet; } /** *

The maximum frequency with which Config runs evaluations for a rule. You can * specify a value for MaximumExecutionFrequency when:

  • *

    You are using 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.

*/ inline void SetMaximumExecutionFrequency(const MaximumExecutionFrequency& value) { m_maximumExecutionFrequencyHasBeenSet = true; m_maximumExecutionFrequency = value; } /** *

The maximum frequency with which Config runs evaluations for a rule. You can * specify a value for MaximumExecutionFrequency when:

  • *

    You are using 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.

*/ inline void SetMaximumExecutionFrequency(MaximumExecutionFrequency&& value) { m_maximumExecutionFrequencyHasBeenSet = true; m_maximumExecutionFrequency = std::move(value); } /** *

The maximum frequency with which Config runs evaluations for a rule. You can * specify a value for MaximumExecutionFrequency when:

  • *

    You are using 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.

*/ inline ConfigRule& WithMaximumExecutionFrequency(const MaximumExecutionFrequency& value) { SetMaximumExecutionFrequency(value); return *this;} /** *

The maximum frequency with which Config runs evaluations for a rule. You can * specify a value for MaximumExecutionFrequency when:

  • *

    You are using 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.

*/ inline ConfigRule& WithMaximumExecutionFrequency(MaximumExecutionFrequency&& value) { SetMaximumExecutionFrequency(std::move(value)); return *this;} /** *

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.

*/ inline const ConfigRuleState& GetConfigRuleState() const{ return m_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.

*/ inline bool ConfigRuleStateHasBeenSet() const { return m_configRuleStateHasBeenSet; } /** *

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.

*/ inline void SetConfigRuleState(const ConfigRuleState& value) { m_configRuleStateHasBeenSet = true; m_configRuleState = value; } /** *

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.

*/ inline void SetConfigRuleState(ConfigRuleState&& value) { m_configRuleStateHasBeenSet = true; m_configRuleState = std::move(value); } /** *

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.

*/ inline ConfigRule& WithConfigRuleState(const ConfigRuleState& value) { SetConfigRuleState(value); return *this;} /** *

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.

*/ inline ConfigRule& WithConfigRuleState(ConfigRuleState&& value) { SetConfigRuleState(std::move(value)); return *this;} /** *

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.

*/ inline const Aws::String& GetCreatedBy() const{ return m_createdBy; } /** *

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.

*/ inline bool CreatedByHasBeenSet() const { return m_createdByHasBeenSet; } /** *

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.

*/ inline void SetCreatedBy(const Aws::String& value) { m_createdByHasBeenSet = true; m_createdBy = value; } /** *

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.

*/ inline void SetCreatedBy(Aws::String&& value) { m_createdByHasBeenSet = true; m_createdBy = std::move(value); } /** *

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.

*/ inline void SetCreatedBy(const char* value) { m_createdByHasBeenSet = true; m_createdBy.assign(value); } /** *

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.

*/ inline ConfigRule& WithCreatedBy(const Aws::String& value) { SetCreatedBy(value); return *this;} /** *

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.

*/ inline ConfigRule& WithCreatedBy(Aws::String&& value) { SetCreatedBy(std::move(value)); return *this;} /** *

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.

*/ inline ConfigRule& WithCreatedBy(const char* value) { SetCreatedBy(value); return *this;} private: Aws::String m_configRuleName; bool m_configRuleNameHasBeenSet; Aws::String m_configRuleArn; bool m_configRuleArnHasBeenSet; Aws::String m_configRuleId; bool m_configRuleIdHasBeenSet; Aws::String m_description; bool m_descriptionHasBeenSet; Scope m_scope; bool m_scopeHasBeenSet; Source m_source; bool m_sourceHasBeenSet; Aws::String m_inputParameters; bool m_inputParametersHasBeenSet; MaximumExecutionFrequency m_maximumExecutionFrequency; bool m_maximumExecutionFrequencyHasBeenSet; ConfigRuleState m_configRuleState; bool m_configRuleStateHasBeenSet; Aws::String m_createdBy; bool m_createdByHasBeenSet; }; } // namespace Model } // namespace ConfigService } // namespace Aws