Class: AWSCDK::Config::CloudFormationStackDriftDetectionCheckProps

Inherits:
RuleProps
  • Object
show all
Defined in:
config/cloud_formation_stack_drift_detection_check_props.rb

Overview

Construction properties for a CloudFormationStackDriftDetectionCheck.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_rule_name: nil, description: nil, evaluation_modes: nil, input_parameters: nil, maximum_execution_frequency: nil, rule_scope: nil, own_stack_only: nil, role: nil) ⇒ CloudFormationStackDriftDetectionCheckProps

Returns a new instance of CloudFormationStackDriftDetectionCheckProps.

Parameters:

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

    A name for the AWS Config rule.

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

    A description about this AWS Config rule.

  • evaluation_modes (AWSCDK::Config::EvaluationMode, nil) (defaults to: nil)

    The modes the AWS Config rule can be evaluated in.

  • input_parameters (Hash{String => Object}, nil) (defaults to: nil)

    Input parameter values that are passed to the AWS Config rule.

  • maximum_execution_frequency (AWSCDK::Config::MaximumExecutionFrequency, nil) (defaults to: nil)

    The maximum frequency at which the AWS Config rule runs evaluations.

  • rule_scope (AWSCDK::Config::RuleScope, nil) (defaults to: nil)

    Defines which resources trigger an evaluation for an AWS Config rule.

  • own_stack_only (Boolean, nil) (defaults to: nil)

    Whether to check only the stack where this rule is deployed.

  • role (AWSCDK::Interfaces::AWSIAM::IRoleRef, nil) (defaults to: nil)

    The IAM role to use for this rule.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 15

def initialize(config_rule_name: nil, description: nil, evaluation_modes: nil, input_parameters: nil, maximum_execution_frequency: nil, rule_scope: nil, own_stack_only: nil, role: nil)
  @config_rule_name = config_rule_name
  Jsii::Type.check_type(@config_rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "configRuleName") unless @config_rule_name.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @evaluation_modes = evaluation_modes
  Jsii::Type.check_type(@evaluation_modes, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29uZmlnLkV2YWx1YXRpb25Nb2RlIn0=")), "evaluationModes") unless @evaluation_modes.nil?
  @input_parameters = input_parameters
  Jsii::Type.check_type(@input_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "inputParameters") unless @input_parameters.nil?
  @maximum_execution_frequency = maximum_execution_frequency
  Jsii::Type.check_type(@maximum_execution_frequency, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29uZmlnLk1heGltdW1FeGVjdXRpb25GcmVxdWVuY3kifQ==")), "maximumExecutionFrequency") unless @maximum_execution_frequency.nil?
  @rule_scope = rule_scope
  Jsii::Type.check_type(@rule_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29uZmlnLlJ1bGVTY29wZSJ9")), "ruleScope") unless @rule_scope.nil?
  @own_stack_only = own_stack_only
  Jsii::Type.check_type(@own_stack_only, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "ownStackOnly") unless @own_stack_only.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19pYW0uSVJvbGVSZWYifQ==")), "role") unless @role.nil?
end

Instance Attribute Details

#config_rule_nameString? (readonly)

Note:

Default: - CloudFormation generated name

A name for the AWS Config rule.

Returns:

  • (String, nil)


38
39
40
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 38

def config_rule_name
  @config_rule_name
end

#descriptionString? (readonly)

Note:

Default: - No description

A description about this AWS Config rule.

Returns:

  • (String, nil)


43
44
45
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 43

def description
  @description
end

#evaluation_modesAWSCDK::Config::EvaluationMode? (readonly)

Note:

Default: - Detective evaluation mode only

The modes the AWS Config rule can be evaluated in.

The valid values are distinct objects.



50
51
52
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 50

def evaluation_modes
  @evaluation_modes
end

#input_parametersHash{String => Object}? (readonly)

Note:

Default: - No input parameters

Input parameter values that are passed to the AWS Config rule.

Returns:

  • (Hash{String => Object}, nil)


55
56
57
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 55

def input_parameters
  @input_parameters
end

#maximum_execution_frequencyAWSCDK::Config::MaximumExecutionFrequency? (readonly)

Note:

Default: MaximumExecutionFrequency.TWENTY_FOUR_HOURS

The maximum frequency at which the AWS Config rule runs evaluations.



60
61
62
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 60

def maximum_execution_frequency
  @maximum_execution_frequency
end

#own_stack_onlyBoolean? (readonly)

Note:

Default: false

Whether to check only the stack where this rule is deployed.

Returns:

  • (Boolean, nil)


70
71
72
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 70

def own_stack_only
  @own_stack_only
end

#roleAWSCDK::Interfaces::AWSIAM::IRoleRef? (readonly)

Note:

Default: - A role will be created

The IAM role to use for this rule.

It must have permissions to detect drift for AWS CloudFormation stacks. Ensure to attach config.amazonaws.com trusted permissions and ReadOnlyAccess policy permissions. For specific policy permissions, refer to https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift.html.



80
81
82
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 80

def role
  @role
end

#rule_scopeAWSCDK::Config::RuleScope? (readonly)

Note:

Default: - evaluations for the rule are triggered when any resource in the recording group changes.

Defines which resources trigger an evaluation for an AWS Config rule.

Returns:



65
66
67
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 65

def rule_scope
  @rule_scope
end

Class Method Details

.jsii_propertiesObject



82
83
84
85
86
87
88
89
90
91
92
93
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 82

def self.jsii_properties
  {
    :config_rule_name => "configRuleName",
    :description => "description",
    :evaluation_modes => "evaluationModes",
    :input_parameters => "inputParameters",
    :maximum_execution_frequency => "maximumExecutionFrequency",
    :rule_scope => "ruleScope",
    :own_stack_only => "ownStackOnly",
    :role => "role",
  }
end

Instance Method Details

#to_jsiiObject



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'config/cloud_formation_stack_drift_detection_check_props.rb', line 95

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "configRuleName" => @config_rule_name,
    "description" => @description,
    "evaluationModes" => @evaluation_modes,
    "inputParameters" => @input_parameters,
    "maximumExecutionFrequency" => @maximum_execution_frequency,
    "ruleScope" => @rule_scope,
    "ownStackOnly" => @own_stack_only,
    "role" => @role,
  })
  result.compact
end