CfnRuleProps

class aws_cdk.aws_events.CfnRuleProps(*, description=None, event_bus_name=None, event_pattern=None, name=None, role_arn=None, schedule_expression=None, state=None, targets=None)

Bases: object

Properties for defining a AWS::Events::Rule.

Parameters
  • description (Optional[str]) – AWS::Events::Rule.Description.

  • event_bus_name (Optional[str]) – AWS::Events::Rule.EventBusName.

  • event_pattern (Optional[Any]) – AWS::Events::Rule.EventPattern.

  • name (Optional[str]) – AWS::Events::Rule.Name.

  • role_arn (Optional[str]) – AWS::Events::Rule.RoleArn.

  • schedule_expression (Optional[str]) – AWS::Events::Rule.ScheduleExpression.

  • state (Optional[str]) – AWS::Events::Rule.State.

  • targets (Union[IResolvable, Sequence[Union[IResolvable, TargetProperty]], None]) – AWS::Events::Rule.Targets.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_events as events

# event_pattern is of type object

cfn_rule_props = events.CfnRuleProps(
    description="description",
    event_bus_name="eventBusName",
    event_pattern=event_pattern,
    name="name",
    role_arn="roleArn",
    schedule_expression="scheduleExpression",
    state="state",
    targets=[events.CfnRule.TargetProperty(
        arn="arn",
        id="id",

        # the properties below are optional
        batch_parameters=events.CfnRule.BatchParametersProperty(
            job_definition="jobDefinition",
            job_name="jobName",

            # the properties below are optional
            array_properties=events.CfnRule.BatchArrayPropertiesProperty(
                size=123
            ),
            retry_strategy=events.CfnRule.BatchRetryStrategyProperty(
                attempts=123
            )
        ),
        dead_letter_config=events.CfnRule.DeadLetterConfigProperty(
            arn="arn"
        ),
        ecs_parameters=events.CfnRule.EcsParametersProperty(
            task_definition_arn="taskDefinitionArn",

            # the properties below are optional
            capacity_provider_strategy=[events.CfnRule.CapacityProviderStrategyItemProperty(
                capacity_provider="capacityProvider",

                # the properties below are optional
                base=123,
                weight=123
            )],
            enable_ecs_managed_tags=False,
            enable_execute_command=False,
            group="group",
            launch_type="launchType",
            network_configuration=events.CfnRule.NetworkConfigurationProperty(
                aws_vpc_configuration=events.CfnRule.AwsVpcConfigurationProperty(
                    subnets=["subnets"],

                    # the properties below are optional
                    assign_public_ip="assignPublicIp",
                    security_groups=["securityGroups"]
                )
            ),
            placement_constraints=[events.CfnRule.PlacementConstraintProperty(
                expression="expression",
                type="type"
            )],
            placement_strategies=[events.CfnRule.PlacementStrategyProperty(
                field="field",
                type="type"
            )],
            platform_version="platformVersion",
            propagate_tags="propagateTags",
            reference_id="referenceId",
            tag_list=[CfnTag(
                key="key",
                value="value"
            )],
            task_count=123
        ),
        http_parameters=events.CfnRule.HttpParametersProperty(
            header_parameters={
                "header_parameters_key": "headerParameters"
            },
            path_parameter_values=["pathParameterValues"],
            query_string_parameters={
                "query_string_parameters_key": "queryStringParameters"
            }
        ),
        input="input",
        input_path="inputPath",
        input_transformer=events.CfnRule.InputTransformerProperty(
            input_template="inputTemplate",

            # the properties below are optional
            input_paths_map={
                "input_paths_map_key": "inputPathsMap"
            }
        ),
        kinesis_parameters=events.CfnRule.KinesisParametersProperty(
            partition_key_path="partitionKeyPath"
        ),
        redshift_data_parameters=events.CfnRule.RedshiftDataParametersProperty(
            database="database",
            sql="sql",

            # the properties below are optional
            db_user="dbUser",
            secret_manager_arn="secretManagerArn",
            statement_name="statementName",
            with_event=False
        ),
        retry_policy=events.CfnRule.RetryPolicyProperty(
            maximum_event_age_in_seconds=123,
            maximum_retry_attempts=123
        ),
        role_arn="roleArn",
        run_command_parameters=events.CfnRule.RunCommandParametersProperty(
            run_command_targets=[events.CfnRule.RunCommandTargetProperty(
                key="key",
                values=["values"]
            )]
        ),
        sqs_parameters=events.CfnRule.SqsParametersProperty(
            message_group_id="messageGroupId"
        )
    )]
)

Attributes

description

AWS::Events::Rule.Description.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-description

Return type

Optional[str]

event_bus_name

AWS::Events::Rule.EventBusName.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventbusname

Return type

Optional[str]

event_pattern

AWS::Events::Rule.EventPattern.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern

Return type

Any

name

AWS::Events::Rule.Name.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-name

Return type

Optional[str]

role_arn

AWS::Events::Rule.RoleArn.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-rolearn

Return type

Optional[str]

schedule_expression

AWS::Events::Rule.ScheduleExpression.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-scheduleexpression

Return type

Optional[str]

state

AWS::Events::Rule.State.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state

Return type

Optional[str]

targets

AWS::Events::Rule.Targets.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-targets

Return type

Union[IResolvable, List[Union[IResolvable, TargetProperty]], None]