aws-solutions-constructs.aws-events-rule-step-function


Nameaws-solutions-constructs.aws-events-rule-step-function JSON
Version 1.181.1 PyPI version JSON
download
home_pagehttps://github.com/awslabs/aws-solutions-constructs.git
SummaryCDK Constructs for deploying AWS Events Rule that invokes AWS Step Function
upload_time2022-12-02 03:33:38
maintainer
docs_urlNone
authorAmazon Web Services
requires_python~=3.7
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aws-events-rule-step-function module

<!--BEGIN STABILITY BANNER-->---


![Stability: Deprecated](https://img.shields.io/badge/STABILITY-DEPRECATED-red?style=for-the-badge)

> Some of our early constructs don’t meet the naming standards that evolved for the library. We are releasing completely feature compatible versions with corrected names. The underlying implementation code is the same regardless of whether you deploy the construct using the old or new name. We will support both names for all 1.x releases, but in 2.x we will only publish the correctly named constructs. This construct is being replaced by the functionally identical aws-eventbridge-stepfunctions.

---
<!--END STABILITY BANNER-->

| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
|:-------------|:-------------|

<div style="height:8px"></div>

| **Language**     | **Package**        |
|:-------------|-----------------|
|![Python Logo](https://docs.aws.amazon.com/cdk/api/latest/img/python32.png) Python|`aws_solutions_constructs.aws_events_rule_step_function`|
|![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) Typescript|`@aws-solutions-constructs/aws-events-rule-step-function`|
|![Java Logo](https://docs.aws.amazon.com/cdk/api/latest/img/java32.png) Java|`software.amazon.awsconstructs.services.eventsrulestepfunction`|

## Overview

This AWS Solutions Construct implements an AWS Events rule and an AWS Step function.

Here is a minimal deployable pattern definition:

Typescript

```python
// aws-events-rule-step-function has been deprecated for CDK V2 in favor of aws-eventbridge-stepfunctions.
// This sample uses the CDK V1 syntax
import * as cdk from '@aws-cdk/core';
import * as events from '@aws-cdk/aws-events';
import * as stepfunctions from '@aws-cdk/aws-stepfunctions';
import { EventsRuleToStepFunction, EventsRuleToStepFunctionProps } from '@aws-solutions-constructs/aws-events-rule-step-function';

const startState = new stepfunctions.Pass(this, 'StartState');

const constructProps: EventsRuleToStepFunctionProps = {
  stateMachineProps: {
    definition: startState
  },
  eventRuleProps: {
    schedule: events.Schedule.rate(cdk.Duration.minutes(5))
  }
};

new EventsRuleToStepFunction(this, 'test-events-rules-step-function-stack', constructProps);
```

Python

```Python
# aws-events-rule-step-function has been deprecated for CDK V2 in favor of aws-eventbridge-stepfunctions.
# This sample uses the CDK V1 syntax
from aws_solutions_constructs.aws_events_rule_step_function import EventsRuleToStepFunction, EventsRuleToStepFunctionProps
from aws_cdk import (
    aws_stepfunctions as stepfunctions,
    aws_events as events,
    core
)

startState = stepfunctions.Pass(self, 'StartState')

EventsRuleToStepFunction(self, 'test',
                            state_machine_props=stepfunctions.StateMachineProps(
                                definition=startState
                            ),
                            event_rule_props=events.RuleProps(
                                schedule=events.Schedule.rate(
                                    core.Duration.minutes(5))
                            ))

```

Java

```java
// aws-events-rule-step-function has been deprecated for CDK V2 in favor of aws-eventbridge-stepfunctions.
// This sample uses the CDK V1 syntax
import software.constructs.Construct;

import software.amazon.awscdk.core.*;
import software.amazon.awscdk.services.events.*;
import software.amazon.awscdk.services.stepfunctions.*;
import software.amazon.awsconstructs.services.eventsrulestepfunction.*;

final Pass startState = new Pass(this, "StartState");

new EventsRuleToStepFunction(this,
        "test-eventbridge-stepfunctions-stack",
        new EventsRuleToStepFunctionProps.Builder()
                .stateMachineProps(new StateMachineProps.Builder()
                        .definition(startState)
                        .build())
                .eventRuleProps(new RuleProps.Builder()
                        .schedule(Schedule.rate(Duration.minutes(5)))
                        .build())
                .build());
```

## Pattern Construct Props

| **Name**     | **Type**        | **Description** |
|:-------------|:----------------|-----------------|
|stateMachineProps|[`sfn.StateMachineProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-stepfunctions.StateMachineProps.html)|Optional user provided props to override the default props for sfn.StateMachine|
|existingEventBusInterface?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.IEventBus.html)| Optional user-provided custom EventBus for construct to use. Providing both this and `eventBusProps` results an error.|
|eventBusProps?|[`events.EventBusProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.EventBusProps.html)|Optional user-provided properties to override the default properties when creating a custom EventBus. Setting this value to `{}` will create a custom EventBus using all default properties. If neither this nor `existingEventBusInterface` is provided the construct will use the `default` EventBus. Providing both this and `existingEventBusInterface` results an error.|
|eventRuleProps|[`events.RuleProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.RuleProps.html)|User provided eventRuleProps to override the defaults|
|createCloudWatchAlarms|`boolean`|Whether to create recommended CloudWatch alarms|
|logGroupProps?|[`logs.LogGroupProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-logs.LogGroupProps.html)|User provided props to override the default props for for the CloudWatchLogs LogGroup.|

## Pattern Properties

| **Name**     | **Type**        | **Description** |
|:-------------|:----------------|-----------------|
|eventBus?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.IEventBus.html)|Returns the instance of events.IEventBus used by the construct|
|eventsRule|[`events.Rule`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.Rule.html)|Returns an instance of events.Rule created by the construct|
|stateMachine|[`sfn.StateMachine`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-stepfunctions.StateMachine.html)|Returns an instance of sfn.StateMachine created by the construct|
|stateMachineLogGroup|[`logs.ILogGroup`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-logs.ILogGroup.html)|Returns an instance of the ILogGroup created by the construct for StateMachine|
|cloudwatchAlarms?|[`cloudwatch.Alarm[]`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-cloudwatch.Alarm.html)|Returns a list of cloudwatch.Alarm created by the construct|

## Default settings

Out of the box implementation of the Construct without any override will set the following defaults:

### Amazon CloudWatch Events Rule

* Grant least privilege permissions to CloudWatch Events to trigger the Lambda Function

### AWS Step Function

* Enable CloudWatch logging for API Gateway
* Deploy best practices CloudWatch Alarms for the Step Function

## Architecture

![Architecture Diagram](architecture.png)

---


© Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/awslabs/aws-solutions-constructs.git",
    "name": "aws-solutions-constructs.aws-events-rule-step-function",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "~=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Amazon Web Services",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/53/41/00d9351cf519c667ba72179a3fef96e3d149ca76881ef72eadc6185e5dc1/aws-solutions-constructs.aws-events-rule-step-function-1.181.1.tar.gz",
    "platform": null,
    "description": "# aws-events-rule-step-function module\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![Stability: Deprecated](https://img.shields.io/badge/STABILITY-DEPRECATED-red?style=for-the-badge)\n\n> Some of our early constructs don\u2019t meet the naming standards that evolved for the library. We are releasing completely feature compatible versions with corrected names. The underlying implementation code is the same regardless of whether you deploy the construct using the old or new name. We will support both names for all 1.x releases, but in 2.x we will only publish the correctly named constructs. This construct is being replaced by the functionally identical aws-eventbridge-stepfunctions.\n\n---\n<!--END STABILITY BANNER-->\n\n| **Reference Documentation**:| <span style=\"font-weight: normal\">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|\n|:-------------|:-------------|\n\n<div style=\"height:8px\"></div>\n\n| **Language**     | **Package**        |\n|:-------------|-----------------|\n|![Python Logo](https://docs.aws.amazon.com/cdk/api/latest/img/python32.png) Python|`aws_solutions_constructs.aws_events_rule_step_function`|\n|![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) Typescript|`@aws-solutions-constructs/aws-events-rule-step-function`|\n|![Java Logo](https://docs.aws.amazon.com/cdk/api/latest/img/java32.png) Java|`software.amazon.awsconstructs.services.eventsrulestepfunction`|\n\n## Overview\n\nThis AWS Solutions Construct implements an AWS Events rule and an AWS Step function.\n\nHere is a minimal deployable pattern definition:\n\nTypescript\n\n```python\n// aws-events-rule-step-function has been deprecated for CDK V2 in favor of aws-eventbridge-stepfunctions.\n// This sample uses the CDK V1 syntax\nimport * as cdk from '@aws-cdk/core';\nimport * as events from '@aws-cdk/aws-events';\nimport * as stepfunctions from '@aws-cdk/aws-stepfunctions';\nimport { EventsRuleToStepFunction, EventsRuleToStepFunctionProps } from '@aws-solutions-constructs/aws-events-rule-step-function';\n\nconst startState = new stepfunctions.Pass(this, 'StartState');\n\nconst constructProps: EventsRuleToStepFunctionProps = {\n  stateMachineProps: {\n    definition: startState\n  },\n  eventRuleProps: {\n    schedule: events.Schedule.rate(cdk.Duration.minutes(5))\n  }\n};\n\nnew EventsRuleToStepFunction(this, 'test-events-rules-step-function-stack', constructProps);\n```\n\nPython\n\n```Python\n# aws-events-rule-step-function has been deprecated for CDK V2 in favor of aws-eventbridge-stepfunctions.\n# This sample uses the CDK V1 syntax\nfrom aws_solutions_constructs.aws_events_rule_step_function import EventsRuleToStepFunction, EventsRuleToStepFunctionProps\nfrom aws_cdk import (\n    aws_stepfunctions as stepfunctions,\n    aws_events as events,\n    core\n)\n\nstartState = stepfunctions.Pass(self, 'StartState')\n\nEventsRuleToStepFunction(self, 'test',\n                            state_machine_props=stepfunctions.StateMachineProps(\n                                definition=startState\n                            ),\n                            event_rule_props=events.RuleProps(\n                                schedule=events.Schedule.rate(\n                                    core.Duration.minutes(5))\n                            ))\n\n```\n\nJava\n\n```java\n// aws-events-rule-step-function has been deprecated for CDK V2 in favor of aws-eventbridge-stepfunctions.\n// This sample uses the CDK V1 syntax\nimport software.constructs.Construct;\n\nimport software.amazon.awscdk.core.*;\nimport software.amazon.awscdk.services.events.*;\nimport software.amazon.awscdk.services.stepfunctions.*;\nimport software.amazon.awsconstructs.services.eventsrulestepfunction.*;\n\nfinal Pass startState = new Pass(this, \"StartState\");\n\nnew EventsRuleToStepFunction(this,\n        \"test-eventbridge-stepfunctions-stack\",\n        new EventsRuleToStepFunctionProps.Builder()\n                .stateMachineProps(new StateMachineProps.Builder()\n                        .definition(startState)\n                        .build())\n                .eventRuleProps(new RuleProps.Builder()\n                        .schedule(Schedule.rate(Duration.minutes(5)))\n                        .build())\n                .build());\n```\n\n## Pattern Construct Props\n\n| **Name**     | **Type**        | **Description** |\n|:-------------|:----------------|-----------------|\n|stateMachineProps|[`sfn.StateMachineProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-stepfunctions.StateMachineProps.html)|Optional user provided props to override the default props for sfn.StateMachine|\n|existingEventBusInterface?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.IEventBus.html)| Optional user-provided custom EventBus for construct to use. Providing both this and `eventBusProps` results an error.|\n|eventBusProps?|[`events.EventBusProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.EventBusProps.html)|Optional user-provided properties to override the default properties when creating a custom EventBus. Setting this value to `{}` will create a custom EventBus using all default properties. If neither this nor `existingEventBusInterface` is provided the construct will use the `default` EventBus. Providing both this and `existingEventBusInterface` results an error.|\n|eventRuleProps|[`events.RuleProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.RuleProps.html)|User provided eventRuleProps to override the defaults|\n|createCloudWatchAlarms|`boolean`|Whether to create recommended CloudWatch alarms|\n|logGroupProps?|[`logs.LogGroupProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-logs.LogGroupProps.html)|User provided props to override the default props for for the CloudWatchLogs LogGroup.|\n\n## Pattern Properties\n\n| **Name**     | **Type**        | **Description** |\n|:-------------|:----------------|-----------------|\n|eventBus?|[`events.IEventBus`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.IEventBus.html)|Returns the instance of events.IEventBus used by the construct|\n|eventsRule|[`events.Rule`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-events.Rule.html)|Returns an instance of events.Rule created by the construct|\n|stateMachine|[`sfn.StateMachine`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-stepfunctions.StateMachine.html)|Returns an instance of sfn.StateMachine created by the construct|\n|stateMachineLogGroup|[`logs.ILogGroup`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-logs.ILogGroup.html)|Returns an instance of the ILogGroup created by the construct for StateMachine|\n|cloudwatchAlarms?|[`cloudwatch.Alarm[]`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-cloudwatch.Alarm.html)|Returns a list of cloudwatch.Alarm created by the construct|\n\n## Default settings\n\nOut of the box implementation of the Construct without any override will set the following defaults:\n\n### Amazon CloudWatch Events Rule\n\n* Grant least privilege permissions to CloudWatch Events to trigger the Lambda Function\n\n### AWS Step Function\n\n* Enable CloudWatch logging for API Gateway\n* Deploy best practices CloudWatch Alarms for the Step Function\n\n## Architecture\n\n![Architecture Diagram](architecture.png)\n\n---\n\n\n\u00a9 Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "CDK Constructs for deploying AWS Events Rule that invokes AWS Step Function",
    "version": "1.181.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "f5f2d1fc95b4626765b7b3478d0ea3a7",
                "sha256": "e08672da6dd674d01c02b4f803b6808103439f1b91dec3c71ee6e348608539c4"
            },
            "downloads": -1,
            "filename": "aws_solutions_constructs.aws_events_rule_step_function-1.181.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f5f2d1fc95b4626765b7b3478d0ea3a7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.7",
            "size": 90503,
            "upload_time": "2022-12-02T03:31:14",
            "upload_time_iso_8601": "2022-12-02T03:31:14.121491Z",
            "url": "https://files.pythonhosted.org/packages/81/dd/8e92eed20cf09713b9513dbd4bac594a15a2e0a4c2104d272c62226fe396/aws_solutions_constructs.aws_events_rule_step_function-1.181.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "d8a8498922d3df9b42e0e288c53ea5e2",
                "sha256": "45689ac5e812d3e292bb18101c689d85c0e9f261a8ad4dfbf093c465fd73551b"
            },
            "downloads": -1,
            "filename": "aws-solutions-constructs.aws-events-rule-step-function-1.181.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d8a8498922d3df9b42e0e288c53ea5e2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.7",
            "size": 91355,
            "upload_time": "2022-12-02T03:33:38",
            "upload_time_iso_8601": "2022-12-02T03:33:38.642588Z",
            "url": "https://files.pythonhosted.org/packages/53/41/00d9351cf519c667ba72179a3fef96e3d149ca76881ef72eadc6185e5dc1/aws-solutions-constructs.aws-events-rule-step-function-1.181.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-02 03:33:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "awslabs",
    "github_project": "aws-solutions-constructs.git",
    "lcname": "aws-solutions-constructs.aws-events-rule-step-function"
}
        
Elapsed time: 0.05757s