diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts index 5fbcce0aae23e..a8aab766ba8cc 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/map.ts @@ -80,7 +80,7 @@ export interface MapProps { * * @default $ * @deprecated Step Functions has deprecated the `parameters` field in favor of - * the new `itemSelector` field. + * the new `itemSelector` field * @see * https://docs.aws.amazon.com/step-functions/latest/dg/input-output-itemselector.html */ diff --git a/packages/@aws-cdk/aws-stepfunctions/test/map.test.ts b/packages/@aws-cdk/aws-stepfunctions/test/map.test.ts index e88c01ae4d83c..a6df1febb35dc 100644 --- a/packages/@aws-cdk/aws-stepfunctions/test/map.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions/test/map.test.ts @@ -1,8 +1,9 @@ +import { testDeprecated } from '@aws-cdk/cdk-build-tools'; import * as cdk from '@aws-cdk/core'; import * as stepfunctions from '../lib'; describe('Map State', () => { - test('State Machine With Map State', () => { + test('State Machine With Map State and ItemSelector', () => { // GIVEN const stack = new cdk.Stack(); @@ -47,6 +48,51 @@ describe('Map State', () => { }); }), + testDeprecated('State Machine With Map State and Parameters', () => { + // GIVEN + const stack = new cdk.Stack(); + + // WHEN + const map = new stepfunctions.Map(stack, 'Map State', { + maxConcurrency: 1, + itemsPath: stepfunctions.JsonPath.stringAt('$.inputForMap'), + parameters: { + foo: 'foo', + bar: stepfunctions.JsonPath.stringAt('$.bar'), + }, + }); + map.iterator(new stepfunctions.Pass(stack, 'Pass State')); + + // THEN + expect(render(map)).toStrictEqual({ + StartAt: 'Map State', + States: { + 'Map State': { + Type: 'Map', + End: true, + Parameters: { + 'foo': 'foo', + 'bar.$': '$.bar', + }, + ItemProcessor: { + ProcessorConfig: { + Mode: stepfunctions.MapStateMode.INLINE, + }, + StartAt: 'Pass State', + States: { + 'Pass State': { + Type: 'Pass', + End: true, + }, + }, + }, + ItemsPath: '$.inputForMap', + MaxConcurrency: 1, + }, + }, + }); + }), + test('State Machine With Map State and ResultSelector', () => { // GIVEN const stack = new cdk.Stack();