Class: AWSCDK::Config::CfnConfigRule::SourceProperty

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

Overview

Provides the CustomPolicyDetails, the rule owner ( AWS for managed rules, CUSTOM_POLICY for Custom Policy rules, and CUSTOM_LAMBDA for Custom Lambda rules), the rule identifier, and the events that cause the evaluation of your AWS resources.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner:, custom_policy_details: nil, source_details: nil, source_identifier: nil) ⇒ SourceProperty

Returns a new instance of SourceProperty.

Parameters:



914
915
916
917
918
919
920
921
922
923
# File 'config/cfn_config_rule.rb', line 914

def initialize(owner:, custom_policy_details: nil, source_details: nil, source_identifier: nil)
  @owner = owner
  Jsii::Type.check_type(@owner, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "owner")
  @custom_policy_details = custom_policy_details.is_a?(Hash) ? ::AWSCDK::Config::CfnConfigRule::CustomPolicyDetailsProperty.new(**custom_policy_details.transform_keys(&:to_sym)) : custom_policy_details
  Jsii::Type.check_type(@custom_policy_details, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb25maWcuQ2ZuQ29uZmlnUnVsZS5DdXN0b21Qb2xpY3lEZXRhaWxzUHJvcGVydHkifV19fQ==")), "customPolicyDetails") unless @custom_policy_details.nil?
  @source_details = source_details
  Jsii::Type.check_type(@source_details, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29uZmlnLkNmbkNvbmZpZ1J1bGUuU291cmNlRGV0YWlsUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "sourceDetails") unless @source_details.nil?
  @source_identifier = source_identifier
  Jsii::Type.check_type(@source_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "sourceIdentifier") unless @source_identifier.nil?
end

Instance Attribute Details

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

Provides the runtime system, policy definition, and whether debug logging is enabled.

Required when owner is set to CUSTOM_POLICY .



940
941
942
# File 'config/cfn_config_rule.rb', line 940

def custom_policy_details
  @custom_policy_details
end

#ownerString (readonly)

Indicates whether AWS or the customer owns and manages the AWS Config rule.

AWS Config Managed Rules are predefined rules owned by AWS . For more information, see AWS Config Managed Rules in the AWS Config developer guide .

AWS Config Custom Rules are rules that you can develop either with Guard ( CUSTOM_POLICY ) or AWS Lambda ( CUSTOM_LAMBDA ). For more information, see AWS Config Custom Rules in the AWS Config developer guide .



933
934
935
# File 'config/cfn_config_rule.rb', line 933

def owner
  @owner
end

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

Provides the source and the message types that cause AWS Config to evaluate your AWS resources against a rule.

It also provides the frequency with which you want AWS Config to run evaluations for the rule if the trigger type is periodic.

If the owner is set to CUSTOM_POLICY , the only acceptable values for the AWS Config rule trigger message type are ConfigurationItemChangeNotification and OversizedConfigurationItemChangeNotification .



949
950
951
# File 'config/cfn_config_rule.rb', line 949

def source_details
  @source_details
end

#source_identifierString? (readonly)

For AWS Config Managed rules, a predefined identifier from a list.

For example, IAM_PASSWORD_POLICY is a managed rule. To reference a managed rule, see List of AWS Config Managed Rules .

For AWS Config Custom Lambda rules, the identifier is the Amazon Resource Name (ARN) of the rule's AWS Lambda function, such as arn:aws:lambda:us-east-2:123456789012:function:custom_rule_name .

For AWS Config Custom Policy rules, this field will be ignored.



960
961
962
# File 'config/cfn_config_rule.rb', line 960

def source_identifier
  @source_identifier
end

Class Method Details

.jsii_propertiesObject



962
963
964
965
966
967
968
969
# File 'config/cfn_config_rule.rb', line 962

def self.jsii_properties
  {
    :owner => "owner",
    :custom_policy_details => "customPolicyDetails",
    :source_details => "sourceDetails",
    :source_identifier => "sourceIdentifier",
  }
end

Instance Method Details

#to_jsiiObject



971
972
973
974
975
976
977
978
979
980
# File 'config/cfn_config_rule.rb', line 971

def to_jsii
  result = {}
  result.merge!({
    "owner" => @owner,
    "customPolicyDetails" => @custom_policy_details,
    "sourceDetails" => @source_details,
    "sourceIdentifier" => @source_identifier,
  })
  result.compact
end