Repository: mbonig/state-machine (language: python)

Issue:
Attempting to override Array elements causes new elements to be created
I'm trying to override some parameters in multiple members of a `Branches` array. Attempting to override the parameters by simply providing providing my own array is causing duplicate members to be created, rather than overriding the specified values on the existing array members.

Given this ASL array:
<details>
<summary>ASL Array</summary>

 ```json
      "Branches": [
        {
          "StartAt": "ResumeCluster",
          "States": {
            "ResumeCluster": {
              "Type": "Task",
              "Parameters": {
                "ClusterIdentifier": "MyData"
              },
              "Resource": "arn:aws:states:::aws-sdk:redshift:resumeCluster",
              "Next": "DescribeClusters"
            },
            "DescribeClusters": {
              "Type": "Task",
              "Parameters": {
                "ClusterIdentifier": ""
              },
              "Resource": "arn:aws:states:::aws-sdk:redshift:describeClusters",
              "Next": "Evaluate Cluster Status"
            },
            "Evaluate Cluster Status": {
              "Type": "Choice",
              "Choices": [
                {
                  "Variable": "$.Clusters[0].ClusterStatus",
                  "StringEquals": "available",
                  "Next": "Redshift Pass"
                }
              ],
              "Default": "Redshift Wait"
            },
            "Redshift Pass": {
              "Type": "Pass",
              "End": true
            },
            "Redshift Wait": {
              "Type": "Wait",
              "Seconds": 5,
              "Next": "DescribeClusters"
            }
          }
        },
        {
          "StartAt": "StartInstances",
          "States": {
            "StartInstances": {
              "Type": "Task",
              "Parameters": {
                "InstanceIds": [
                  "MyData"
                ]
              },
              "Resource": "arn:aws:states:::aws-sdk:ec2:startInstances",
              "Next": "DescribeInstanceStatus"
            },
            "DescribeInstanceStatus": {
              "Type": "Task",
              "Next": "Evaluate Instance Status",
              "Parameters": {
                "InstanceIds": [
                  "MyData"
                ]
              },
              "Resource": "arn:aws:states:::aws-sdk:ec2:describeInstanceStatus"
            },
            "Evaluate Instance Status": {
              "Type": "Choice",
              "Choices": [
                {
                  "And": [
                    {
                      "Variable": "$.InstanceStatuses[0].InstanceState.Name",
                      "StringEquals": "running"
                    },
                    {
                      "Variable": "$.InstanceStatuses[0].SystemStatus.Details[0].Status",
                      "StringEquals": "passed"
                    },
                    {
                      "Variable": "$.InstanceStatuses[0].InstanceStatus.Details[0].Status",
                      "StringEquals": "passed"
                    }
                  ],
                  "Next": "EC2 Pass"
                }
              ],
              "Default": "EC2 Wait"
            },
            "EC2 Pass": {
              "Type": "Pass",
              "End": true
            },
            "EC2 Wait": {
              "Type": "Wait",
              "Seconds": 5,
              "Next": "DescribeInstanceStatus"
            }
          }
        }
      ]
```
</details>

