# cdk-execution-manager

> This CDK construct takes a State Machine and the state input as `props` and creates a CloudFormation Custom Resource to manage executions in a Lambda function. It also adds a `ResumeTo` state, at the top of the StateMachine tree, so executions can be easi

Latest version **1.1.2** (published 2020-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install cdk-execution-manager
pnpm add cdk-execution-manager
yarn add cdk-execution-manager
bun add cdk-execution-manager
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2020-05-27 |
| First published | 2020-05-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 67.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | André Fontenelle |
| Maintainers | ndrestone |
| Keywords | cdk, construct, step-functions |

## Links

- npm: https://www.npmjs.com/package/cdk-execution-manager
- Repository: https://github.com/andrestone/cdk-execution-manager
- Homepage: https://github.com/andrestone/cdk-execution-manager#readme
- Issues: https://github.com/andrestone/cdk-execution-manager/issues
- npm.io page: https://npm.io/package/cdk-execution-manager

## Dependencies (4)

- [@aws-cdk/core](https://npm.io/package/@aws-cdk/core.md) ^1.42.0
- [@aws-cdk/custom-resources](https://npm.io/package/@aws-cdk/custom-resources.md) ^1.42.0
- [@aws-cdk/aws-stepfunctions](https://npm.io/package/@aws-cdk/aws-stepfunctions.md) ^1.42.0
- [@aws-cdk/aws-cloudformation](https://npm.io/package/@aws-cdk/aws-cloudformation.md) ^1.42.0

## Recent versions

- 1.1.2 (latest) — 2020-05-27
- 1.1.1 — 2020-05-27
- 1.1.0 — 2020-05-27
- 1.0.3 — 2020-05-27
- 1.0.2 — 2020-05-27
- 1.0.1 — 2020-05-27
- 1.0.0 — 2020-05-27

## README

This CDK construct takes a State Machine and the state input as `props` and creates a CloudFormation Custom Resource to manage executions in a Lambda function. It also adds a `ResumeTo` state, at the top of the StateMachine tree, so executions can be easily resumed to a certain state. At each `cdk deploy` a new execution is triggered and the CDK cli outputs the URL for the triggered execution details. 

![State Machine](https://dev-to-uploads.s3.amazonaws.com/i/al760ondl1l0q16bw7tw.png)

## Usage:

Install:

`npm install cdk-execution-manager`


```typescript
import * as sfn from '@aws-cdk/aws-stepfunctions'
import { DeploymentManager } from "cdk-execution-manager";

const task1 = new stepfunctions.Pass(stack, 'State One');
const task2 = new stepfunctions.Pass(stack, 'State Two');
const stateMachine = task1.next(task2);

new DeploymentManager(this, "TestDeployment", {
      stateMachineDefinition: definition,
    });
```

Every time you run `cdk deploy` a new execution will be triggered, the cli will output a link to the current execution.

 ![Deployment Manager output](https://dev-to-uploads.s3.amazonaws.com/i/vpayaicceq6hliikxo51.png)
 
You can pass inputs using the `executionInput` property:
 
 ```typescript
new DeploymentManager(this, "TestDeployment", {
      stateMachineDefinition: definition,
      executionInput: {
              payload: `PAYLOAD`,
            },
    });
```
 
You can use the `resumeTo` input path to resume the execution from a given state:

```typescript
new DeploymentManager(this, "TestDeployment", {
      stateMachineDefinition: definition,
      executionInput: {
              payload: `PAYLOAD`,
              resumeTo: task2.id,
            },
    });
```

## LICENSE

MIT

---
_Source: https://npm.io/package/cdk-execution-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
