From a7c526abc955a9731606030dcbe282f1f70eb62d Mon Sep 17 00:00:00 2001 From: Rizxcviii Date: Wed, 7 Feb 2024 15:17:59 +0000 Subject: [PATCH] docs(stepfunctions): `integrationPattern` update (#29015) ### Issue # (if applicable) Closes #21915 . (Doesn't close it, but solves a point that was mentioned here) ### Reason for this change The prop is pretty useful, but hasn't received enough documentation from my perspective. This adds documentation to the overview `README` as well it's own jsdoc. ### Description of changes Added a section for the `integrationPattern` into the README, and updated the jsdoc to include more detailed information. ### Description of how you validated changes No validation. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/aws-cdk-lib/aws-stepfunctions/README.md | 16 ++++++++++++++++ .../aws-stepfunctions/lib/states/task-base.ts | 6 ++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-stepfunctions/README.md b/packages/aws-cdk-lib/aws-stepfunctions/README.md index 7b133efeb4f6d..ea62686d8cf60 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions/README.md +++ b/packages/aws-cdk-lib/aws-stepfunctions/README.md @@ -708,6 +708,22 @@ const submitJob = new tasks.LambdaInvoke(this, 'Submit Job', { See [the AWS documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html) to learn more about AWS Step Functions support for accessing resources in other AWS accounts. +## Service Integration Patterns + +AWS Step functions integrate directly with other services, either through an optimised integration pattern, or through the AWS SDK. +Therefore, it is possible to change the `integrationPattern` of services, to enable additional functionality of the said AWS Service: + +```ts +import * as glue from "@aws-cdk/aws-glue-alpha"; + +declare const submitGlue: glue.Job; + +const submitJob = new tasks.GlueStartJobRun(this, "Submit Job", { + glueJobName: submitGlue.jobName, + integrationPattern: sfn.IntegrationPattern.RUN_JOB, +}); +``` + ## State Machine Fragments It is possible to define reusable (or abstracted) mini-state machines by diff --git a/packages/aws-cdk-lib/aws-stepfunctions/lib/states/task-base.ts b/packages/aws-cdk-lib/aws-stepfunctions/lib/states/task-base.ts index ff33ddef0f82a..ad3d364dabd2c 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions/lib/states/task-base.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions/lib/states/task-base.ts @@ -111,9 +111,11 @@ export interface TaskStateBaseProps { /** * AWS Step Functions integrates with services directly in the Amazon States Language. - * You can control these AWS services using service integration patterns + * You can control these AWS services using service integration patterns. * - * @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token + * Depending on the AWS Service, the Service Integration Pattern availability will vary. + * + * @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html * * @default - `IntegrationPattern.REQUEST_RESPONSE` for most tasks. * `IntegrationPattern.RUN_JOB` for the following exceptions: