Skip to content

Rule

This class encapsulates and extends the ROS resource type ALIYUN::Config::Rule, which is used to create or modify a rule.

Initializers

import ros_cdk_config
ros_cdk_config.Rule(
  scope: Construct,
  id: str,
  config_rule_trigger_types: typing.Union[str, IResolvable],
  resource_types_scope: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]],
  risk_level: typing.Union[typing.Union[int, float], IResolvable],
  rule_name: typing.Union[str, IResolvable],
  source_identifier: typing.Union[str, IResolvable],
  source_owner: typing.Union[str, IResolvable],
  description: typing.Union[str, IResolvable] = None,
  exclude_resource_ids_scope: typing.Union[str, IResolvable] = None,
  input_parameters: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
  maximum_execution_frequency: typing.Union[str, IResolvable] = None,
  region_ids_scope: typing.Union[str, IResolvable] = None,
  resource_group_ids_scope: typing.Union[str, IResolvable] = None,
  tag_key_logic_scope: typing.Union[str, IResolvable] = None,
  tag_key_scope: typing.Union[str, IResolvable] = None,
  tag_value_scope: typing.Union[str, IResolvable] = None,
  enable_resource_property_constraint: bool = None
)
Name Type Description
scope ros_cdk_core.Construct No description.
id str No description.
config_rule_trigger_types typing.Union[str, ros_cdk_core.IResolvable] Property configRuleTriggerTypes: The trigger type of the rule.
resource_types_scope typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property resourceTypesScope: The types of the resources to be evaluated against the rule.
risk_level typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property riskLevel: The risk level of the resources that are not compliant with the rule.
rule_name typing.Union[str, ros_cdk_core.IResolvable] Property ruleName: The name of the rule.
source_identifier typing.Union[str, ros_cdk_core.IResolvable] Property sourceIdentifier: The identifier of the rule.
source_owner typing.Union[str, ros_cdk_core.IResolvable] Property sourceOwner: Specifies whether you or Alibaba Cloud owns and manages the rule.
description typing.Union[str, ros_cdk_core.IResolvable] Property description: The description of the rule.
exclude_resource_ids_scope typing.Union[str, ros_cdk_core.IResolvable] Property excludeResourceIdsScope: The rule monitors excluded resource IDs, multiple of which are separated by commas, only applies to rules created based on managed rules, , custom rule this field is empty.
input_parameters typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] Property inputParameters: The settings of the input parameters for the rule.
maximum_execution_frequency typing.Union[str, ros_cdk_core.IResolvable] Property maximumExecutionFrequency: The frequency of the compliance evaluations.
region_ids_scope typing.Union[str, ros_cdk_core.IResolvable] Property regionIdsScope: The rule monitors region IDs, separated by commas, only applies to rules created based on managed rules.
resource_group_ids_scope typing.Union[str, ros_cdk_core.IResolvable] Property resourceGroupIdsScope: The rule monitors resource group IDs, separated by commas, only applies to rules created based on managed rules.
tag_key_logic_scope typing.Union[str, ros_cdk_core.IResolvable] Property tagKeyLogicScope:.
tag_key_scope typing.Union[str, ros_cdk_core.IResolvable] Property tagKeyScope: The rule monitors the tag key, only applies to rules created based on managed rules.
tag_value_scope typing.Union[str, ros_cdk_core.IResolvable] Property tagValueScope: The rule monitors the tag value, only applies to rules created based on managed rules.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

idRequired

  • Type: str

config_rule_trigger_typesRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property configRuleTriggerTypes: The trigger type of the rule.

Valid values: ConfigurationItemChangeNotification: The rule is triggered upon configuration changes. ScheduledNotification: The rule is triggered as scheduled.


resource_types_scopeRequired

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]

Property resourceTypesScope: The types of the resources to be evaluated against the rule.


risk_levelRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property riskLevel: The risk level of the resources that are not compliant with the rule.

Valid values: 1: critical 2: warning 3: info


rule_nameRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property ruleName: The name of the rule.


source_identifierRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property sourceIdentifier: The identifier of the rule.

For a managed rule, the value is the name of the managed rule. For a custom rule, the value is the ARN of the custom rule


source_ownerRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property sourceOwner: Specifies whether you or Alibaba Cloud owns and manages the rule.

Valid values: CUSTOM_FC: The rule is a custom rule and you own the rule. ALIYUN: The rule is a managed rule and Alibaba Cloud owns the rule


descriptionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property description: The description of the rule.


exclude_resource_ids_scopeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property excludeResourceIdsScope: The rule monitors excluded resource IDs, multiple of which are separated by commas, only applies to rules created based on managed rules, , custom rule this field is empty.


input_parametersOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]

Property inputParameters: The settings of the input parameters for the rule.


maximum_execution_frequencyOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property maximumExecutionFrequency: The frequency of the compliance evaluations.

Valid values: One_Hour Three_Hours Six_Hours Twelve_Hours TwentyFour_Hours


region_ids_scopeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property regionIdsScope: The rule monitors region IDs, separated by commas, only applies to rules created based on managed rules.


resource_group_ids_scopeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property resourceGroupIdsScope: The rule monitors resource group IDs, separated by commas, only applies to rules created based on managed rules.


tag_key_logic_scopeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property tagKeyLogicScope:.


tag_key_scopeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property tagKeyScope: The rule monitors the tag key, only applies to rules created based on managed rules.


tag_value_scopeOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property tagValueScope: The rule monitors the tag value, only applies to rules created based on managed rules.


enable_resource_property_constraintOptional

  • Type: bool

Methods

Name Description
to_string Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
add_condition No description.
add_count No description.
add_dependency No description.
add_resource_desc No description.
apply_removal_policy No description.
fetch_condition No description.
fetch_dependency No description.
fetch_resource_desc No description.
get_att No description.
set_metadata No description.

to_string

def to_string() -> str

Returns a string representation of this construct.

synthesize

def synthesize(
  session: ISynthesisSession
) -> None

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: ros_cdk_core.ISynthesisSession

The synthesis session.


add_condition

def add_condition(
  condition: RosCondition
) -> None

conditionRequired

  • Type: ros_cdk_core.RosCondition

add_count

def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None

countRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

add_dependency

def add_dependency(
  resource: Resource
) -> None

resourceRequired

  • Type: ros_cdk_core.Resource

add_resource_desc

def add_resource_desc(
  desc: str
) -> None

descRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy
) -> None

policyRequired

  • Type: ros_cdk_core.RemovalPolicy

fetch_condition

def fetch_condition() -> RosCondition

fetch_dependency

def fetch_dependency() -> typing.List[str]

fetch_resource_desc

def fetch_resource_desc() -> str

get_att

def get_att(
  name: str
) -> IResolvable

nameRequired

  • Type: str

set_metadata

def set_metadata(
  key: str,
  value: typing.Any
) -> None

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

Name Description
is_construct Return whether the given object is a Construct.

is_construct

import ros_cdk_config
ros_cdk_config.Rule.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ros_cdk_core.ConstructNode The construct tree node associated with this construct.
env ros_cdk_core.IResourceEnvironment The environment this resource belongs to.
ref str No description.
stack ros_cdk_core.Stack The stack in which this resource is defined.
resource ros_cdk_core.RosResource No description.
attr_config_rule_arn typing.Union[str, ros_cdk_core.IResolvable] Attribute ConfigRuleArn: config rule arn.
attr_config_rule_id typing.Union[str, ros_cdk_core.IResolvable] Attribute ConfigRuleId: The ID of the rule.
attr_config_rule_trigger_types typing.Union[str, ros_cdk_core.IResolvable] Attribute ConfigRuleTriggerTypes: The trigger type of the rule.
attr_description typing.Union[str, ros_cdk_core.IResolvable] Attribute Description: The description of the rule.
attr_event_source typing.Union[str, ros_cdk_core.IResolvable] Attribute EventSource: The event source of the rule.
attr_exclude_resource_ids_scope typing.Union[str, ros_cdk_core.IResolvable] Attribute ExcludeResourceIdsScope: The rule monitors excluded resource IDs, multiple of which are separated by commas, only applies to rules created based on managed rules, , custom rule this field is empty.
attr_input_parameters typing.Union[str, ros_cdk_core.IResolvable] Attribute InputParameters: The settings of the input parameters for the rule.
attr_maximum_execution_frequency typing.Union[str, ros_cdk_core.IResolvable] Attribute MaximumExecutionFrequency: The frequency of the compliance evaluations.
attr_region_ids_scope typing.Union[str, ros_cdk_core.IResolvable] Attribute RegionIdsScope: The rule monitors region IDs, separated by commas, only applies to rules created based on managed rules.
attr_resource_group_ids_scope typing.Union[str, ros_cdk_core.IResolvable] Attribute ResourceGroupIdsScope: The rule monitors resource group IDs, separated by commas, only applies to rules created based on managed rules.
attr_resource_types_scope typing.Union[str, ros_cdk_core.IResolvable] Attribute ResourceTypesScope: The types of the resources to be evaluated against the rule.
attr_risk_level typing.Union[str, ros_cdk_core.IResolvable] Attribute RiskLevel: The risk level of the resources that are not compliant with the rule.
attr_rule_name typing.Union[str, ros_cdk_core.IResolvable] Attribute RuleName: The name of the rule.
attr_source_identifier typing.Union[str, ros_cdk_core.IResolvable] Attribute SourceIdentifier: The identifier of the rule.
attr_source_owner typing.Union[str, ros_cdk_core.IResolvable] Attribute SourceOwner: Specifies whether you or Alibaba Cloud owns and manages the rule.
attr_tag_key_scope typing.Union[str, ros_cdk_core.IResolvable] Attribute TagKeyScope: The rule monitors the tag key, only applies to rules created based on managed rules.
attr_tag_value_scope typing.Union[str, ros_cdk_core.IResolvable] Attribute TagValueScope: The rule monitors the tag value, only applies to rules created based on managed rules.
props RuleProps No description.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


