Class: Aws::ConfigService::Types::ConfigRule

Inherits:
Struct
  • Object
show all
Defined in:
gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb

Overview

Note:

When making an API call, you may pass ConfigRule data as a hash:

{
  config_rule_name: "ConfigRuleName",
  config_rule_arn: "StringWithCharLimit256",
  config_rule_id: "StringWithCharLimit64",
  description: "EmptiableStringWithCharLimit256",
  scope: {
    compliance_resource_types: ["StringWithCharLimit256"],
    tag_key: "StringWithCharLimit128",
    tag_value: "StringWithCharLimit256",
    compliance_resource_id: "BaseResourceId",
  },
  source: { # required
    owner: "CUSTOM_LAMBDA", # required, accepts CUSTOM_LAMBDA, AWS, CUSTOM_POLICY
    source_identifier: "StringWithCharLimit256",
    source_details: [
      {
        event_source: "aws.config", # accepts aws.config
        message_type: "ConfigurationItemChangeNotification", # accepts ConfigurationItemChangeNotification, ConfigurationSnapshotDeliveryCompleted, ScheduledNotification, OversizedConfigurationItemChangeNotification
        maximum_execution_frequency: "One_Hour", # accepts One_Hour, Three_Hours, Six_Hours, Twelve_Hours, TwentyFour_Hours
      },
    ],
    custom_policy_details: {
      policy_runtime: "PolicyRuntime", # required
      policy_text: "PolicyText", # required
      enable_debug_log_delivery: false,
    },
  },
  input_parameters: "StringWithCharLimit1024",
  maximum_execution_frequency: "One_Hour", # accepts One_Hour, Three_Hours, Six_Hours, Twelve_Hours, TwentyFour_Hours
  config_rule_state: "ACTIVE", # accepts ACTIVE, DELETING, DELETING_RESULTS, EVALUATING
  created_by: "StringWithCharLimit256",
}

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. Managed rules are predefined, customizable rules created by Config. For a list of managed rules, see List of Config Managed Rules.

Custom rules are rules that you can create using either Guard or Lambda functions. Guard (Guard GitHub Repository) is a policy-as-code language that allows you to write policies that are enforced by Config Custom Policy rules. Lambda uses custom code that you upload to evaluate a custom rule. It is invoked by events that are published to it by an event source, which Config invokes when the custom rule is initiated.

For more information about developing and using Config rules, see Evaluating Amazon Web Services resource Configurations with Config 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.

Constant Summary collapse

SENSITIVE =
[]

Instance Attribute Summary collapse

Instance Attribute Details

#config_rule_arnString

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

Returns:

  • (String)


1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb', line 1041

class ConfigRule < Struct.new(
  :config_rule_name,
  :config_rule_arn,
  :config_rule_id,
  :description,
  :scope,
  :source,
  :input_parameters,
  :maximum_execution_frequency,
  :config_rule_state,
  :created_by)
  SENSITIVE = []
  include Aws::Structure
end

#config_rule_idString

The ID of the Config rule.

Returns:

  • (String)


1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb', line 1041

class ConfigRule < Struct.new(
  :config_rule_name,
  :config_rule_arn,
  :config_rule_id,
  :description,
  :scope,
  :source,
  :input_parameters,
  :maximum_execution_frequency,
  :config_rule_state,
  :created_by)
  SENSITIVE = []
  include Aws::Structure
end

#config_rule_nameString

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

Returns:

  • (String)


1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb', line 1041

class ConfigRule < Struct.new(
  :config_rule_name,
  :config_rule_arn,
  :config_rule_id,
  :description,
  :scope,
  :source,
  :input_parameters,
  :maximum_execution_frequency,
  :config_rule_state,
  :created_by)
  SENSITIVE = []
  include Aws::Structure
end

#config_rule_stateString

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.

Returns:

  • (String)


1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb', line 1041

class ConfigRule < Struct.new(
  :config_rule_name,
  :config_rule_arn,
  :config_rule_id,
  :description,
  :scope,
  :source,
  :input_parameters,
  :maximum_execution_frequency,
  :config_rule_state,
  :created_by)
  SENSITIVE = []
  include Aws::Structure
end

#created_byString

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.

Returns:

  • (String)


1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb', line 1041

class ConfigRule < Struct.new(
  :config_rule_name,
  :config_rule_arn,
  :config_rule_id,
  :description,
  :scope,
  :source,
  :input_parameters,
  :maximum_execution_frequency,
  :config_rule_state,
  :created_by)
  SENSITIVE = []
  include Aws::Structure
end

#descriptionString

The description that you provide for the Config rule.

Returns:

  • (String)


1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb', line 1041

class ConfigRule < Struct.new(
  :config_rule_name,
  :config_rule_arn,
  :config_rule_id,
  :description,
  :scope,
  :source,
  :input_parameters,
  :maximum_execution_frequency,
  :config_rule_state,
  :created_by)
  SENSITIVE = []
  include Aws::Structure
end

#input_parametersString

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

Returns:

  • (String)


1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb', line 1041

class ConfigRule < Struct.new(
  :config_rule_name,
  :config_rule_arn,
  :config_rule_id,
  :description,
  :scope,
  :source,
  :input_parameters,
  :maximum_execution_frequency,
  :config_rule_state,
  :created_by)
  SENSITIVE = []
  include Aws::Structure
end

#maximum_execution_frequencyString

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.

Returns:

  • (String)


1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb', line 1041

class ConfigRule < Struct.new(
  :config_rule_name,
  :config_rule_arn,
  :config_rule_id,
  :description,
  :scope,
  :source,
  :input_parameters,
  :maximum_execution_frequency,
  :config_rule_state,
  :created_by)
  SENSITIVE = []
  include Aws::Structure
end

#scopeTypes::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.

Returns:



1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb', line 1041

class ConfigRule < Struct.new(
  :config_rule_name,
  :config_rule_arn,
  :config_rule_id,
  :description,
  :scope,
  :source,
  :input_parameters,
  :maximum_execution_frequency,
  :config_rule_state,
  :created_by)
  SENSITIVE = []
  include Aws::Structure
end

#sourceTypes::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.

Returns:



1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
# File 'gems/aws-sdk-configservice/lib/aws-sdk-configservice/types.rb', line 1041

class ConfigRule < Struct.new(
  :config_rule_name,
  :config_rule_arn,
  :config_rule_id,
  :description,
  :scope,
  :source,
  :input_parameters,
  :maximum_execution_frequency,
  :config_rule_state,
  :created_by)
  SENSITIVE = []
  include Aws::Structure
end