diff --git a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts index 53bf6b7fb32fd..4da2094aa8f63 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/instance-types.ts @@ -596,6 +596,16 @@ export enum InstanceClass { */ I4I = 'i4i', + /** + * Storage optimized instances powered by Graviton2 processor, 4th generation + */ + STORAGE4_GRAVITON = 'storage4_graviton', + + /** + * Storage optimized instances powered by Graviton2 processor, 4th generation + */ + I4G = 'i4g', + /** * Storage optimized instances powered by Graviton2 processor, 4th generation */ @@ -1291,6 +1301,8 @@ export class InstanceType { [InstanceClass.I3]: 'i3', [InstanceClass.IO3_DENSE_NVME_DRIVE]: 'i3en', [InstanceClass.I3EN]: 'i3en', + [InstanceClass.STORAGE4_GRAVITON]: 'i4g', + [InstanceClass.I4G]: 'i4g', [InstanceClass.STORAGE4_GRAVITON_NETWORK_OPTIMIZED]: 'im4gn', [InstanceClass.IM4GN]: 'im4gn', [InstanceClass.STORAGE4_GRAVITON_NETWORK_STORAGE_OPTIMIZED]: 'is4gen', diff --git a/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/aws-sdk/call-aws-service.ts b/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/aws-sdk/call-aws-service.ts index 5df3508c5c855..b8f18f7593ca6 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/aws-sdk/call-aws-service.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/aws-sdk/call-aws-service.ts @@ -79,6 +79,15 @@ export class CallAwsService extends sfn.TaskStateBase { if (this.props.integrationPattern === sfn.IntegrationPattern.RUN_JOB) { throw new Error('The RUN_JOB integration pattern is not supported for CallAwsService'); } + if (!Token.isUnresolved(this.props.action) && !this.props.action.startsWith(this.props.action[0]?.toLowerCase())) { + throw new Error(`action must be camelCase, got: ${this.props.action}`); + } + if (this.props.parameters) { + const invalidKeys = Object.keys(this.props.parameters).filter(key => !key.startsWith(key[0]?.toUpperCase())); + if (invalidKeys.length) { + throw new Error(`parameter names must be PascalCase, got: ${invalidKeys.join(', ')}`); + } + } const iamServiceMap: Record = { sfn: 'states', diff --git a/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/aws-sdk/call-aws-service.test.ts b/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/aws-sdk/call-aws-service.test.ts index e6df2b2b369a8..d0b1b784a1f90 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/aws-sdk/call-aws-service.test.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/aws-sdk/call-aws-service.test.ts @@ -162,6 +162,30 @@ test('throws with invalid integration pattern', () => { })).toThrow(/The RUN_JOB integration pattern is not supported for CallAwsService/); }); +test('throws if action is not camelCase', () => { + expect(() => new tasks.CallAwsService(stack, 'GetObject', { + service: 's3', + action: 'GetObject', + parameters: { + Bucket: 'my-bucket', + Key: sfn.JsonPath.stringAt('$.key'), + }, + iamResources: ['*'], + })).toThrow(/action must be camelCase, got: GetObject/); +}); + +test('throws if parameters has keys as not PascalCase', () => { + expect(() => new tasks.CallAwsService(stack, 'GetObject', { + service: 's3', + action: 'getObject', + parameters: { + bucket: 'my-bucket', + key: sfn.JsonPath.stringAt('$.key'), + }, + iamResources: ['*'], + })).toThrow(/parameter names must be PascalCase, got: bucket, key/); +}); + test('can pass additional IAM statements', () => { // WHEN const task = new tasks.CallAwsService(stack, 'DetectLabels', {