Class: AWSCDK::Config::CfnRemediationConfigurationProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
config/cfn_remediation_configuration_props.rb

Overview

Properties for defining a CfnRemediationConfiguration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_rule_name:, target_id:, target_type:, automatic: nil, execution_controls: nil, maximum_automatic_attempts: nil, parameters: nil, resource_type: nil, retry_attempt_seconds: nil, target_version: nil) ⇒ CfnRemediationConfigurationProps

Returns a new instance of CfnRemediationConfigurationProps.

Parameters:

  • config_rule_name (String)

    The name of the AWS Config rule.

  • target_id (String)

    Target ID is the name of the SSM document.

  • target_type (String)

    The type of the target.

  • automatic (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    The remediation is triggered automatically.

  • execution_controls (AWSCDK::IResolvable, AWSCDK::Config::CfnRemediationConfiguration::ExecutionControlsProperty, nil) (defaults to: nil)

    An ExecutionControls object.

  • maximum_automatic_attempts (Numeric, nil) (defaults to: nil)

    The maximum number of failed attempts for auto-remediation. If you do not select a number, the default is 5.

  • parameters (Object, nil) (defaults to: nil)

    An object of the RemediationParameterValue. For more information, see RemediationParameterValue .

  • resource_type (String, nil) (defaults to: nil)

    The type of a resource.

  • retry_attempt_seconds (Numeric, nil) (defaults to: nil)

    Time window to determine whether or not to add a remediation exception to prevent infinite remediation attempts.

  • target_version (String, nil) (defaults to: nil)

    Version of the target. For example, version of the SSM document.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'config/cfn_remediation_configuration_props.rb', line 19

def initialize(config_rule_name:, target_id:, target_type:, automatic: nil, execution_controls: nil, maximum_automatic_attempts: nil, parameters: nil, resource_type: nil, retry_attempt_seconds: nil, target_version: nil)
  @config_rule_name = config_rule_name
  Jsii::Type.check_type(@config_rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "configRuleName")
  @target_id = target_id
  Jsii::Type.check_type(@target_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetId")
  @target_type = target_type
  Jsii::Type.check_type(@target_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetType")
  @automatic = automatic
  Jsii::Type.check_type(@automatic, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "automatic") unless @automatic.nil?
  @execution_controls = execution_controls.is_a?(Hash) ? ::AWSCDK::Config::CfnRemediationConfiguration::ExecutionControlsProperty.new(**execution_controls.transform_keys(&:to_sym)) : execution_controls
  Jsii::Type.check_type(@execution_controls, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb25maWcuQ2ZuUmVtZWRpYXRpb25Db25maWd1cmF0aW9uLkV4ZWN1dGlvbkNvbnRyb2xzUHJvcGVydHkifV19fQ==")), "executionControls") unless @execution_controls.nil?
  @maximum_automatic_attempts = maximum_automatic_attempts
  Jsii::Type.check_type(@maximum_automatic_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maximumAutomaticAttempts") unless @maximum_automatic_attempts.nil?
  @parameters = parameters
  Jsii::Type.check_type(@parameters, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "parameters") unless @parameters.nil?
  @resource_type = resource_type
  Jsii::Type.check_type(@resource_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceType") unless @resource_type.nil?
  @retry_attempt_seconds = retry_attempt_seconds
  Jsii::Type.check_type(@retry_attempt_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retryAttemptSeconds") unless @retry_attempt_seconds.nil?
  @target_version = target_version
  Jsii::Type.check_type(@target_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetVersion") unless @target_version.nil?
end

Instance Attribute Details

#automaticBoolean, ... (readonly)

The remediation is triggered automatically.



63
64
65
# File 'config/cfn_remediation_configuration_props.rb', line 63

def automatic
  @automatic
end

#config_rule_nameString (readonly)

The name of the AWS Config rule.



46
47
48
# File 'config/cfn_remediation_configuration_props.rb', line 46

def config_rule_name
  @config_rule_name
end

#execution_controlsAWSCDK::IResolvable, ... (readonly)

An ExecutionControls object.



68
69
70
# File 'config/cfn_remediation_configuration_props.rb', line 68

def execution_controls
  @execution_controls
end

#maximum_automatic_attemptsNumeric? (readonly)

The maximum number of failed attempts for auto-remediation. If you do not select a number, the default is 5.

For example, if you specify MaximumAutomaticAttempts as 5 with RetryAttemptSeconds as 50 seconds, AWS Config will put a RemediationException on your behalf for the failing resource after the 5th failed attempt within 50 seconds.



75
76
77
# File 'config/cfn_remediation_configuration_props.rb', line 75

def maximum_automatic_attempts
  @maximum_automatic_attempts
end

#parametersObject? (readonly)

An object of the RemediationParameterValue. For more information, see RemediationParameterValue .

The type is a map of strings to RemediationParameterValue.



82
83
84
# File 'config/cfn_remediation_configuration_props.rb', line 82

def parameters
  @parameters
end

#resource_typeString? (readonly)

The type of a resource.



87
88
89
# File 'config/cfn_remediation_configuration_props.rb', line 87

def resource_type
  @resource_type
end

#retry_attempt_secondsNumeric? (readonly)

Time window to determine whether or not to add a remediation exception to prevent infinite remediation attempts.

If MaximumAutomaticAttempts remediation attempts have been made under RetryAttemptSeconds , a remediation exception will be added to the resource. If you do not select a number, the default is 60 seconds.

For example, if you specify RetryAttemptSeconds as 50 seconds and MaximumAutomaticAttempts as 5, AWS Config will run auto-remediations 5 times within 50 seconds before adding a remediation exception to the resource.



96
97
98
# File 'config/cfn_remediation_configuration_props.rb', line 96

def retry_attempt_seconds
  @retry_attempt_seconds
end

#target_idString (readonly)

Target ID is the name of the SSM document.



51
52
53
# File 'config/cfn_remediation_configuration_props.rb', line 51

def target_id
  @target_id
end

#target_typeString (readonly)

The type of the target.

Target executes remediation. For example, SSM document.



58
59
60
# File 'config/cfn_remediation_configuration_props.rb', line 58

def target_type
  @target_type
end

#target_versionString? (readonly)

Version of the target. For example, version of the SSM document.

If you make backward incompatible changes to the SSM document, you must call PutRemediationConfiguration API again to ensure the remediations can run.



103
104
105
# File 'config/cfn_remediation_configuration_props.rb', line 103

def target_version
  @target_version
end

Class Method Details

.jsii_propertiesObject



105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'config/cfn_remediation_configuration_props.rb', line 105

def self.jsii_properties
  {
    :config_rule_name => "configRuleName",
    :target_id => "targetId",
    :target_type => "targetType",
    :automatic => "automatic",
    :execution_controls => "executionControls",
    :maximum_automatic_attempts => "maximumAutomaticAttempts",
    :parameters => "parameters",
    :resource_type => "resourceType",
    :retry_attempt_seconds => "retryAttemptSeconds",
    :target_version => "targetVersion",
  }
end

Instance Method Details

#to_jsiiObject



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'config/cfn_remediation_configuration_props.rb', line 120

def to_jsii
  result = {}
  result.merge!({
    "configRuleName" => @config_rule_name,
    "targetId" => @target_id,
    "targetType" => @target_type,
    "automatic" => @automatic,
    "executionControls" => @execution_controls,
    "maximumAutomaticAttempts" => @maximum_automatic_attempts,
    "parameters" => @parameters,
    "resourceType" => @resource_type,
    "retryAttemptSeconds" => @retry_attempt_seconds,
    "targetVersion" => @target_version,
  })
  result.compact
end