From ba51ea34e5b3f3c3cf337754d339f724b395211e Mon Sep 17 00:00:00 2001 From: mirgj <17768831+mirgj@users.noreply.github.com> Date: Sat, 29 Aug 2020 06:24:40 +0800 Subject: [PATCH] fix(aws-stepfunctions-tasks): SageMaker create training job has incorrect property name for AttributeNames (#10026) Rename mistyped property `AtttributeNames` to `AttributeNames` Fixes #10014 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/sagemaker/create-training-job.ts | 2 +- .../test/sagemaker/create-training-job.test.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-training-job.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-training-job.ts index f8b4c73d00320..16a74559cf98f 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-training-job.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker/create-training-job.ts @@ -253,7 +253,7 @@ export class SageMakerCreateTrainingJob extends sfn.TaskStateBase implements iam ...(channel.dataSource.s3DataSource.s3DataDistributionType ? { S3DataDistributionType: channel.dataSource.s3DataSource.s3DataDistributionType } : {}), - ...(channel.dataSource.s3DataSource.attributeNames ? { AtttributeNames: channel.dataSource.s3DataSource.attributeNames } : {}), + ...(channel.dataSource.s3DataSource.attributeNames ? { AttributeNames: channel.dataSource.s3DataSource.attributeNames } : {}), }, }, ...(channel.compressionType ? { CompressionType: channel.compressionType } : {}), diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/create-training-job.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/create-training-job.test.ts index e4cd2ef1ce77f..b61ebd4173762 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/create-training-job.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker/create-training-job.test.ts @@ -153,6 +153,7 @@ test('create complex training job', () => { recordWrapperType: tasks.RecordWrapperType.RECORD_IO, dataSource: { s3DataSource: { + attributeNames: ['source-ref', 'class'], s3DataType: tasks.S3DataType.S3_PREFIX, s3Location: tasks.S3Location.fromBucket(s3.Bucket.fromBucketName(stack, 'InputBucketA', 'mybucket'), 'mytrainpath'), }, @@ -165,6 +166,7 @@ test('create complex training job', () => { recordWrapperType: tasks.RecordWrapperType.RECORD_IO, dataSource: { s3DataSource: { + attributeNames: ['source-ref', 'class'], s3DataType: tasks.S3DataType.S3_PREFIX, s3Location: tasks.S3Location.fromBucket(s3.Bucket.fromBucketName(stack, 'InputBucketB', 'mybucket'), 'mytestpath'), }, @@ -230,6 +232,7 @@ test('create complex training job', () => { ContentType: 'image/jpeg', DataSource: { S3DataSource: { + AttributeNames: ['source-ref', 'class'], S3DataType: 'S3Prefix', S3Uri: { 'Fn::Join': ['', ['https://s3.', { Ref: 'AWS::Region' }, '.', { Ref: 'AWS::URLSuffix' }, '/mybucket/mytrainpath']], @@ -244,6 +247,7 @@ test('create complex training job', () => { ContentType: 'image/jpeg', DataSource: { S3DataSource: { + AttributeNames: ['source-ref', 'class'], S3DataType: 'S3Prefix', S3Uri: { 'Fn::Join': ['', ['https://s3.', { Ref: 'AWS::Region' }, '.', { Ref: 'AWS::URLSuffix' }, '/mybucket/mytestpath']],