diff --git a/packages/@aws-cdk/aws-pipes-targets-alpha/.eslintrc.js b/packages/@aws-cdk/aws-pipes-targets-alpha/.eslintrc.js index 5ee76c5f55d63..2a2c7498774d0 100644 --- a/packages/@aws-cdk/aws-pipes-targets-alpha/.eslintrc.js +++ b/packages/@aws-cdk/aws-pipes-targets-alpha/.eslintrc.js @@ -2,6 +2,5 @@ const baseConfig = require('@aws-cdk/cdk-build-tools/config/eslintrc'); baseConfig.parserOptions.project = __dirname + '/tsconfig.json'; baseConfig.rules['import/no-extraneous-dependencies'] = ['error', { devDependencies: true, peerDependencies: true }]; -baseConfig.rules['@aws-cdk/invalid-cfn-imports'] = 'off'; module.exports = baseConfig; diff --git a/packages/@aws-cdk/aws-pipes-targets-alpha/README.md b/packages/@aws-cdk/aws-pipes-targets-alpha/README.md index 95d1bddde3f53..186af1330fb75 100644 --- a/packages/@aws-cdk/aws-pipes-targets-alpha/README.md +++ b/packages/@aws-cdk/aws-pipes-targets-alpha/README.md @@ -30,6 +30,7 @@ Pipe targets are the end point of an EventBridge Pipe. The following targets are * `targets.EventBridgeTarget`: [Send event source to an EventBridge event bus](#amazon-eventbridge-event-bus) * `targets.KinesisTarget`: [Send event source to a Kinesis data stream](#amazon-kinesis-data-stream) * `targets.LambdaFunction`: [Send event source to a Lambda function](#aws-lambda-function) +* `targets.SageMakerTarget`: [Send event source to a SageMaker pipeline](#amazon-sagemaker-pipeline) * `targets.SfnStateMachine`: [Invoke a Step Functions state machine from an event source](#aws-step-functions-state-machine) * `targets.SqsTarget`: [Send event source to an SQS queue](#amazon-sqs) @@ -217,6 +218,39 @@ const pipe = new pipes.Pipe(this, 'Pipe', { }); ``` +### Amazon SageMaker Pipeline + +A SageMaker pipeline can be used as a target for a pipe. +The pipeline will receive the (enriched/filtered) source payload. + +```ts +declare const sourceQueue: sqs.Queue; +declare const targetPipeline: sagemaker.IPipeline; + +const pipelineTarget = new targets.SageMakerTarget(targetPipeline); + +const pipe = new pipes.Pipe(this, 'Pipe', { + source: new SqsSource(sourceQueue), + target: pipelineTarget, +}); +``` + +The input to the target pipeline can be transformed: + +```ts +declare const sourceQueue: sqs.Queue; +declare const targetPipeline: sagemaker.IPipeline; + +const pipelineTarget = new targets.SageMakerTarget(targetPipeline, { + inputTransformation: pipes.InputTransformation.fromObject({ body: "👀" }), +}); + +const pipe = new pipes.Pipe(this, 'Pipe', { + source: new SqsSource(sourceQueue), + target: pipelineTarget, +}); +``` + ### AWS Step Functions State Machine A Step Functions state machine can be used as a target for a pipe. diff --git a/packages/@aws-cdk/aws-pipes-targets-alpha/lib/lambda.ts b/packages/@aws-cdk/aws-pipes-targets-alpha/lib/lambda.ts index c5fe2adfda59e..2e684f95c4a87 100644 --- a/packages/@aws-cdk/aws-pipes-targets-alpha/lib/lambda.ts +++ b/packages/@aws-cdk/aws-pipes-targets-alpha/lib/lambda.ts @@ -11,7 +11,7 @@ export interface LambdaFunctionParameters { * The input transformation to apply to the message before sending it to the target. * * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipetargetparameters.html#cfn-pipes-pipe-pipetargetparameters-inputtemplate - * @default none + * @default - none */ readonly inputTransformation?: IInputTransformation; diff --git a/packages/@aws-cdk/aws-pipes-targets-alpha/lib/sagemaker.ts b/packages/@aws-cdk/aws-pipes-targets-alpha/lib/sagemaker.ts index 99daa6116ae88..b43af8005e8a9 100644 --- a/packages/@aws-cdk/aws-pipes-targets-alpha/lib/sagemaker.ts +++ b/packages/@aws-cdk/aws-pipes-targets-alpha/lib/sagemaker.ts @@ -10,7 +10,7 @@ export interface SageMakerTargetParameters { * The input transformation to apply to the message before sending it to the target. * * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipetargetparameters.html#cfn-pipes-pipe-pipetargetparameters-inputtemplate - * @default none + * @default - none */ readonly inputTransformation?: IInputTransformation; @@ -47,9 +47,7 @@ export class SageMakerTarget implements ITarget { bind(pipe: IPipe): TargetConfig { if (!this.sagemakerParameters) { - return { - targetParameters: {}, - }; + return { targetParameters: {} }; } return { diff --git a/packages/@aws-cdk/aws-pipes-targets-alpha/lib/sqs.ts b/packages/@aws-cdk/aws-pipes-targets-alpha/lib/sqs.ts index 3a63384d4cd95..55c3e8e6cfa2c 100644 --- a/packages/@aws-cdk/aws-pipes-targets-alpha/lib/sqs.ts +++ b/packages/@aws-cdk/aws-pipes-targets-alpha/lib/sqs.ts @@ -10,7 +10,7 @@ export interface SqsTargetParameters { * The input transformation to apply to the message before sending it to the target. * * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipetargetparameters.html#cfn-pipes-pipe-pipetargetparameters-inputtemplate - * @default none + * @default - none */ readonly inputTransformation?: IInputTransformation; @@ -20,7 +20,7 @@ export interface SqsTargetParameters { * The token used for deduplication of sent messages. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipetargetsqsqueueparameters.html#cfn-pipes-pipe-pipetargetsqsqueueparameters-messagededuplicationid - * @default none + * @default - none */ readonly messageDeduplicationId?: string; @@ -28,7 +28,7 @@ export interface SqsTargetParameters { * The FIFO message group ID to use as the target. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipetargetsqsqueueparameters.html#cfn-pipes-pipe-pipetargetsqsqueueparameters-messagegroupid - * @default none + * @default - none */ readonly messageGroupId?: string; } diff --git a/packages/@aws-cdk/aws-pipes-targets-alpha/lib/stepfunctions.ts b/packages/@aws-cdk/aws-pipes-targets-alpha/lib/stepfunctions.ts index beb4d350faed4..de029c24086a6 100644 --- a/packages/@aws-cdk/aws-pipes-targets-alpha/lib/stepfunctions.ts +++ b/packages/@aws-cdk/aws-pipes-targets-alpha/lib/stepfunctions.ts @@ -11,7 +11,7 @@ export interface SfnStateMachineParameters { * The input transformation to apply to the message before sending it to the target. * * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-pipes-pipe-pipetargetparameters.html#cfn-pipes-pipe-pipetargetparameters-inputtemplate - * @default none + * @default - none */ readonly inputTransformation?: IInputTransformation;