Skip to content

Commit 026c1a7

Browse files
authored
Merge branch 'main' into mask_output_in_provider_framework
2 parents 091bf99 + 38e2ecf commit 026c1a7

File tree

3 files changed

+37
-24
lines changed

3 files changed

+37
-24
lines changed

ROADMAP.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The CDK team is committed to supporting our existing library of AWS L2 abstracti
7171
Thank you to our community members that have contributed to the project. Below are some of the great contributions from the community! We'll continue to update this list as contributions come in, and please feel free to reach out on the cdk.dev slack workspace if you have any questions or feedback.
7272

7373
- 🚀 [EventBridge Pipes Alpha Construct](https://github.com/aws/aws-cdk/pull/28388) - [Raphael Manke](https://github.com/RaphaelManke)
74-
- 🚀 [CodePipeline support for Git branch and file path based triggers](https://github.com/aws/aws-cdk/issues/29124) - [Kenta Goto](https://github.com/go-to-k)
74+
- 🚀 [CodePipeline support for pipeline type V2 with pipeline-level variables and triggers](https://github.com/aws/aws-cdk/pull/28538) - [Kenta Goto](https://github.com/go-to-k)
7575
- 🚀 [Cloudwatch Synthetics: Update to canary runtime support for NodeJS and Python](https://github.com/aws/aws-cdk/pull/29132) - [Henry Wilson](https://github.com/wilhen01)
7676
- 🚀 [EFS File System Replication](https://github.com/aws/aws-cdk/pull/29347) - [
7777
kazuho cryer-shinozuka](https://github.com/badmintoncryer)

packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/lambda/call-aws-service-cross-region.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { CrossRegionAwsSdkSingletonFunction } from '../../../custom-resource-han
1111
*/
1212
export interface CallAwsServiceCrossRegionProps extends sfn.TaskStateBaseProps {
1313
/**
14-
* The AWS service to call in AWS SDK for JavaScript v3 style.
14+
* The AWS service to call in AWS SDK for JavaScript v3 format.
1515
*
1616
* @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/
1717
* @example 's3'
@@ -26,9 +26,7 @@ export interface CallAwsServiceCrossRegionProps extends sfn.TaskStateBaseProps {
2626
readonly action: string;
2727

2828
/**
29-
* Parameters for the API action call.
30-
*
31-
* Use PascalCase for the parameter names.
29+
* Parameters for the API action call in AWS SDK for JavaScript v3 format.
3230
*
3331
* @default - no parameters
3432
*/
@@ -112,12 +110,6 @@ export class CallAwsServiceCrossRegion extends sfn.TaskStateBase {
112110
if (!Token.isUnresolved(props.action) && !props.action.startsWith(props.action[0]?.toLowerCase())) {
113111
throw new Error(`action must be camelCase, got: ${props.action}`);
114112
}
115-
if (props.parameters) {
116-
const invalidKeys = Object.keys(props.parameters).filter((key) => !key.startsWith(key[0]?.toUpperCase()));
117-
if (invalidKeys.length) {
118-
throw new Error(`parameter names must be PascalCase, got: ${invalidKeys.join(', ')}`);
119-
}
120-
}
121113

122114
// props.service expects a service name in the AWS SDK for JavaScript v3 format.
123115
// In some services, this format differs from the one used in IAM.

packages/aws-cdk-lib/aws-stepfunctions-tasks/test/lambda/call-aws-service-cross-region.test.ts

+34-13
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,40 @@ test('with custom IAM action', () => {
162162
});
163163
});
164164

165+
test('parameters with camelCase', () => {
166+
// WHEN
167+
const task = new tasks.CallAwsServiceCrossRegion(stack, 'GetRestApi', {
168+
service: 'api-gateway',
169+
action: 'getRestApi',
170+
parameters: {
171+
restApiId: 'id',
172+
},
173+
region: 'us-east-1',
174+
iamResources: ['*'],
175+
retryOnServiceExceptions: false,
176+
});
177+
178+
// THEN
179+
expect(stack.resolve(task.toStateJson())).toEqual({
180+
Type: 'Task',
181+
Resource: {
182+
'Fn::GetAtt': [
183+
'CrossRegionAwsSdk8a0c93f3dbef4b71ac137aaf2048ce7eF7430F4F',
184+
'Arn',
185+
],
186+
},
187+
End: true,
188+
Parameters: {
189+
action: 'getRestApi',
190+
region: 'us-east-1',
191+
service: 'api-gateway',
192+
parameters: {
193+
restApiId: 'id',
194+
},
195+
},
196+
});
197+
});
198+
165199
test('throws with invalid integration pattern', () => {
166200
expect(() => new tasks.CallAwsServiceCrossRegion(stack, 'GetObject', {
167201
integrationPattern: sfn.IntegrationPattern.RUN_JOB,
@@ -189,19 +223,6 @@ test('throws if action is not camelCase', () => {
189223
})).toThrow(/action must be camelCase, got: GetObject/);
190224
});
191225

192-
test('throws if parameters has keys as not PascalCase', () => {
193-
expect(() => new tasks.CallAwsServiceCrossRegion(stack, 'GetObject', {
194-
service: 's3',
195-
action: 'getObject',
196-
parameters: {
197-
bucket: 'my-bucket',
198-
key: sfn.JsonPath.stringAt('$.key'),
199-
},
200-
region: 'us-east-1',
201-
iamResources: ['*'],
202-
})).toThrow(/parameter names must be PascalCase, got: bucket, key/);
203-
});
204-
205226
test('can pass additional IAM statements', () => {
206227
// WHEN
207228
const task = new tasks.CallAwsServiceCrossRegion(stack, 'DetectLabels', {

0 commit comments

Comments
 (0)