CfnOrganizationConfigRulePropsMixin
- class aws_cdk.mixins_preview.aws_config.mixins.CfnOrganizationConfigRulePropsMixin(props, *, strategy=None)
Bases:
MixinAdds or updates an AWS Config rule for your entire organization to evaluate if your AWS resources comply with your desired configurations.
For information on how many organization AWS Config rules you can have per account, see *Service Limits* in the AWS Config Developer Guide .
Only a management account and a delegated administrator can create or update an organization AWS Config rule. When calling the
OrganizationConfigRuleresource with a delegated administrator, you must ensure AWS OrganizationsListDelegatedAdministratorpermissions are added. An organization can have up to 3 delegated administrators.The
OrganizationConfigRuleresource enables organization service access through theEnableAWSServiceAccessaction and creates a service-linked roleAWSServiceRoleForConfigMultiAccountSetupin the management or delegated administrator account of your organization. The service-linked role is created only when the role does not exist in the caller account. AWS Config verifies the existence of role withGetRoleaction.To use the
OrganizationConfigRuleresource with delegated administrator, register a delegated administrator by calling AWS Organizationregister-delegated-administratorforconfig-multiaccountsetup.amazonaws.com.rproxy.govskope.ca.There are two types of rules: AWS Config Managed Rules and AWS Config Custom Rules . You can use
PutOrganizationConfigRuleto create both AWS Config Managed Rules and AWS Config Custom Rules.AWS Config Managed Rules are predefined, customizable rules created by AWS Config . For a list of managed rules, see List of AWS Config Managed Rules . If you are adding an AWS Config managed rule, you must specify the rule’s identifier for the
RuleIdentifierkey.AWS Config Custom Rules are rules that you create from scratch. There are two ways to create AWS Config custom rules: with Lambda functions ( AWS Lambda Developer Guide ) and with Guard ( Guard GitHub Repository ), a policy-as-code language. AWS Config custom rules created with AWS Lambda are called AWS Config Custom Lambda Rules and AWS Config custom rules created with Guard are called AWS Config Custom Policy Rules .
If you are adding a new AWS Config Custom Lambda rule, you first need to create an AWS Lambda function in the management account or a delegated administrator that the rule invokes to evaluate your resources. You also need to create an IAM role in the managed account that can be assumed by the Lambda function. When you use
PutOrganizationConfigRuleto add a Custom Lambda rule to AWS Config , you must specify the Amazon Resource Name (ARN) that AWS Lambda assigns to the function.- See:
- CloudformationResource:
AWS::Config::OrganizationConfigRule
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_config import mixins as config_mixins cfn_organization_config_rule_props_mixin = config_mixins.CfnOrganizationConfigRulePropsMixin(config_mixins.CfnOrganizationConfigRuleMixinProps( excluded_accounts=["excludedAccounts"], organization_config_rule_name="organizationConfigRuleName", organization_custom_policy_rule_metadata=config_mixins.CfnOrganizationConfigRulePropsMixin.OrganizationCustomPolicyRuleMetadataProperty( debug_log_delivery_accounts=["debugLogDeliveryAccounts"], description="description", input_parameters="inputParameters", maximum_execution_frequency="maximumExecutionFrequency", organization_config_rule_trigger_types=["organizationConfigRuleTriggerTypes"], policy_text="policyText", resource_id_scope="resourceIdScope", resource_types_scope=["resourceTypesScope"], runtime="runtime", tag_key_scope="tagKeyScope", tag_value_scope="tagValueScope" ), organization_custom_rule_metadata=config_mixins.CfnOrganizationConfigRulePropsMixin.OrganizationCustomRuleMetadataProperty( description="description", input_parameters="inputParameters", lambda_function_arn="lambdaFunctionArn", maximum_execution_frequency="maximumExecutionFrequency", organization_config_rule_trigger_types=["organizationConfigRuleTriggerTypes"], resource_id_scope="resourceIdScope", resource_types_scope=["resourceTypesScope"], tag_key_scope="tagKeyScope", tag_value_scope="tagValueScope" ), organization_managed_rule_metadata=config_mixins.CfnOrganizationConfigRulePropsMixin.OrganizationManagedRuleMetadataProperty( description="description", input_parameters="inputParameters", maximum_execution_frequency="maximumExecutionFrequency", resource_id_scope="resourceIdScope", resource_types_scope=["resourceTypesScope"], rule_identifier="ruleIdentifier", tag_key_scope="tagKeyScope", tag_value_scope="tagValueScope" ) ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::Config::OrganizationConfigRule.- Parameters:
props (
Union[CfnOrganizationConfigRuleMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['excludedAccounts', 'organizationConfigRuleName', 'organizationCustomPolicyRuleMetadata', 'organizationCustomRuleMetadata', 'organizationManagedRuleMetadata']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
OrganizationCustomPolicyRuleMetadataProperty
- class CfnOrganizationConfigRulePropsMixin.OrganizationCustomPolicyRuleMetadataProperty(*, debug_log_delivery_accounts=None, description=None, input_parameters=None, maximum_execution_frequency=None, organization_config_rule_trigger_types=None, policy_text=None, resource_id_scope=None, resource_types_scope=None, runtime=None, tag_key_scope=None, tag_value_scope=None)
Bases:
objectAn object that specifies metadata for your organization’s AWS Config Custom Policy rule.
The metadata includes the runtime system in use, which accounts have debug logging enabled, and other custom rule metadata, such as resource type, resource ID of AWS resource, and organization trigger types that initiate AWS Config to evaluate AWS resources against a rule.
- Parameters:
debug_log_delivery_accounts (
Optional[Sequence[str]]) – A list of accounts that you can enable debug logging for your organization AWS Config Custom Policy rule. List is null when debug logging is enabled for all accounts.description (
Optional[str]) – The description that you provide for your organization AWS Config Custom Policy rule.input_parameters (
Optional[str]) – A string, in JSON format, that is passed to your organization AWS Config Custom Policy rule.maximum_execution_frequency (
Optional[str]) – The maximum frequency with which AWS Config runs evaluations for a rule. Your AWS Config Custom Policy rule is triggered when AWS Config delivers the configuration snapshot. For more information, seeConfigSnapshotDeliveryProperties.organization_config_rule_trigger_types (
Optional[Sequence[str]]) – The type of notification that initiates AWS Config to run an evaluation for a rule. For AWS Config Custom Policy rules, AWS Config supports change-initiated notification types: -ConfigurationItemChangeNotification- Initiates an evaluation when AWS Config delivers a configuration item as a result of a resource change. -OversizedConfigurationItemChangeNotification- Initiates an evaluation when AWS Config delivers an oversized configuration item. AWS Config may generate this notification type when a resource changes and the notification exceeds the maximum size allowed by Amazon SNS.policy_text (
Optional[str]) – The policy definition containing the logic for your organization AWS Config Custom Policy rule.resource_id_scope (
Optional[str]) – The ID of the AWS resource that was evaluated.resource_types_scope (
Optional[Sequence[str]]) – The type of the AWS resource that was evaluated.runtime (
Optional[str]) –The runtime system for your organization AWS Config Custom Policy rules. Guard is a policy-as-code language that allows you to write policies that are enforced by AWS Config Custom Policy rules. For more information about Guard, see the Guard GitHub Repository .
tag_key_scope (
Optional[str]) – One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.tag_value_scope (
Optional[str]) – The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_config import mixins as config_mixins organization_custom_policy_rule_metadata_property = config_mixins.CfnOrganizationConfigRulePropsMixin.OrganizationCustomPolicyRuleMetadataProperty( debug_log_delivery_accounts=["debugLogDeliveryAccounts"], description="description", input_parameters="inputParameters", maximum_execution_frequency="maximumExecutionFrequency", organization_config_rule_trigger_types=["organizationConfigRuleTriggerTypes"], policy_text="policyText", resource_id_scope="resourceIdScope", resource_types_scope=["resourceTypesScope"], runtime="runtime", tag_key_scope="tagKeyScope", tag_value_scope="tagValueScope" )
Attributes
- debug_log_delivery_accounts
A list of accounts that you can enable debug logging for your organization AWS Config Custom Policy rule.
List is null when debug logging is enabled for all accounts.
- description
The description that you provide for your organization AWS Config Custom Policy rule.
- input_parameters
A string, in JSON format, that is passed to your organization AWS Config Custom Policy rule.
- maximum_execution_frequency
The maximum frequency with which AWS Config runs evaluations for a rule.
Your AWS Config Custom Policy rule is triggered when AWS Config delivers the configuration snapshot. For more information, see
ConfigSnapshotDeliveryProperties.
- organization_config_rule_trigger_types
The type of notification that initiates AWS Config to run an evaluation for a rule.
For AWS Config Custom Policy rules, AWS Config supports change-initiated notification types:
ConfigurationItemChangeNotification- Initiates an evaluation when AWS Config delivers a configuration item as a result of a resource change.OversizedConfigurationItemChangeNotification- Initiates an evaluation when AWS Config delivers an oversized configuration item. AWS Config may generate this notification type when a resource changes and the notification exceeds the maximum size allowed by Amazon SNS.
- policy_text
The policy definition containing the logic for your organization AWS Config Custom Policy rule.
- resource_id_scope
The ID of the AWS resource that was evaluated.
- resource_types_scope
The type of the AWS resource that was evaluated.
- runtime
The runtime system for your organization AWS Config Custom Policy rules.
Guard is a policy-as-code language that allows you to write policies that are enforced by AWS Config Custom Policy rules. For more information about Guard, see the Guard GitHub Repository .
- tag_key_scope
One part of a key-value pair that make up a tag.
A key is a general label that acts like a category for more specific tag values.
- tag_value_scope
The optional part of a key-value pair that make up a tag.
A value acts as a descriptor within a tag category (key).
OrganizationCustomRuleMetadataProperty
- class CfnOrganizationConfigRulePropsMixin.OrganizationCustomRuleMetadataProperty(*, description=None, input_parameters=None, lambda_function_arn=None, maximum_execution_frequency=None, organization_config_rule_trigger_types=None, resource_id_scope=None, resource_types_scope=None, tag_key_scope=None, tag_value_scope=None)
Bases:
objectAn object that specifies organization custom rule metadata such as resource type, resource ID of AWS resource, Lambda function ARN, and organization trigger types that trigger 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.
- Parameters:
description (
Optional[str]) – The description that you provide for your organization AWS Config rule.input_parameters (
Optional[str]) – A string, in JSON format, that is passed to your organization AWS Config rule Lambda function.lambda_function_arn (
Optional[str]) – The lambda function ARN.maximum_execution_frequency (
Optional[str]) – The maximum frequency with which AWS Config runs evaluations for a rule. Your custom rule is triggered when AWS Config delivers the configuration snapshot. For more information, seeConfigSnapshotDeliveryProperties. .. epigraph:: By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for theMaximumExecutionFrequencyparameter.organization_config_rule_trigger_types (
Optional[Sequence[str]]) – The type of notification that triggers AWS Config to run an evaluation for a rule. You can specify the following notification types: -ConfigurationItemChangeNotification- Triggers an evaluation when AWS Config delivers a configuration item as a result of a resource change. -OversizedConfigurationItemChangeNotification- Triggers an evaluation when AWS Config delivers an oversized configuration item. AWS Config may generate this notification type when a resource changes and the notification exceeds the maximum size allowed by Amazon SNS. -ScheduledNotification- Triggers a periodic evaluation at the frequency specified forMaximumExecutionFrequency.resource_id_scope (
Optional[str]) – The ID of the AWS resource that was evaluated.resource_types_scope (
Optional[Sequence[str]]) – The type of the AWS resource that was evaluated.tag_key_scope (
Optional[str]) – One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.tag_value_scope (
Optional[str]) – The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_config import mixins as config_mixins organization_custom_rule_metadata_property = config_mixins.CfnOrganizationConfigRulePropsMixin.OrganizationCustomRuleMetadataProperty( description="description", input_parameters="inputParameters", lambda_function_arn="lambdaFunctionArn", maximum_execution_frequency="maximumExecutionFrequency", organization_config_rule_trigger_types=["organizationConfigRuleTriggerTypes"], resource_id_scope="resourceIdScope", resource_types_scope=["resourceTypesScope"], tag_key_scope="tagKeyScope", tag_value_scope="tagValueScope" )
Attributes
- description
The description that you provide for your organization AWS Config rule.
- input_parameters
A string, in JSON format, that is passed to your organization AWS Config rule Lambda function.
- lambda_function_arn
The lambda function ARN.
- maximum_execution_frequency
The maximum frequency with which AWS Config runs evaluations for a rule.
Your custom rule is triggered when AWS Config delivers the configuration snapshot. For more information, see
ConfigSnapshotDeliveryProperties. .. epigraph:By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the ``MaximumExecutionFrequency`` parameter.
- organization_config_rule_trigger_types
The type of notification that triggers AWS Config to run an evaluation for a rule.
You can specify the following notification types:
ConfigurationItemChangeNotification- Triggers an evaluation when AWS Config delivers a configuration item as a result of a resource change.OversizedConfigurationItemChangeNotification- Triggers an evaluation when AWS Config delivers an oversized configuration item. AWS Config may generate this notification type when a resource changes and the notification exceeds the maximum size allowed by Amazon SNS.ScheduledNotification- Triggers a periodic evaluation at the frequency specified forMaximumExecutionFrequency.
- resource_id_scope
The ID of the AWS resource that was evaluated.
- resource_types_scope
The type of the AWS resource that was evaluated.
- tag_key_scope
One part of a key-value pair that make up a tag.
A key is a general label that acts like a category for more specific tag values.
- tag_value_scope
The optional part of a key-value pair that make up a tag.
A value acts as a descriptor within a tag category (key).
OrganizationManagedRuleMetadataProperty
- class CfnOrganizationConfigRulePropsMixin.OrganizationManagedRuleMetadataProperty(*, description=None, input_parameters=None, maximum_execution_frequency=None, resource_id_scope=None, resource_types_scope=None, rule_identifier=None, tag_key_scope=None, tag_value_scope=None)
Bases:
objectAn object that specifies organization managed rule metadata such as resource type and ID of AWS resource along with the rule identifier.
It also provides the frequency with which you want AWS Config to run evaluations for the rule if the trigger type is periodic.
- Parameters:
description (
Optional[str]) – The description that you provide for your organization AWS Config rule.input_parameters (
Optional[str]) – A string, in JSON format, that is passed to your organization AWS Config rule Lambda function.maximum_execution_frequency (
Optional[str]) – The maximum frequency with which AWS Config runs evaluations for a rule. This is for an AWS Config managed rule that is triggered at a periodic frequency. .. epigraph:: By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for theMaximumExecutionFrequencyparameter.resource_id_scope (
Optional[str]) – The ID of the AWS resource that was evaluated.resource_types_scope (
Optional[Sequence[str]]) – The type of the AWS resource that was evaluated.rule_identifier (
Optional[str]) – For organization config managed rules, a predefined identifier from a list. For example,IAM_PASSWORD_POLICYis a managed rule. To reference a managed rule, see Using AWS Config managed rules .tag_key_scope (
Optional[str]) – One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.tag_value_scope (
Optional[str]) – The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_config import mixins as config_mixins organization_managed_rule_metadata_property = config_mixins.CfnOrganizationConfigRulePropsMixin.OrganizationManagedRuleMetadataProperty( description="description", input_parameters="inputParameters", maximum_execution_frequency="maximumExecutionFrequency", resource_id_scope="resourceIdScope", resource_types_scope=["resourceTypesScope"], rule_identifier="ruleIdentifier", tag_key_scope="tagKeyScope", tag_value_scope="tagValueScope" )
Attributes
- description
The description that you provide for your organization AWS Config rule.
- input_parameters
A string, in JSON format, that is passed to your organization AWS Config rule Lambda function.
- maximum_execution_frequency
The maximum frequency with which AWS Config runs evaluations for a rule.
This is for an AWS Config managed rule that is triggered at a periodic frequency. .. epigraph:
By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the ``MaximumExecutionFrequency`` parameter.
- resource_id_scope
The ID of the AWS resource that was evaluated.
- resource_types_scope
The type of the AWS resource that was evaluated.
- rule_identifier
For organization config managed rules, a predefined identifier from a list.
For example,
IAM_PASSWORD_POLICYis a managed rule. To reference a managed rule, see Using AWS Config managed rules .
- tag_key_scope
One part of a key-value pair that make up a tag.
A key is a general label that acts like a category for more specific tag values.
- tag_value_scope
The optional part of a key-value pair that make up a tag.
A value acts as a descriptor within a tag category (key).