Skip to content

Commit

Permalink
choir(sfn): add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush987goyal committed Feb 21, 2020
1 parent c7e8f56 commit e405aa0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import * as sfn from '@aws-cdk/aws-stepfunctions';
import { Aws } from '@aws-cdk/core';
import { getResourceArn } from './resource-arn-suffix';

/**
* Properties for InvokeBatchJob
*
* @experimental
*/
export interface InvokeBatchJobProps {
/**
* The job definition used by this job.
Expand Down Expand Up @@ -37,11 +42,16 @@ export interface InvokeBatchJobProps {
/**
* The payload to be passed as parametrs to the batch job
*
* @default undefined
* @default - No parameters are passed
*/
readonly payload?: { [key: string]: any };
}

/**
* A Step Functions Task to invoke AWS Batch
*
* @experimental
*/
export class InvokeBatchJob implements sfn.IStepFunctionsTask {
private readonly integrationPattern: sfn.ServiceIntegrationPattern;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as sfn from '@aws-cdk/aws-stepfunctions';
import * as cdk from '@aws-cdk/core';
import * as tasks from '../lib';
import { Aws } from '@aws-cdk/core';

let stack: cdk.Stack;

Expand Down Expand Up @@ -50,7 +49,7 @@ test('Task with all the parameters', () => {
task: new tasks.InvokeBatchJob({
jobDefinition: 'JobArn',
jobName: 'JobName',
jobQueue: `arn:aws:batch:${Aws.REGION}:${Aws.ACCOUNT_ID}:job-queue/QueueArn`,
jobQueue: `arn:aws:batch:${cdk.Aws.REGION}:${cdk.Aws.ACCOUNT_ID}:job-queue/QueueArn`,
payload: {
foo: sfn.Data.stringAt('$.bar')
},
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-stepfunctions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ couple of the tasks available are:
* `tasks.InvokeActivity` -- start an Activity (Activities represent a work
queue that you poll on a compute fleet you manage yourself)
* `tasks.InvokeFunction` -- invoke a Lambda function with function ARN
* `tasks.InvokeBatchJob` -- invoke a Batch job
* `tasks.RunLambdaTask` -- call Lambda as integrated service with magic ARN
* `tasks.PublishToTopic` -- publish a message to an SNS topic
* `tasks.SendToQueue` -- send a message to an SQS queue
Expand Down

0 comments on commit e405aa0

Please sign in to comment.