envRequired

env: IResourceEnvironment
  • Type: ros_cdk_core.IResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


refRequired

ref: str
  • Type: str

stackRequired

stack: Stack
  • Type: ros_cdk_core.Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource
  • Type: ros_cdk_core.RosResource

attr_config_rule_arnRequired

attr_config_rule_arn: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute ConfigRuleArn: config rule arn.


attr_config_rule_idRequired

attr_config_rule_id: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute ConfigRuleId: The ID of the rule.


attr_config_rule_trigger_typesRequired

attr_config_rule_trigger_types: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute ConfigRuleTriggerTypes: The trigger type of the rule.

Valid values: ConfigurationItemChangeNotification: The rule is triggered upon configuration changes. ScheduledNotification: The rule is triggered as scheduled.


attr_descriptionRequired

attr_description: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute Description: The description of the rule.


attr_event_sourceRequired

attr_event_source: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute EventSource: The event source of the rule.


attr_exclude_resource_ids_scopeRequired

attr_exclude_resource_ids_scope: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute ExcludeResourceIdsScope: The rule monitors excluded resource IDs, multiple of which are separated by commas, only applies to rules created based on managed rules, , custom rule this field is empty.


attr_input_parametersRequired

attr_input_parameters: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute InputParameters: The settings of the input parameters for the rule.


attr_maximum_execution_frequencyRequired

attr_maximum_execution_frequency: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute MaximumExecutionFrequency: The frequency of the compliance evaluations.

Valid values: One_Hour Three_Hours Six_Hours Twelve_Hours TwentyFour_Hours


attr_region_ids_scopeRequired

attr_region_ids_scope: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute RegionIdsScope: The rule monitors region IDs, separated by commas, only applies to rules created based on managed rules.


attr_resource_group_ids_scopeRequired

attr_resource_group_ids_scope: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute ResourceGroupIdsScope: The rule monitors resource group IDs, separated by commas, only applies to rules created based on managed rules.


attr_resource_types_scopeRequired

attr_resource_types_scope: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute ResourceTypesScope: The types of the resources to be evaluated against the rule.


attr_risk_levelRequired

attr_risk_level: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute RiskLevel: The risk level of the resources that are not compliant with the rule.

Valid values: 1: critical 2: warning 3: info


attr_rule_nameRequired

attr_rule_name: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute RuleName: The name of the rule.


attr_source_identifierRequired

attr_source_identifier: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute SourceIdentifier: The identifier of the rule.

For a managed rule, the value is the name of the managed rule. For a custom rule, the value is the ARN of the custom rule


attr_source_ownerRequired

attr_source_owner: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute SourceOwner: Specifies whether you or Alibaba Cloud owns and manages the rule.

Valid values: CUSTOM_FC: The rule is a custom rule and you own the rule. ALIYUN: The rule is a managed rule and Alibaba Cloud owns the rule


attr_tag_key_scopeRequired

attr_tag_key_scope: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute TagKeyScope: The rule monitors the tag key, only applies to rules created based on managed rules.


attr_tag_value_scopeRequired

attr_tag_value_scope: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute TagValueScope: The rule monitors the tag value, only applies to rules created based on managed rules.


propsRequired

props: RuleProps

Structs