/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.config.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* 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. *
** The name that you assign to the Config rule. The name is required if you are adding a new rule. *
*/ private String configRuleName; /** ** The Amazon Resource Name (ARN) of the Config rule. *
*/ private String configRuleArn; /** ** The ID of the Config rule. *
*/ private String configRuleId; /** ** The description that you provide for the Config rule. *
*/ private String description; /** ** 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. *
*
* 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.
*
* A string, in JSON format, that is passed to the Config rule Lambda function. *
*/ private String inputParameters; /** *
* 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.
*
* 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.
*
* 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. *
** The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the value is * Detective evaluation mode only. *
*/ private com.amazonaws.internal.SdkInternalList* The name that you assign to the Config rule. The name is required if you are adding a new rule. *
* * @param configRuleName * The name that you assign to the Config rule. The name is required if you are adding a new rule. */ public void setConfigRuleName(String configRuleName) { this.configRuleName = configRuleName; } /** ** The name that you assign to the Config rule. The name is required if you are adding a new rule. *
* * @return The name that you assign to the Config rule. The name is required if you are adding a new rule. */ public String getConfigRuleName() { return this.configRuleName; } /** ** The name that you assign to the Config rule. The name is required if you are adding a new rule. *
* * @param configRuleName * The name that you assign to the Config rule. The name is required if you are adding a new rule. * @return Returns a reference to this object so that method calls can be chained together. */ public ConfigRule withConfigRuleName(String configRuleName) { setConfigRuleName(configRuleName); return this; } /** ** The Amazon Resource Name (ARN) of the Config rule. *
* * @param configRuleArn * The Amazon Resource Name (ARN) of the Config rule. */ public void setConfigRuleArn(String configRuleArn) { this.configRuleArn = configRuleArn; } /** ** The Amazon Resource Name (ARN) of the Config rule. *
* * @return The Amazon Resource Name (ARN) of the Config rule. */ public String getConfigRuleArn() { return this.configRuleArn; } /** ** The Amazon Resource Name (ARN) of the Config rule. *
* * @param configRuleArn * The Amazon Resource Name (ARN) of the Config rule. * @return Returns a reference to this object so that method calls can be chained together. */ public ConfigRule withConfigRuleArn(String configRuleArn) { setConfigRuleArn(configRuleArn); return this; } /** ** The ID of the Config rule. *
* * @param configRuleId * The ID of the Config rule. */ public void setConfigRuleId(String configRuleId) { this.configRuleId = configRuleId; } /** ** The ID of the Config rule. *
* * @return The ID of the Config rule. */ public String getConfigRuleId() { return this.configRuleId; } /** ** The ID of the Config rule. *
* * @param configRuleId * The ID of the Config rule. * @return Returns a reference to this object so that method calls can be chained together. */ public ConfigRule withConfigRuleId(String configRuleId) { setConfigRuleId(configRuleId); return this; } /** ** The description that you provide for the Config rule. *
* * @param description * The description that you provide for the Config rule. */ public void setDescription(String description) { this.description = description; } /** ** The description that you provide for the Config rule. *
* * @return The description that you provide for the Config rule. */ public String getDescription() { return this.description; } /** ** The description that you provide for the Config rule. *
* * @param description * The description that you provide for the Config rule. * @return Returns a reference to this object so that method calls can be chained together. */ public ConfigRule withDescription(String description) { setDescription(description); 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. *
** The scope can be empty. *
*/ public void setScope(Scope scope) { this.scope = 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. *
** The scope can be empty. *
*/ public Scope getScope() { return this.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. *
** The scope can be empty. *
* @return Returns a reference to this object so that method calls can be chained together. */ public ConfigRule withScope(Scope scope) { setScope(scope); return this; } /** *
* 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.
*
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.
*/
public void setSource(Source source) {
this.source = 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.
*
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.
*/
public Source getSource() {
return this.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.
*
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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ConfigRule withSource(Source source) {
setSource(source);
return this;
}
/**
* * A string, in JSON format, that is passed to the Config rule Lambda function. *
* * @param inputParameters * A string, in JSON format, that is passed to the Config rule Lambda function. */ public void setInputParameters(String inputParameters) { this.inputParameters = inputParameters; } /** ** A string, in JSON format, that is passed to the Config rule Lambda function. *
* * @return A string, in JSON format, that is passed to the Config rule Lambda function. */ public String getInputParameters() { return this.inputParameters; } /** ** A string, in JSON format, that is passed to the Config rule Lambda function. *
* * @param inputParameters * A string, in JSON format, that is passed to the Config rule Lambda function. * @return Returns a reference to this object so that method calls can be chained together. */ public ConfigRule withInputParameters(String inputParameters) { setInputParameters(inputParameters); return this; } /** *
* 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.
*
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.
*
* 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.
*
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.
*
* 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.
*
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.
*
* 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.
*
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.
*
* 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.
*
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.
*
* 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.
*
* 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.
* @see ConfigRuleState
*/
public void setConfigRuleState(String configRuleState) {
this.configRuleState = 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.
*
* 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.
* @see ConfigRuleState
*/
public String getConfigRuleState() {
return this.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.
*
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConfigRuleState
*/
public ConfigRule withConfigRuleState(String configRuleState) {
setConfigRuleState(configRuleState);
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.
*
* 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.
* @see ConfigRuleState
*/
public void setConfigRuleState(ConfigRuleState configRuleState) {
withConfigRuleState(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.
*
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ConfigRuleState
*/
public ConfigRule withConfigRuleState(ConfigRuleState configRuleState) {
this.configRuleState = configRuleState.toString();
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. *
** 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. *
*/ public void setCreatedBy(String createdBy) { this.createdBy = 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. *
** 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. *
*/ public String getCreatedBy() { return this.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. *
** 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. *
* @return Returns a reference to this object so that method calls can be chained together. */ public ConfigRule withCreatedBy(String createdBy) { setCreatedBy(createdBy); return this; } /** ** The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the value is * Detective evaluation mode only. *
* * @return The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the * value is Detective evaluation mode only. */ public java.util.List* The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the value is * Detective evaluation mode only. *
* * @param evaluationModes * The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the * value is Detective evaluation mode only. */ public void setEvaluationModes(java.util.Collection* The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the value is * Detective evaluation mode only. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setEvaluationModes(java.util.Collection)} or {@link #withEvaluationModes(java.util.Collection)} if you * want to override the existing values. *
* * @param evaluationModes * The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the * value is Detective evaluation mode only. * @return Returns a reference to this object so that method calls can be chained together. */ public ConfigRule withEvaluationModes(EvaluationModeConfiguration... evaluationModes) { if (this.evaluationModes == null) { setEvaluationModes(new com.amazonaws.internal.SdkInternalList* The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the value is * Detective evaluation mode only. *
* * @param evaluationModes * The modes the Config rule can be evaluated in. The valid values are distinct objects. By default, the * value is Detective evaluation mode only. * @return Returns a reference to this object so that method calls can be chained together. */ public ConfigRule withEvaluationModes(java.util.Collection