And this override:
(Stripped to just what's relevant)

<details>
<summary>Override</summary>

```python
                    "Branches": [{
                        "StartAt": "ResumeCluster",
                        "States": {
                            "ResumeCluster": {
                                "Parameters": {
                                    "ClusterIdentifier": "CLUSTER_NAME"  # TODO Sub this out
                                }
                            },
                            "DescribeClusters": {
                                "Parameters": {
                                    "ClusterIdentifier": "CLUSTER_NAME"  # TODO Sub this out
                                }
                            },
                        }
                    }, {
                        "StartAt": "StartInstances",
                        "States": {
                            "StartInstances": {
                                "Parameters": {
                                    "InstanceIds": ["INSTANCE_ID"]  # TODO Sub this out
                                }
                            },
                            "DescribeInstanceStatus": {
                                "Parameters": {
                                    "InstanceIds": ["INSTANCE_ID"]  # TODO Sub this out
                                }
                            }
                        }
                    }]
```

</details>

I'm left with this JSON in the state language definition. You can see clearly that it's appended the overrides as additional members rather than overriding the existing ones:

<details>
<summary>Resulting ASL</summary>

```json
"Branches": [
        {
          "StartAt": "ResumeCluster",
          "States": {
            "ResumeCluster": {
              "Type": "Task",
              "Parameters": {
                "ClusterIdentifier": "MyData"
              },
              "Resource": "arn:aws:states:::aws-sdk:redshift:resumeCluster",
              "Next": "DescribeClusters"
            },
            "DescribeClusters": {
              "Type": "Task",
              "Parameters": {
                "ClusterIdentifier": ""
              },
              "Resource": "arn:aws:states:::aws-sdk:redshift:describeClusters",
              "Next": "Evaluate Cluster Status"
            },
            "Evaluate Cluster Status": {
              "Type": "Choice",
              "Choices": [
                {
                  "Variable": "$.Clusters[0].ClusterStatus",
                  "StringEquals": "available",
                  "Next": "Redshift Pass"
                }
              ],
              "Default": "Redshift Wait"
            },
            "Redshift Pass": {
              "Type": "Pass",
              "End": true
            },
            "Redshift Wait": {
              "Type": "Wait",
              "Seconds": 5,
              "Next": "DescribeClusters"
            }
          }
        },
        {
          "StartAt": "StartInstances",
          "States": {
            "StartInstances": {
              "Type": "Task",
              "Parameters": {
                "InstanceIds": [
                  "MyData"
                ]
              },
              "Resource": "arn:aws:states:::aws-sdk:ec2:startInstances",
              "Next": "DescribeInstanceStatus"
            },
            "DescribeInstanceStatus": {
              "Type": "Task",
              "Next": "Evaluate Instance Status",
              "Parameters": {
                "InstanceIds": [
                  "MyData"
                ]
              },
              "Resource": "arn:aws:states:::aws-sdk:ec2:describeInstanceStatus"
            },
            "Evaluate Instance Status": {
              "Type": "Choice",
              "Choices": [
                {
                  "And": [
                    {
                      "Variable": "$.InstanceStatuses[0].InstanceState.Name",
                      "StringEquals": "running"
                    },
                    {
                      "Variable": "$.InstanceStatuses[0].SystemStatus.Details[0].Status",
                      "StringEquals": "passed"
                    },
                    {
                      "Variable": "$.InstanceStatuses[0].InstanceStatus.Details[0].Status",
                      "StringEquals": "passed"
                    }
                  ],
                  "Next": "EC2 Pass"
                }
              ],
              "Default": "EC2 Wait"
            },
            "EC2 Pass": {
              "Type": "Pass",
              "End": true
            },
            "EC2 Wait": {
              "Type": "Wait",
              "Seconds": 5,
              "Next": "DescribeInstanceStatus"
            }
          }
        },
        {
          "StartAt": "ResumeCluster",
          "States": {
            "ResumeCluster": {
              "Parameters": {
                "ClusterIdentifier": "CLUSTER_NAME"
              }
            },
            "DescribeClusters": {
              "Parameters": {
                "ClusterIdentifier": "CLUSTER_NAME"
              }
            }
          }
        },
        {
          "StartAt": "StartInstances",
          "States": {
            "StartInstances": {
              "Parameters": {
                "InstanceIds": [
                  "INSTANCE_ID"
                ]
              }
            },
            "DescribeInstanceStatus": {
              "Parameters": {
                "InstanceIds": [
                  "INSTANCE_ID"
                ]
              }
            }
          }
        }
      ]
```
</details>

The expected behavior would be for the construct to drill into the existing array members in-order (since I have no way to target an array element via JMES or anything like that) and perform the overrides.


Discussion / hints:
@mbonig The [merge method from lodash](https://lodash.com/docs/4.17.15#merge) handles arrays fairly well, but it still requires you to define the other objects in an array members up-to-and-including the element you're trying to override.

Basic implementation on the construct:

```ts
export class StateMachine extends aws_stepfunctions.StateMachine {
  /**
   * The result of the lodash merge performed on the definition and override props.
   * Used for testing purposes.
   */
  public mergedResult: any;

  constructor(scope: Construct, id: string, props: StateMachineProps) {
    super(scope, id, {
      ...props,
      definition: new Pass(scope, 'THISWILLBEDELETEDRIGHTAWAY'),
    });
    scope.node.tryRemoveChild('THISWILLBEDELETEDRIGHTAWAY');

    this.mergedResult = _.merge(props.definition, props.overrides)

    (this.node.defaultChild as CfnStateMachine).definitionString = JSON.stringify(this.mergedResult);
  }
}
```

The result of the example from this issue:

```json
{
   "Branches":[
      {
         "StartAt":"ResumeCluster",
         "States":{
            "ResumeCluster":{
               "Type":"Task",
               "Parameters":{
                  "ClusterIdentifier":"CLUSTER_NAME"
               },
               "Resource":"arn:aws:states:::aws-sdk:redshift:resumeCluster",
               "Next":"DescribeClusters"
            },
            "DescribeClusters":{
               "Type":"Task",
               "Parameters":{
                  "ClusterIdentifier":"CLUSTER_NAME"
               },
               "Resource":"arn:aws:states:::aws-sdk:redshift:describeClusters",
               "Next":"Evaluate Cluster Status"
            },
            "Evaluate Cluster Status":{
               "Type":"Choice",
               "Choices":[
                  {
                     "Variable":"$.Clusters[0].ClusterStatus",
                     "StringEquals":"available",
                     "Next":"Redshift Pass"
                  }
               ],
               "Default":"Redshift Wait"
            },
            "Redshift Pass":{
               "Type":"Pass",
               "End":true
            },
            "Redshift Wait":{
               "Type":"Wait",
               "Seconds":5,
               "Next":"DescribeClusters"
            }
         }
      },
      {
         "StartAt":"StartInstances",
         "States":{
            "StartInstances":{
               "Type":"Task",
               "Parameters":{
                  "InstanceIds":[
                     "INSTANCE_ID"
                  ]
               },
               "Resource":"arn:aws:states:::aws-sdk:ec2:startInstances",
               "Next":"DescribeInstanceStatus"
            },
            "DescribeInstanceStatus":{
               "Type":"Task",
               "Next":"Evaluate Instance Status",
               "Parameters":{
                  "InstanceIds":[
                     "INSTANCE_ID"
                  ]
               },
               "Resource":"arn:aws:states:::aws-sdk:ec2:describeInstanceStatus"
            },
            "Evaluate Instance Status":{
               "Type":"Choice",
               "Choices":[
                  {
                     "And":[
                        {
                           "Variable":"$.InstanceStatuses[0].InstanceState.Name",
                           "StringEquals":"running"
                        },
                        {
                           "Variable":"$.InstanceStatuses[0].SystemStatus.Details[0].Status",
                           "StringEquals":"passed"
                        },
                        {
                           "Variable":"$.InstanceStatuses[0].InstanceStatus.Details[0].Status",
                           "StringEquals":"passed"
                        }
                     ],
                     "Next":"EC2 Pass"
                  }
               ],
               "Default":"EC2 Wait"
            },
            "EC2 Pass":{
               "Type":"Pass",
               "End":true
            },
            "EC2 Wait":{
               "Type":"Wait",
               "Seconds":5,
               "Next":"DescribeInstanceStatus"
            }
         }
      }
   ]
}
```

Arrays will still be tricky and human-error prone with this. It might be worth considering moving to an `iterable` approach, similarly to [how the `yaml` module handles overrides with the `setIn()` method](https://eemeli.org/yaml/v1/#collections)

Fix patch:
diff --git a/.projen/deps.json b/.projen/deps.json
index d281a60..7b21dbc 100644
--- a/.projen/deps.json
+++ b/.projen/deps.json
@@ -88,6 +88,10 @@
       "name": "typescript",
       "type": "build"
     },
+    {
+      "name": "lodash.merge",
+      "type": "bundled"
+    },
     {
       "name": "aws-cdk-lib",
       "version": "^2.4.0",
@@ -97,6 +101,10 @@
       "name": "constructs",
       "version": "^10.0.5",
       "type": "peer"
+    },
+    {
+      "name": "lodash.merge",
+      "type": "runtime"
     }
   ],
   "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"."
diff --git a/.projenrc.js b/.projenrc.js
index 4e5a539..ff19dba 100644
--- a/.projenrc.js
+++ b/.projenrc.js
@@ -1,5 +1,6 @@
 const { awscdk } = require('projen');
 const { NpmAccess } = require('projen/lib/javascript');
+let lodash = 'lodash.merge';
 const project = new awscdk.AwsCdkConstructLibrary({
   author: 'Matthew Bonig',
   authorAddress: 'matthew.bonig@gmail.com',
@@ -8,6 +9,8 @@ const project = new awscdk.AwsCdkConstructLibrary({
   defaultReleaseBranch: 'main',
   name: '@matthewbonig/state-machine',
   repositoryUrl: 'https://github.com/mbonig/state-machine.git',
+  deps: [lodash],
+  bundledDeps: [lodash],
   npmAccess: NpmAccess.PUBLIC,
   gitignore: ['.idea/'],
   keywords: ['awscdk', 'cdk', 'AWS Step Functions'],
diff --git a/API.md b/API.md
index fc05512..1777115 100644
--- a/API.md
+++ b/API.md
@@ -78,7 +78,13 @@ public applyRemovalPolicy(policy: RemovalPolicy): void
 
 Apply the given removal policy to this resource.
 
-The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
+The Removal Policy controls what happens to this resource when it stops
+being managed by CloudFormation, either because you've removed it from the
+CDK application or because you've made a change that requires the resource
+to be replaced.
+
+The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
+account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
 
 ###### `policy`<sup>Required</sup> <a name="policy" id="@matthewbonig/state-machine.StateMachine.applyRemovalPolicy.parameter.policy"></a>
 
@@ -321,7 +327,6 @@ Metric for the number of executions that timed out.
 | <code><a href="#@matthewbonig/state-machine.StateMachine.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
 | <code><a href="#@matthewbonig/state-machine.StateMachine.isResource">isResource</a></code> | Check whether the given construct is a Resource. |
 | <code><a href="#@matthewbonig/state-machine.StateMachine.fromStateMachineArn">fromStateMachineArn</a></code> | Import a state machine. |
-| <code><a href="#@matthewbonig/state-machine.StateMachine.smash">smash</a></code> | *No description.* |
 
 ---
 
@@ -387,26 +392,6 @@ Import a state machine.
 
 ---
 
-##### `smash` <a name="smash" id="@matthewbonig/state-machine.StateMachine.smash"></a>
-
-```typescript
-import { StateMachine } from '@matthewbonig/state-machine'
-
-StateMachine.smash(definition: any, smash?: any)
-```
-
-###### `definition`<sup>Required</sup> <a name="definition" id="@matthewbonig/state-machine.StateMachine.smash.parameter.definition"></a>
-
-- *Type:* any
-
----
-
-###### `smash`<sup>Optional</sup> <a name="smash" id="@matthewbonig/state-machine.StateMachine.smash.parameter.smash"></a>
-
-- *Type:* any
-
----
-
 #### Properties <a name="Properties" id="Properties"></a>
 
 | **Name** | **Type** | **Description** |
@@ -444,7 +429,12 @@ public readonly env: ResourceEnvironment;
 
 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.
+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.
 
 ---
 
@@ -585,6 +575,13 @@ An object that matches the schema/shape of the ASL .States map with overridden v
 
 ---
 
+*Example*
+
+```typescript
+{'My First State': { Parameters: { FunctionName: 'aLambdaFunctionArn' } } }
+```
+
+
 ##### `role`<sup>Optional</sup> <a name="role" id="@matthewbonig/state-machine.StateMachineProps.property.role"></a>
 
 ```typescript
diff --git a/README.md b/README.md
index d34e2e8..fbdf61d 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,8 @@ Create a new instance of this construct, handing it a fully parsed version of th
 Then add overridden values. 
 The fields in the `overrides` field should match the `States` field of the ASL.
 
+### Examples
+
 ```ts
 const secret = new Secret(stack, 'Secret', {});
 new StateMachine(stack, 'Test', {
@@ -30,6 +32,153 @@ new StateMachine(stack, 'Test', {
   },
 });
 ```
+
+You can also override nested states in arrays, for example:
+
+```ts
+new StateMachine(stack, 'Test', {
+    stateMachineName: 'A-nice-state-machine',
+    overrides: {
+      Branches: [{
+        StartAt: 'ResumeCluster',
+        States: {
+          ResumeCluster: {
+            Parameters: {
+              ClusterIdentifier: 'CLUSTER_NAME',
+            },
+          },
+          DescribeClusters: {
+            Parameters: {
+              ClusterIdentifier: 'CLUSTER_NAME',
+            },
+          },
+        },
+      }, {
+        StartAt: 'StartInstances',
+        States: {
+          StartInstances: {
+            Parameters: {
+              InstanceIds: ['INSTANCE_ID'],
+            },
+          },
+          DescribeInstanceStatus: {
+            Parameters: {
+              InstanceIds: ['INSTANCE_ID'],
+            },
+          },
+        },
+      }],
+    },
+    stateMachineType: StateMachineType.STANDARD,
+    definition: {
+      States: {
+        Branches: [
+          {
+            StartAt: 'ResumeCluster',
+            States: {
+              'ResumeCluster': {
+                Type: 'Task',
+                Parameters: {
+                  ClusterIdentifier: 'MyData',
+                },
+                Resource: 'arn:aws:states:::aws-sdk:redshift:resumeCluster',
+                Next: 'DescribeClusters',
+              },
+              'DescribeClusters': {
+                Type: 'Task',
+                Parameters: {
+                  ClusterIdentifier: '',
+                },
+                Resource: 'arn:aws:states:::aws-sdk:redshift:describeClusters',
+                Next: 'Evaluate Cluster Status',
+              },
+              'Evaluate Cluster Status': {
+                Type: 'Choice',
+                Choices: [
+                  {
+                    Variable: '$.Clusters[0].ClusterStatus',
+                    StringEquals: 'available',
+                    Next: 'Redshift Pass',
+                  },
+                ],
+                Default: 'Redshift Wait',
+              },
+              'Redshift Pass': {
+                Type: 'Pass',
+                End: true,
+              },
+              'Redshift Wait': {
+                Type: 'Wait',
+                Seconds: 5,
+                Next: 'DescribeClusters',
+              },
+            },
+          },
+          {
+            StartAt: 'StartInstances',
+            States: {
+              'StartInstances': {
+                Type: 'Task',
+                Parameters: {
+                  InstanceIds: [
+                    'MyData',
+                  ],
+                },
+                Resource: 'arn:aws:states:::aws-sdk:ec2:startInstances',
+                Next: 'DescribeInstanceStatus',
+              },
+              'DescribeInstanceStatus': {
+                Type: 'Task',
+                Next: 'Evaluate Instance Status',
+                Parameters: {
+                  InstanceIds: [
+                    'MyData',
+                  ],
+                },
+                Resource: 'arn:aws:states:::aws-sdk:ec2:describeInstanceStatus',
+              },
+              'Evaluate Instance Status': {
+                Type: 'Choice',
+                Choices: [
+                  {
+                    And: [
+                      {
+                        Variable: '$.InstanceStatuses[0].InstanceState.Name',
+                        StringEquals: 'running',
+                      },
+                      {
+                        Variable: '$.InstanceStatuses[0].SystemStatus.Details[0].Status',
+                        StringEquals: 'passed',
+                      },
+                      {
+                        Variable: '$.InstanceStatuses[0].InstanceStatus.Details[0].Status',
+                        StringEquals: 'passed',
+                      },
+                    ],
+                    Next: 'EC2 Pass',
+                  },
+                ],
+                Default: 'EC2 Wait',
+              },
+              'EC2 Pass': {
+                Type: 'Pass',
+                End: true,
+              },
+              'EC2 Wait': {
+                Type: 'Wait',
+                Seconds: 5,
+                Next: 'DescribeInstanceStatus',
+              },
+            },
+          },
+        ],
+      },
+    },
+  });
+```
+
+
+
 For Python, be sure to use a context manager when opening your JSON file.  
 - You do not need to `str()` the dictionary object you supply as your `definition` prop.  
 - Elements of your override path **do** need to be strings.
diff --git a/package.json b/package.json
index 60cfd7d..c3be9f0 100644
--- a/package.json
+++ b/package.json
@@ -48,9 +48,9 @@
     "eslint-plugin-import": "^2.25.4",
     "jest": "^27.5.1",
     "jest-junit": "^13",
-    "jsii": "^1.54.0",
-    "jsii-diff": "^1.54.0",
-    "jsii-docgen": "^6.1.7",
+    "jsii": "^1.55.1",
+    "jsii-diff": "^1.55.1",
+    "jsii-docgen": "^6.3.1",
     "json-schema": "^0.4.0",
     "projen": "^0.52.34",
     "standard-version": "^9",
@@ -61,6 +61,12 @@
     "aws-cdk-lib": "^2.4.0",
     "constructs": "^10.0.5"
   },
+  "dependencies": {
+    "lodash.merge": "^4.6.2"
+  },
+  "bundledDependencies": [
+    "lodash.merge"
+  ],
   "keywords": [
     "AWS Step Functions",
     "awscdk",
diff --git a/src/StateMachine.ts b/src/StateMachine.ts
index c6de450..bc3d8ab 100644
--- a/src/StateMachine.ts
+++ b/src/StateMachine.ts
@@ -3,6 +3,8 @@ import * as iam from 'aws-cdk-lib/aws-iam';
 import * as aws_stepfunctions from 'aws-cdk-lib/aws-stepfunctions';
 import { CfnStateMachine, LogOptions, Pass, StateMachineType } from 'aws-cdk-lib/aws-stepfunctions';
 import { Construct } from 'constructs';
+// eslint-disable-next-line @typescript-eslint/no-require-imports
+const merge = require('lodash.merge');
 
 export interface StateMachineProps {
 
@@ -70,49 +72,8 @@ export class StateMachine extends aws_stepfunctions.StateMachine {
       definition: new Pass(scope, 'THISWILLBEDELETEDRIGHTAWAY'),
     });
     scope.node.tryRemoveChild('THISWILLBEDELETEDRIGHTAWAY');
-    (this.node.defaultChild as CfnStateMachine).definitionString = JSON.stringify(StateMachine.smash(props.definition, props.overrides));
-  }
-
-
-  // eslint-disable-next-line @typescript-eslint/member-ordering
-  public static smash(definition: any, smash: any = {}) {
-    let states = definition.States;
-    for (let key in smash) {
-      if (states[key]) {
-        states[key] = mergeDeep(states[key], smash[key]);
-      }
-    }
-    return {
-      ...definition,
-      States: states,
-    };
+    const mergedDefinition = merge(props.definition, { States: props.overrides });
+    (this.node.defaultChild as CfnStateMachine).definitionString = JSON.stringify(mergedDefinition);
   }
 }
 
-/**
- * Performs a deep merge of objects and returns new object. Does not modify
- * objects (immutable) and merges arrays via concatenation.
- *
- * @param {...object} objects - Objects to merge
- * @returns {object} New object with merged key/values
- */
-function mergeDeep(...objects: any[]) {
-  const isObject = (obj: any) => obj && typeof obj === 'object';
-
-  return objects.reduce((prev, obj) => {
-    Object.keys(obj).forEach(key => {
-      const pVal = prev[key];
-      const oVal = obj[key];
-
-      if (Array.isArray(pVal) && Array.isArray(oVal)) {
-        prev[key] = pVal.concat(...oVal);
-      } else if (isObject(pVal) && isObject(oVal)) {
-        prev[key] = mergeDeep(pVal, oVal);
-      } else {
-        prev[key] = oVal;
-      }
-    });
-
-    return prev;
-  }, {});
-}
diff --git a/yarn.lock b/yarn.lock
index 054c938..81a39f3 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -540,18 +540,18 @@
     "@jridgewell/resolve-uri" "^3.0.3"
     "@jridgewell/sourcemap-codec" "^1.4.10"
 
-"@jsii/check-node@1.54.0":
-  version "1.54.0"
-  resolved "https://registry.yarnpkg.com/@jsii/check-node/-/check-node-1.54.0.tgz#6cee236d2267c1d4df4cd58aacffdf7fbf87ebe7"
-  integrity sha512-pogNR1vgiXgBK2DQF+RsCnJQ9QPe+y7lyoRlsTtUplIFB6ryWnSsmCyzkInSVoKAKCo5CHkuDy190MbYL4Ns4Q==
+"@jsii/check-node@1.56.0":
+  version "1.56.0"
+  resolved "https://registry.yarnpkg.com/@jsii/check-node/-/check-node-1.56.0.tgz#8667962c21b55e498a387df36a7334585d0561ab"
+  integrity sha512-OJZGt2lO7ITY5fnqa0RCBnlaEORCIQq/AWMsJ2OcwOSOGj1Ua+9nsiBvsJ7Dm77k3jLx3IN0odD6/bwP6hQWCA==
   dependencies:
     chalk "^4.1.2"
     semver "^7.3.5"
 
-"@jsii/spec@1.54.0", "@jsii/spec@^1.54.0":
-  version "1.54.0"
-  resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.54.0.tgz#4d03e8386a81b5db0e292a5ff3df6b265ba5ad07"
-  integrity sha512-IOspxWPC26+Re6DNJvaxCEkG1BYByiGSPlRxQpIpts+Hx2EZgAvuG+8rQoryNt7JqaAKpcJ6W3OdRmSw3x5Yrg==
+"@jsii/spec@1.56.0", "@jsii/spec@^1.56.0":
+  version "1.56.0"
+  resolved "https://registry.yarnpkg.com/@jsii/spec/-/spec-1.56.0.tgz#c7012ddbc945df0748319d664e3680265168fa59"
+  integrity sha512-nwjVYCXw/KMRokwErkZmSBmYmym3theTptNSaWITwCGSyfDIEvw4ud83CYB3fN4Soa2jsFmIJ2rFffeVuBkOyw==
   dependencies:
     jsonschema "^1.4.0"
 
@@ -836,10 +836,10 @@
     "@typescript-eslint/types" "5.12.0"
     eslint-visitor-keys "^3.0.0"
 
-"@xmldom/xmldom@^0.8.0":
-  version "0.8.1"
-  resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.1.tgz#70c239275fc6d6a84e41b9a8d623a93c0d59b6b4"
-  integrity sha512-4wOae+5N2RZ+CZXd9ZKwkaDi55IxrSTOjHpxTvQQ4fomtOJmqVxbmICA9jE1jvnqNhpfgz8cnfFagG86wV/xLQ==
+"@xmldom/xmldom@^0.8.2":
+  version "0.8.2"
+  resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.2.tgz#b695ff674e8216efa632a3d36ad51ae9843380c0"
+  integrity sha512-+R0juSseERyoPvnBQ/cZih6bpF7IpCXlWbHRoCRzYzqpz6gWHOgf8o4MOEf6KBVuOyqU+gCNLkCWVIJAro8XyQ==
 
 JSONStream@^1.0.4:
   version "1.3.5"
@@ -1522,17 +1522,17 @@ data-urls@^2.0.0:
     whatwg-mimetype "^2.3.0"
     whatwg-url "^8.0.0"
 
-date-format@^4.0.3:
-  version "4.0.3"
-  resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.3.tgz#f63de5dc08dc02efd8ef32bf2a6918e486f35873"
-  integrity sha512-7P3FyqDcfeznLZp2b+OMitV9Sz2lUnsT87WaTat9nVwqsBkTzPG3lPLNwW3en6F4pHUiWzr6vb8CLhjdK9bcxQ==
+date-format@^4.0.6:
+  version "4.0.6"
+  resolved "https://registry.yarnpkg.com/date-format/-/date-format-4.0.6.tgz#f6138b8f17968df9815b3d101fc06b0523f066c5"
+  integrity sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==
 
 dateformat@^3.0.0:
   version "3.0.3"
   resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
   integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==
 
-debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3:
+debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2:
   version "4.3.3"
   resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
   integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
@@ -1553,6 +1553,13 @@ debug@^3.2.7:
   dependencies:
     ms "^2.1.1"
 
+debug@^4.3.4:
+  version "4.3.4"
+  resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
+  integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
+  dependencies:
+    ms "2.1.2"
+
 decamelize-keys@^1.1.0:
   version "1.1.0"
   resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9"
@@ -2087,7 +2094,7 @@ flat-cache@^3.0.4:
     flatted "^3.1.0"
     rimraf "^3.0.2"
 
-flatted@^3.1.0, flatted@^3.2.4:
+flatted@^3.1.0, flatted@^3.2.5:
   version "3.2.5"
   resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3"
   integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==
@@ -2113,10 +2120,10 @@ fs-access@^1.0.1:
   dependencies:
     null-check "^1.0.0"
 
-fs-extra@^10.0.0:
-  version "10.0.0"
-  resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1"
-  integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==
+fs-extra@^10.0.1:
+  version "10.0.1"
+  resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.1.tgz#27de43b4320e833f6867cc044bfce29fdf0ef3b8"
+  integrity sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==
   dependencies:
     graceful-fs "^4.2.0"
     jsonfile "^6.0.1"
@@ -3196,81 +3203,81 @@ jsesc@^2.5.1:
   resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
   integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==
 
-jsii-diff@^1.54.0:
-  version "1.54.0"
-  resolved "https://registry.yarnpkg.com/jsii-diff/-/jsii-diff-1.54.0.tgz#d5af99ac0ce84f0f9bd5eaad4f37d49294f2a319"
-  integrity sha512-PKyEgMo/9UqSZs23m7EM+2fGsmNdA7XfZNCqIt0xBdPnkvU4paeAzVUHHfU9e/iRVMmK49/Z0txWbHWNd+58DA==
+jsii-diff@^1.55.1:
+  version "1.56.0"
+  resolved "https://registry.yarnpkg.com/jsii-diff/-/jsii-diff-1.56.0.tgz#161c0bcfb99aea43e423d52d69ca9219b2a28b5c"
+  integrity sha512-ivw3GyiFxzJaLYBinuJSoxpLsVidrmY5FmwU0VtdXKT1KounLpnywHkx82VRmrDAfsl8Afoi8yrlSNqPpj0ylA==
   dependencies:
-    "@jsii/check-node" "1.54.0"
-    "@jsii/spec" "^1.54.0"
+    "@jsii/check-node" "1.56.0"
+    "@jsii/spec" "^1.56.0"
     fs-extra "^9.1.0"
-    jsii-reflect "^1.54.0"
-    log4js "^6.4.1"
+    jsii-reflect "^1.56.0"
+    log4js "^6.4.4"
     typescript "~3.9.10"
     yargs "^16.2.0"
 
-jsii-docgen@^6.1.7:
-  version "6.1.7"
-  resolved "https://registry.yarnpkg.com/jsii-docgen/-/jsii-docgen-6.1.7.tgz#552f13405a6353ab066c27f6048a4a9040a4adbc"
-  integrity sha512-xEpfVBWHKsHoakxXDfQ5N52ViCnxk0AZvt8xTUGDukEvoCodVaoMtjLRKabzrqBDUF871ka2g0+2OJsSeaSMTA==
+jsii-docgen@^6.3.1:
+  version "6.3.7"
+  resolved "https://registry.yarnpkg.com/jsii-docgen/-/jsii-docgen-6.3.7.tgz#7a7fc185a5f28dd487716b39980205e8d8989a37"
+  integrity sha512-bRD13VHMNwlKV+HsKpUVSCECqCRCGW/xV2e+HH8dzLUODec2B0N3MFxL/uDncV+TnpXI1JUj6UsqOPr1E0wM/A==
   dependencies:
-    "@jsii/spec" "^1.54.0"
+    "@jsii/spec" "^1.56.0"
     case "^1.6.3"
-    fs-extra "^10.0.0"
+    fs-extra "^10.0.1"
     glob "^7.2.0"
     glob-promise "^3.4.0"
-    jsii-reflect "^1.54.0"
-    jsii-rosetta "^1.54.0"
-    semver "^7.3.5"
+    jsii-reflect "^1.56.0"
+    jsii-rosetta "^1.56.0"
+    semver "^7.3.6"
     yargs "^16.2.0"
 
-jsii-reflect@^1.54.0:
-  version "1.54.0"
-  resolved "https://registry.yarnpkg.com/jsii-reflect/-/jsii-reflect-1.54.0.tgz#fda7e812d460e062f699d17dc166c5398b147b17"
-  integrity sha512-wB4hxHTAN4LEBVg/Y5sr3Sbh3Xe2+jrYIftnhT+2mmhMexHj3U0RhjPW/MFXxRTbiSgDad1fbw5VkJYDWnpGXw==
+jsii-reflect@^1.56.0:
+  version "1.56.0"
+  resolved "https://registry.yarnpkg.com/jsii-reflect/-/jsii-reflect-1.56.0.tgz#23d78f9c81ba048be780a96eeafea4775ee721e2"
+  integrity sha512-OGpINABFiiwnvndlLjJU3mZSaXwzyuLyIkKidAV24PLS5XkFZYKXlA+Qz6HA8AWdDNJVCW0S9AbAr3Ab4J6QDQ==
   dependencies:
-    "@jsii/check-node" "1.54.0"
-    "@jsii/spec" "^1.54.0"
+    "@jsii/check-node" "1.56.0"
+    "@jsii/spec" "^1.56.0"
     chalk "^4"
     fs-extra "^9.1.0"
-    oo-ascii-tree "^1.54.0"
+    oo-ascii-tree "^1.56.0"
     yargs "^16.2.0"
 
-jsii-rosetta@^1.54.0:
-  version "1.54.0"
-  resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.54.0.tgz#35a53cc20c17f84be71aecba0573b3aa4c62f581"
-  integrity sha512-fxgx9L5eWzyMC1IEkDitxgcraHUuZbQQVQztJtZHw/QlZ9n0DUjfbKrefJQ2HpobtI9ZV2fDEYjuwZDBAVBdsA==
+jsii-rosetta@^1.56.0:
+  version "1.56.0"
+  resolved "https://registry.yarnpkg.com/jsii-rosetta/-/jsii-rosetta-1.56.0.tgz#3192638adafdee2e7bd6b5e83d0b77468a04d13d"
+  integrity sha512-aeFHXnO9hQXirgLjYqYMoAdvBGnpLOEhRVe4w7RuYjaqwsIPof4xIfSj2YvNQ9ZAWalYpg1Tm8kiLeWEyEeX6w==
   dependencies:
-    "@jsii/check-node" "1.54.0"
-    "@jsii/spec" "1.54.0"
-    "@xmldom/xmldom" "^0.8.0"
+    "@jsii/check-node" "1.56.0"
+    "@jsii/spec" "1.56.0"
+    "@xmldom/xmldom" "^0.8.2"
     commonmark "^0.30.0"
     fast-glob "^3.2.11"
     fs-extra "^9.1.0"
-    jsii "1.54.0"
+    jsii "1.56.0"
     semver "^7.3.5"
     semver-intersect "^1.4.0"
-    sort-json "^2.0.0"
+    sort-json "^2.0.1"
     typescript "~3.9.10"
     workerpool "^6.2.0"
     yargs "^16.2.0"
 
-jsii@1.54.0, jsii@^1.54.0:
-  version "1.54.0"
-  resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.54.0.tgz#300fabed7204ec7afab2f3cf6e45faffc00067a7"
-  integrity sha512-XuqGpmGIxFcX2GvX3zjcHBzBeZ7+tJ7hr5tu/7qV6wQ/thXuZFdAoj2znSgBkpGOt6mjtRuqv01HIRl25Nys5g==
+jsii@1.56.0, jsii@^1.55.1:
+  version "1.56.0"
+  resolved "https://registry.yarnpkg.com/jsii/-/jsii-1.56.0.tgz#22de00f37595fc0412e698d01adc9076c587addf"
+  integrity sha512-G1etNH8JRSfSlgicTBYsi/yVUxxreMnWYwAtXN6BH/sIiv5o6gFnYkumF2x+OTqmQAkKj1NxSssn5icvOrONzA==
   dependencies:
-    "@jsii/check-node" "1.54.0"
-    "@jsii/spec" "^1.54.0"
+    "@jsii/check-node" "1.56.0"
+    "@jsii/spec" "^1.56.0"
     case "^1.6.3"
     chalk "^4"
     deep-equal "^2.0.5"
     fs-extra "^9.1.0"
-    log4js "^6.4.1"
+    log4js "^6.4.4"
     semver "^7.3.5"
     semver-intersect "^1.4.0"
-    sort-json "^2.0.0"
-    spdx-license-list "^6.4.0"
+    sort-json "^2.0.1"
+    spdx-license-list "^6.5.0"
     typescript "~3.9.10"
     yargs "^16.2.0"
 
@@ -3433,16 +3440,16 @@ lodash@^4.17.15, lodash@^4.7.0:
   resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
   integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
 
-log4js@^6.4.1:
-  version "6.4.1"
-  resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.1.tgz#9d3a8bf2c31c1e213fe3fc398a6053f7a2bc53e8"
-  integrity sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==
+log4js@^6.4.4:
+  version "6.4.4"
+  resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.4.4.tgz#c9bc75569f3f40bba22fe1bd0677afa7a6a13bac"
+  integrity sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw==
   dependencies:
-    date-format "^4.0.3"
-    debug "^4.3.3"
-    flatted "^3.2.4"
+    date-format "^4.0.6"
+    debug "^4.3.4"
+    flatted "^3.2.5"
     rfdc "^1.3.0"
-    streamroller "^3.0.2"
+    streamroller "^3.0.6"
 
 lru-cache@^6.0.0:
   version "6.0.0"
@@ -3451,6 +3458,11 @@ lru-cache@^6.0.0:
   dependencies:
     yallist "^4.0.0"
 
+lru-cache@^7.4.0:
+  version "7.8.1"
+  resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.8.1.tgz#68ee3f4807a57d2ba185b7fd90827d5c21ce82bb"
+  integrity sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==
+
 make-dir@^3.0.0:
   version "3.1.0"
   resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
@@ -3701,10 +3713,10 @@ onetime@^5.1.2:
   dependencies:
     mimic-fn "^2.1.0"
 
-oo-ascii-tree@^1.54.0:
-  version "1.54.0"
-  resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.54.0.tgz#fc99fa3e9f3fb5184e00ab8c88619ea4c6994e1c"
-  integrity sha512-EAk5I5GHidk2lvqwcfR1bl/EeK1Pns8BMzzFKle6clapov3LX54l3k70VGHQDLsHo42dy9UJe23mJPVpg9iTcg==
+oo-ascii-tree@^1.56.0:
+  version "1.56.0"
+  resolved "https://registry.yarnpkg.com/oo-ascii-tree/-/oo-ascii-tree-1.56.0.tgz#be7313106598e33b6159a48547eba70140286ae5"
+  integrity sha512-tPOSOEjN1uq2NktoBU2KExOU9lVghkpg+tDLWMtnqSSmX+lnDJIYIFpa/HqXwyiAXoHpcKh+bcmTPMZagLNIZA==
 
 optionator@^0.8.1:
   version "0.8.3"
@@ -4160,6 +4172,13 @@ semver@^6.0.0, semver@^6.3.0:
   resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
   integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
 
+semver@^7.3.6:
+  version "7.3.6"
+  resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.6.tgz#5d73886fb9c0c6602e79440b97165c29581cbb2b"
+  integrity sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==
+  dependencies:
+    lru-cache "^7.4.0"
+
 shebang-command@^2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
@@ -4213,7 +4232,7 @@ slash@^3.0.0:
   resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
   integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
 
-sort-json@^2.0.0:
+sort-json@^2.0.1:
   version "2.0.1"
   resolved "https://registry.yarnpkg.com/sort-json/-/sort-json-2.0.1.tgz#7338783bef807185dc37d5b02e3afd905d537cfb"
   integrity sha512-s8cs2bcsQCzo/P2T/uoU6Js4dS/jnX8+4xunziNoq9qmSpZNCrRIAIvp4avsz0ST18HycV4z/7myJ7jsHWB2XQ==
@@ -4271,10 +4290,10 @@ spdx-license-ids@^3.0.0:
   resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz#50c0d8c40a14ec1bf449bae69a0ea4685a9d9f95"
   integrity sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==
 
-spdx-license-list@^6.4.0:
-  version "6.4.0"
-  resolved "https://registry.yarnpkg.com/spdx-license-list/-/spdx-license-list-6.4.0.tgz#9850c3699c1d35745285607d064d2a5145049d12"
-  integrity sha512-4BxgJ1IZxTJuX1YxMGu2cRYK46Bk9zJNTK2/R0wNZR0cm+6SVl26/uG7FQmQtxoJQX1uZ0EpTi2L7zvMLboaBA==
+spdx-license-list@^6.5.0:
+  version "6.5.0"
+  resolved "https://registry.yarnpkg.com/spdx-license-list/-/spdx-license-list-6.5.0.tgz#1624b9cd6c517ff8d697610e6c22d7f5b7c63d28"
+  integrity sha512-28O9GgFrMg2Wp8tVML0Zk+fnXaECy7UbB6pxo+93whHay/nqPyEdM07Cx6B4+j2pniUZTYr57OaIOyNTxsTwtw==
 
 split2@^3.0.0:
   version "3.2.2"
@@ -4323,14 +4342,14 @@ standard-version@^9:
     stringify-package "^1.0.1"
     yargs "^16.0.0"
 
-streamroller@^3.0.2:
-  version "3.0.2"
-  resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.2.tgz#30418d0eee3d6c93ec897f892ed098e3a81e68b7"
-  integrity sha512-ur6y5S5dopOaRXBuRIZ1u6GC5bcEXHRZKgfBjfCglMhmIf+roVCECjvkEYzNQOXIN2/JPnkMPW/8B3CZoKaEPA==
+streamroller@^3.0.6:
+  version "3.0.6"
+  resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-3.0.6.tgz#52823415800ded79a49aa3f7712f50a422b97493"
+  integrity sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==
   dependencies:
-    date-format "^4.0.3"
-    debug "^4.1.1"
-    fs-extra "^10.0.0"
+    date-format "^4.0.6"
+    debug "^4.3.4"
+    fs-extra "^10.0.1"
 
 string-length@^4.0.1:
   version "4.0.2"


Test patch:
diff --git a/test/StateMachine.test.ts b/test/StateMachine.test.ts
index 03ec83a..1a9a130 100644
--- a/test/StateMachine.test.ts
+++ b/test/StateMachine.test.ts
@@ -3,7 +3,7 @@ import { Template } from 'aws-cdk-lib/assertions';
 import { StateMachineType } from 'aws-cdk-lib/aws-stepfunctions';
 import { StateMachine } from '../src';
 
-test('snapshot', () => {
+test('simple snapshot', () => {
   const stack = new Stack(new App(), 'TestingStack', {});
   new StateMachine(stack, 'Test', {
     stateMachineName: 'A-nice-state-machine',
@@ -14,3 +14,249 @@ test('snapshot', () => {
   const assert = Template.fromStack(stack);
   expect(assert.toJSON()).toMatchSnapshot();
 });
+
+test('handles arrays', () => {
+  const stack = new Stack(new App(), 'TestingStack', {});
+  new StateMachine(stack, 'Test', {
+    stateMachineName: 'A-nice-state-machine',
+    overrides: {
+      Branches: [{
+        StartAt: 'ResumeCluster',
+        States: {
+          ResumeCluster: {
+            Parameters: {
+              ClusterIdentifier: 'CLUSTER_NAME',
+            },
+          },
+          DescribeClusters: {
+            Parameters: {
+              ClusterIdentifier: 'CLUSTER_NAME',
+            },
+          },
+        },
+      }, {
+        StartAt: 'StartInstances',
+        States: {
+          StartInstances: {
+            Parameters: {
+              InstanceIds: ['INSTANCE_ID'],
+            },
+          },
+          DescribeInstanceStatus: {
+            Parameters: {
+              InstanceIds: ['INSTANCE_ID'],
+            },
+          },
+        },
+      }],
+    },
+    stateMachineType: StateMachineType.STANDARD,
+    definition: {
+      States: {
+        Branches: [
+          {
+            StartAt: 'ResumeCluster',
+            States: {
+              'ResumeCluster': {
+                Type: 'Task',
+                Parameters: {
+                  ClusterIdentifier: 'MyData',
+                },
+                Resource: 'arn:aws:states:::aws-sdk:redshift:resumeCluster',
+                Next: 'DescribeClusters',
+              },
+              'DescribeClusters': {
+                Type: 'Task',
+                Parameters: {
+                  ClusterIdentifier: '',
+                },
+                Resource: 'arn:aws:states:::aws-sdk:redshift:describeClusters',
+                Next: 'Evaluate Cluster Status',
+              },
+              'Evaluate Cluster Status': {
+                Type: 'Choice',
+                Choices: [
+                  {
+                    Variable: '$.Clusters[0].ClusterStatus',
+                    StringEquals: 'available',
+                    Next: 'Redshift Pass',
+                  },
+                ],
+                Default: 'Redshift Wait',
+              },
+              'Redshift Pass': {
+                Type: 'Pass',
+                End: true,
+              },
+              'Redshift Wait': {
+                Type: 'Wait',
+                Seconds: 5,
+                Next: 'DescribeClusters',
+              },
+            },
+          },
+          {
+            StartAt: 'StartInstances',
+            States: {
+              'StartInstances': {
+                Type: 'Task',
+                Parameters: {
+                  InstanceIds: [
+                    'MyData',
+                  ],
+                },
+                Resource: 'arn:aws:states:::aws-sdk:ec2:startInstances',
+                Next: 'DescribeInstanceStatus',
+              },
+              'DescribeInstanceStatus': {
+                Type: 'Task',
+                Next: 'Evaluate Instance Status',
+                Parameters: {
+                  InstanceIds: [
+                    'MyData',
+                  ],
+                },
+                Resource: 'arn:aws:states:::aws-sdk:ec2:describeInstanceStatus',
+              },
+              'Evaluate Instance Status': {
+                Type: 'Choice',
+                Choices: [
+                  {
+                    And: [
+                      {
+                        Variable: '$.InstanceStatuses[0].InstanceState.Name',
+                        StringEquals: 'running',
+                      },
+                      {
+                        Variable: '$.InstanceStatuses[0].SystemStatus.Details[0].Status',
+                        StringEquals: 'passed',
+                      },
+                      {
+                        Variable: '$.InstanceStatuses[0].InstanceStatus.Details[0].Status',
+                        StringEquals: 'passed',
+                      },
+                    ],
+                    Next: 'EC2 Pass',
+                  },
+                ],
+                Default: 'EC2 Wait',
+              },
+              'EC2 Pass': {
+                Type: 'Pass',
+                End: true,
+              },
+              'EC2 Wait': {
+                Type: 'Wait',
+                Seconds: 5,
+                Next: 'DescribeInstanceStatus',
+              },
+            },
+          },
+        ],
+      },
+    },
+  });
+  const assert = Template.fromStack(stack);
+  assert.hasResourceProperties('AWS::StepFunctions::StateMachine', {
+    DefinitionString: JSON.stringify({
+      States: {
+        Branches: [
+          {
+            StartAt: 'ResumeCluster',
+            States: {
+              'ResumeCluster': {
+                Type: 'Task',
+                Parameters: {
+                  ClusterIdentifier: 'CLUSTER_NAME',
+                },
+                Resource: 'arn:aws:states:::aws-sdk:redshift:resumeCluster',
+                Next: 'DescribeClusters',
+              },
+              'DescribeClusters': {
+                Type: 'Task',
+                Parameters: {
+                  ClusterIdentifier: 'CLUSTER_NAME',
+                },
+                Resource: 'arn:aws:states:::aws-sdk:redshift:describeClusters',
+                Next: 'Evaluate Cluster Status',
+              },
+              'Evaluate Cluster Status': {
+                Type: 'Choice',
+                Choices: [
+                  {
+                    Variable: '$.Clusters[0].ClusterStatus',
+                    StringEquals: 'available',
+                    Next: 'Redshift Pass',
+                  },
+                ],
+                Default: 'Redshift Wait',
+              },
+              'Redshift Pass': {
+                Type: 'Pass',
+                End: true,
+              },
+              'Redshift Wait': {
+                Type: 'Wait',
+                Seconds: 5,
+                Next: 'DescribeClusters',
+              },
+            },
+          },
+          {
+            StartAt: 'StartInstances',
+            States: {
+              'StartInstances': {
+                Type: 'Task',
+                Parameters: {
+                  InstanceIds: ['INSTANCE_ID'],
+                },
+                Resource: 'arn:aws:states:::aws-sdk:ec2:startInstances',
+                Next: 'DescribeInstanceStatus',
+              },
+              'DescribeInstanceStatus': {
+                Type: 'Task',
+                Next: 'Evaluate Instance Status',
+                Parameters: {
+                  InstanceIds: ['INSTANCE_ID'],
+                },
+                Resource: 'arn:aws:states:::aws-sdk:ec2:describeInstanceStatus',
+              },
+              'Evaluate Instance Status': {
+                Type: 'Choice',
+                Choices: [
+                  {
+                    And: [
+                      {
+                        Variable: '$.InstanceStatuses[0].InstanceState.Name',
+                        StringEquals: 'running',
+                      },
+                      {
+                        Variable: '$.InstanceStatuses[0].SystemStatus.Details[0].Status',
+                        StringEquals: 'passed',
+                      },
+                      {
+                        Variable: '$.InstanceStatuses[0].InstanceStatus.Details[0].Status',
+                        StringEquals: 'passed',
+                      },
+                    ],
+                    Next: 'EC2 Pass',
+                  },
+                ],
+                Default: 'EC2 Wait',
+              },
+              'EC2 Pass': {
+                Type: 'Pass',
+                End: true,
+              },
+              'EC2 Wait': {
+                Type: 'Wait',
+                Seconds: 5,
+                Next: 'DescribeInstanceStatus',
+              },
+            },
+          },
+        ],
+      },
+    }),
+  });
+});
diff --git a/test/__snapshots__/StateMachine.test.ts.snap b/test/__snapshots__/StateMachine.test.ts.snap
index 8da7096..cf1cd92 100644
--- a/test/__snapshots__/StateMachine.test.ts.snap
+++ b/test/__snapshots__/StateMachine.test.ts.snap
@@ -1,6 +1,6 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`snapshot 1`] = `
+exports[`simple snapshot 1`] = `
 Object {
   "Mappings": Object {
     "ServiceprincipalMap": Object {