@epilot360/icons 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/index.js.map +1 -1
- package/package.json +35 -8
- package/react/Close/index.d.ts +4 -0
- package/react/Close/index.js +28 -0
- package/react/Close/index.js.map +1 -0
- package/react/ContentCopy/index.d.ts +4 -0
- package/react/ContentCopy/index.js +28 -0
- package/react/ContentCopy/index.js.map +1 -0
- package/react/DataObject/index.d.ts +4 -0
- package/react/DataObject/index.js +28 -0
- package/react/DataObject/index.js.map +1 -0
- package/react/Edit/index.d.ts +4 -0
- package/react/Edit/index.js +28 -0
- package/react/Edit/index.js.map +1 -0
- package/react/EpilotIcon.d.ts +21 -0
- package/react/EpilotIcon.js +41 -0
- package/react/EpilotIcon.js.map +1 -0
- package/react/OpenInNew/index.d.ts +4 -0
- package/react/OpenInNew/index.js +28 -0
- package/react/OpenInNew/index.js.map +1 -0
- package/react/Share/index.d.ts +4 -0
- package/react/Share/index.js +28 -0
- package/react/Share/index.js.map +1 -0
- package/react/index.d.ts +6 -0
- package/react/index.js +6 -0
- package/react/index.js.map +1 -1
- package/react/types.d.ts +7 -0
- package/react/types.js +9 -0
- package/react/types.js.map +1 -0
- package/src/stories/Readme.mdx +53 -0
- package/iac/node_modules/@balena/dockerignore/LICENSE.md +0 -206
- package/iac/node_modules/@balena/dockerignore/README.md +0 -261
- package/iac/node_modules/@cspotcode/source-map-support/LICENSE.md +0 -21
- package/iac/node_modules/@cspotcode/source-map-support/README.md +0 -289
- package/iac/node_modules/@jridgewell/resolve-uri/LICENSE +0 -19
- package/iac/node_modules/@jridgewell/resolve-uri/README.md +0 -40
- package/iac/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +0 -1
- package/iac/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +0 -1
- package/iac/node_modules/@jridgewell/sourcemap-codec/LICENSE +0 -21
- package/iac/node_modules/@jridgewell/sourcemap-codec/README.md +0 -200
- package/iac/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +0 -1
- package/iac/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +0 -1
- package/iac/node_modules/@jridgewell/trace-mapping/LICENSE +0 -19
- package/iac/node_modules/@jridgewell/trace-mapping/README.md +0 -193
- package/iac/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +0 -1
- package/iac/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +0 -1
- package/iac/node_modules/@tsconfig/node10/LICENSE +0 -21
- package/iac/node_modules/@tsconfig/node10/README.md +0 -40
- package/iac/node_modules/@tsconfig/node12/LICENSE +0 -21
- package/iac/node_modules/@tsconfig/node12/README.md +0 -40
- package/iac/node_modules/@tsconfig/node14/LICENSE +0 -21
- package/iac/node_modules/@tsconfig/node14/README.md +0 -40
- package/iac/node_modules/@tsconfig/node16/LICENSE +0 -21
- package/iac/node_modules/@tsconfig/node16/README.md +0 -40
- package/iac/node_modules/@types/jest/LICENSE +0 -21
- package/iac/node_modules/@types/jest/README.md +0 -17
- package/iac/node_modules/@types/node/LICENSE +0 -21
- package/iac/node_modules/@types/node/README.md +0 -16
- package/iac/node_modules/@types/prettier/LICENSE +0 -21
- package/iac/node_modules/@types/prettier/README.md +0 -16
- package/iac/node_modules/acorn/LICENSE +0 -21
- package/iac/node_modules/acorn/README.md +0 -273
- package/iac/node_modules/acorn-walk/LICENSE +0 -21
- package/iac/node_modules/acorn-walk/README.md +0 -126
- package/iac/node_modules/ansi-regex/license +0 -9
- package/iac/node_modules/ansi-regex/readme.md +0 -78
- package/iac/node_modules/ansi-styles/license +0 -9
- package/iac/node_modules/ansi-styles/readme.md +0 -144
- package/iac/node_modules/arg/LICENSE.md +0 -21
- package/iac/node_modules/arg/README.md +0 -280
- package/iac/node_modules/at-least-node/LICENSE +0 -6
- package/iac/node_modules/at-least-node/README.md +0 -25
- package/iac/node_modules/aws-cdk/LICENSE +0 -201
- package/iac/node_modules/aws-cdk/README.md +0 -742
- package/iac/node_modules/aws-cdk/lib/init-templates/LICENSE +0 -16
- package/iac/node_modules/aws-cdk/lib/init-templates/app/csharp/README.md +0 -14
- package/iac/node_modules/aws-cdk/lib/init-templates/app/fsharp/README.md +0 -18
- package/iac/node_modules/aws-cdk/lib/init-templates/app/go/README.md +0 -12
- package/iac/node_modules/aws-cdk/lib/init-templates/app/java/README.md +0 -18
- package/iac/node_modules/aws-cdk/lib/init-templates/app/javascript/README.md +0 -12
- package/iac/node_modules/aws-cdk/lib/init-templates/app/python/README.template.md +0 -58
- package/iac/node_modules/aws-cdk/lib/init-templates/app/typescript/README.md +0 -14
- package/iac/node_modules/aws-cdk/lib/init-templates/lib/typescript/README.template.md +0 -12
- package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/csharp/README.template.md +0 -19
- package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/fsharp/README.template.md +0 -20
- package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/go/README.md +0 -12
- package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/java/README.template.md +0 -19
- package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/javascript/README.template.md +0 -13
- package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/python/README.template.md +0 -65
- package/iac/node_modules/aws-cdk/lib/init-templates/sample-app/typescript/README.template.md +0 -15
- package/iac/node_modules/aws-cdk/test/integ/cli/README.md +0 -48
- package/iac/node_modules/aws-cdk/test/integ/cli-regression-patches/README.md +0 -54
- package/iac/node_modules/aws-cdk-lib/LICENSE +0 -201
- package/iac/node_modules/aws-cdk-lib/README.md +0 -1119
- package/iac/node_modules/aws-cdk-lib/alexa-ask/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/assertions/README.md +0 -571
- package/iac/node_modules/aws-cdk-lib/assets/README.md +0 -4
- package/iac/node_modules/aws-cdk-lib/aws-accessanalyzer/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-acmpca/README.md +0 -59
- package/iac/node_modules/aws-cdk-lib/aws-amazonmq/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-amplify/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-amplifyuibuilder/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-apigateway/README.md +0 -1335
- package/iac/node_modules/aws-cdk-lib/aws-apigatewayv2/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-appconfig/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-appflow/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-appintegrations/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-applicationautoscaling/README.md +0 -246
- package/iac/node_modules/aws-cdk-lib/aws-applicationinsights/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-appmesh/README.md +0 -883
- package/iac/node_modules/aws-cdk-lib/aws-apprunner/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-appstream/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-appsync/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-aps/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-athena/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-auditmanager/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-autoscaling/README.md +0 -540
- package/iac/node_modules/aws-cdk-lib/aws-autoscaling-common/README.md +0 -8
- package/iac/node_modules/aws-cdk-lib/aws-autoscaling-hooktargets/README.md +0 -18
- package/iac/node_modules/aws-cdk-lib/aws-autoscalingplans/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-backup/README.md +0 -210
- package/iac/node_modules/aws-cdk-lib/aws-batch/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-billingconductor/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-budgets/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-cassandra/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-ce/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-certificatemanager/README.md +0 -166
- package/iac/node_modules/aws-cdk-lib/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/README.md +0 -2
- package/iac/node_modules/aws-cdk-lib/aws-certificatemanager/suffixes/README.txt +0 -8
- package/iac/node_modules/aws-cdk-lib/aws-chatbot/README.md +0 -44
- package/iac/node_modules/aws-cdk-lib/aws-cloud9/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-cloudformation/README.md +0 -4
- package/iac/node_modules/aws-cdk-lib/aws-cloudfront/README.md +0 -973
- package/iac/node_modules/aws-cdk-lib/aws-cloudfront-origins/README.md +0 -126
- package/iac/node_modules/aws-cdk-lib/aws-cloudtrail/README.md +0 -189
- package/iac/node_modules/aws-cdk-lib/aws-cloudwatch/README.md +0 -579
- package/iac/node_modules/aws-cdk-lib/aws-cloudwatch-actions/README.md +0 -43
- package/iac/node_modules/aws-cdk-lib/aws-codeartifact/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-codebuild/README.md +0 -759
- package/iac/node_modules/aws-cdk-lib/aws-codecommit/README.md +0 -85
- package/iac/node_modules/aws-cdk-lib/aws-codedeploy/README.md +0 -319
- package/iac/node_modules/aws-cdk-lib/aws-codeguruprofiler/README.md +0 -37
- package/iac/node_modules/aws-cdk-lib/aws-codegurureviewer/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-codepipeline/README.md +0 -481
- package/iac/node_modules/aws-cdk-lib/aws-codepipeline-actions/README.md +0 -1203
- package/iac/node_modules/aws-cdk-lib/aws-codestar/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-codestarconnections/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-codestarnotifications/README.md +0 -68
- package/iac/node_modules/aws-cdk-lib/aws-cognito/README.md +0 -843
- package/iac/node_modules/aws-cdk-lib/aws-config/README.md +0 -218
- package/iac/node_modules/aws-cdk-lib/aws-connect/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-controltower/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-cur/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-customerprofiles/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-databrew/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-datapipeline/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-datasync/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-dax/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-detective/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-devopsguru/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-directoryservice/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-dlm/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-dms/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-docdb/README.md +0 -153
- package/iac/node_modules/aws-cdk-lib/aws-dynamodb/README.md +0 -200
- package/iac/node_modules/aws-cdk-lib/aws-ec2/README.md +0 -1514
- package/iac/node_modules/aws-cdk-lib/aws-ecr/README.md +0 -110
- package/iac/node_modules/aws-cdk-lib/aws-ecr-assets/README.md +0 -167
- package/iac/node_modules/aws-cdk-lib/aws-ecs/README.md +0 -1225
- package/iac/node_modules/aws-cdk-lib/aws-ecs-patterns/README.md +0 -980
- package/iac/node_modules/aws-cdk-lib/aws-efs/README.md +0 -154
- package/iac/node_modules/aws-cdk-lib/aws-eks/README.md +0 -1450
- package/iac/node_modules/aws-cdk-lib/aws-elasticache/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-elasticbeanstalk/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancing/README.md +0 -40
- package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/README.md +0 -569
- package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancingv2-actions/README.md +0 -68
- package/iac/node_modules/aws-cdk-lib/aws-elasticloadbalancingv2-targets/README.md +0 -4
- package/iac/node_modules/aws-cdk-lib/aws-elasticsearch/README.md +0 -441
- package/iac/node_modules/aws-cdk-lib/aws-emr/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-emrcontainers/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-emrserverless/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-events/README.md +0 -249
- package/iac/node_modules/aws-cdk-lib/aws-events-targets/README.md +0 -339
- package/iac/node_modules/aws-cdk-lib/aws-eventschemas/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-evidently/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-finspace/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-fis/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-fms/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-forecast/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-frauddetector/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-fsx/README.md +0 -200
- package/iac/node_modules/aws-cdk-lib/aws-gamelift/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-globalaccelerator/README.md +0 -182
- package/iac/node_modules/aws-cdk-lib/aws-globalaccelerator-endpoints/README.md +0 -10
- package/iac/node_modules/aws-cdk-lib/aws-glue/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-greengrass/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-greengrassv2/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-groundstation/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-guardduty/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-healthlake/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-iam/README.md +0 -509
- package/iac/node_modules/aws-cdk-lib/aws-imagebuilder/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-inspector/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-inspectorv2/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-iot/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-iot1click/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-iotanalytics/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-iotcoredeviceadvisor/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-iotevents/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-iotfleethub/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-iotsitewise/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-iotthingsgraph/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-iottwinmaker/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-iotwireless/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-ivs/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-kafkaconnect/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-kendra/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-kinesis/README.md +0 -188
- package/iac/node_modules/aws-cdk-lib/aws-kinesisanalytics/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-kinesisanalyticsv2/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-kinesisfirehose/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-kinesisvideo/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-kms/README.md +0 -209
- package/iac/node_modules/aws-cdk-lib/aws-lakeformation/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-lambda/README.md +0 -985
- package/iac/node_modules/aws-cdk-lib/aws-lambda-destinations/README.md +0 -147
- package/iac/node_modules/aws-cdk-lib/aws-lambda-event-sources/README.md +0 -281
- package/iac/node_modules/aws-cdk-lib/aws-lambda-nodejs/README.md +0 -317
- package/iac/node_modules/aws-cdk-lib/aws-lex/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-licensemanager/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-lightsail/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-location/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-logs/README.md +0 -322
- package/iac/node_modules/aws-cdk-lib/aws-logs-destinations/README.md +0 -7
- package/iac/node_modules/aws-cdk-lib/aws-lookoutequipment/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-lookoutmetrics/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-lookoutvision/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-m2/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-macie/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-managedblockchain/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-mediaconnect/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-mediaconvert/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-medialive/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-mediapackage/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-mediastore/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-mediatailor/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-memorydb/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-msk/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-mwaa/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-neptune/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-networkfirewall/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-networkmanager/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-nimblestudio/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-opensearchservice/README.md +0 -378
- package/iac/node_modules/aws-cdk-lib/aws-opsworks/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-opsworkscm/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-panorama/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-personalize/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-pinpoint/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-pinpointemail/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-qldb/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-quicksight/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-ram/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-rds/README.md +0 -704
- package/iac/node_modules/aws-cdk-lib/aws-redshift/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-redshiftserverless/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-refactorspaces/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-rekognition/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-resiliencehub/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-resourcegroups/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-robomaker/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-route53/README.md +0 -281
- package/iac/node_modules/aws-cdk-lib/aws-route53-patterns/README.md +0 -45
- package/iac/node_modules/aws-cdk-lib/aws-route53-targets/README.md +0 -181
- package/iac/node_modules/aws-cdk-lib/aws-route53recoverycontrol/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-route53recoveryreadiness/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-route53resolver/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-rum/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-s3/README.md +0 -581
- package/iac/node_modules/aws-cdk-lib/aws-s3-assets/README.md +0 -179
- package/iac/node_modules/aws-cdk-lib/aws-s3-deployment/README.md +0 -349
- package/iac/node_modules/aws-cdk-lib/aws-s3-notifications/README.md +0 -46
- package/iac/node_modules/aws-cdk-lib/aws-s3objectlambda/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-s3outposts/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-sagemaker/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-sam/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-sdb/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-secretsmanager/README.md +0 -285
- package/iac/node_modules/aws-cdk-lib/aws-securityhub/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-servicecatalog/README.md +0 -491
- package/iac/node_modules/aws-cdk-lib/aws-servicecatalogappregistry/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-servicediscovery/README.md +0 -45
- package/iac/node_modules/aws-cdk-lib/aws-ses/README.md +0 -194
- package/iac/node_modules/aws-cdk-lib/aws-ses-actions/README.md +0 -16
- package/iac/node_modules/aws-cdk-lib/aws-signer/README.md +0 -41
- package/iac/node_modules/aws-cdk-lib/aws-sns/README.md +0 -184
- package/iac/node_modules/aws-cdk-lib/aws-sns-subscriptions/README.md +0 -120
- package/iac/node_modules/aws-cdk-lib/aws-sqs/README.md +0 -57
- package/iac/node_modules/aws-cdk-lib/aws-ssm/README.md +0 -99
- package/iac/node_modules/aws-cdk-lib/aws-ssmcontacts/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-ssmincidents/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-sso/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-stepfunctions/README.md +0 -884
- package/iac/node_modules/aws-cdk-lib/aws-stepfunctions-tasks/README.md +0 -1288
- package/iac/node_modules/aws-cdk-lib/aws-supportapp/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-synthetics/README.md +0 -32
- package/iac/node_modules/aws-cdk-lib/aws-timestream/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-transfer/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-voiceid/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-waf/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-wafregional/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-wafv2/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-wisdom/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-workspaces/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/aws-xray/README.md +0 -27
- package/iac/node_modules/aws-cdk-lib/cloud-assembly-schema/README.md +0 -55
- package/iac/node_modules/aws-cdk-lib/cloud-assembly-schema/schema/README.md +0 -5
- package/iac/node_modules/aws-cdk-lib/cloudformation-include/README.md +0 -466
- package/iac/node_modules/aws-cdk-lib/core/README.md +0 -1078
- package/iac/node_modules/aws-cdk-lib/custom-resources/README.md +0 -624
- package/iac/node_modules/aws-cdk-lib/cx-api/README.md +0 -98
- package/iac/node_modules/aws-cdk-lib/lambda-layer-awscli/README.md +0 -19
- package/iac/node_modules/aws-cdk-lib/lambda-layer-kubectl/README.md +0 -20
- package/iac/node_modules/aws-cdk-lib/lambda-layer-node-proxy-agent/README.md +0 -18
- package/iac/node_modules/aws-cdk-lib/node_modules/@balena/dockerignore/LICENSE.md +0 -206
- package/iac/node_modules/aws-cdk-lib/node_modules/@balena/dockerignore/README.md +0 -261
- package/iac/node_modules/aws-cdk-lib/node_modules/at-least-node/LICENSE +0 -6
- package/iac/node_modules/aws-cdk-lib/node_modules/at-least-node/README.md +0 -25
- package/iac/node_modules/aws-cdk-lib/node_modules/balanced-match/LICENSE.md +0 -21
- package/iac/node_modules/aws-cdk-lib/node_modules/balanced-match/README.md +0 -97
- package/iac/node_modules/aws-cdk-lib/node_modules/brace-expansion/LICENSE +0 -21
- package/iac/node_modules/aws-cdk-lib/node_modules/brace-expansion/README.md +0 -129
- package/iac/node_modules/aws-cdk-lib/node_modules/case/LICENSE +0 -22
- package/iac/node_modules/aws-cdk-lib/node_modules/case/README.md +0 -139
- package/iac/node_modules/aws-cdk-lib/node_modules/case/dist/Case.min.js.map +0 -1
- package/iac/node_modules/aws-cdk-lib/node_modules/case/dist/Case.plus.min.js.map +0 -1
- package/iac/node_modules/aws-cdk-lib/node_modules/concat-map/LICENSE +0 -18
- package/iac/node_modules/aws-cdk-lib/node_modules/concat-map/README.markdown +0 -62
- package/iac/node_modules/aws-cdk-lib/node_modules/fs-extra/LICENSE +0 -15
- package/iac/node_modules/aws-cdk-lib/node_modules/fs-extra/README.md +0 -264
- package/iac/node_modules/aws-cdk-lib/node_modules/graceful-fs/LICENSE +0 -15
- package/iac/node_modules/aws-cdk-lib/node_modules/graceful-fs/README.md +0 -143
- package/iac/node_modules/aws-cdk-lib/node_modules/ignore/README.md +0 -412
- package/iac/node_modules/aws-cdk-lib/node_modules/jsonfile/LICENSE +0 -15
- package/iac/node_modules/aws-cdk-lib/node_modules/jsonfile/README.md +0 -230
- package/iac/node_modules/aws-cdk-lib/node_modules/jsonschema/LICENSE +0 -21
- package/iac/node_modules/aws-cdk-lib/node_modules/jsonschema/README.md +0 -421
- package/iac/node_modules/aws-cdk-lib/node_modules/lru-cache/LICENSE +0 -15
- package/iac/node_modules/aws-cdk-lib/node_modules/lru-cache/README.md +0 -166
- package/iac/node_modules/aws-cdk-lib/node_modules/minimatch/LICENSE +0 -15
- package/iac/node_modules/aws-cdk-lib/node_modules/minimatch/README.md +0 -230
- package/iac/node_modules/aws-cdk-lib/node_modules/punycode/README.md +0 -122
- package/iac/node_modules/aws-cdk-lib/node_modules/semver/LICENSE +0 -15
- package/iac/node_modules/aws-cdk-lib/node_modules/semver/README.md +0 -568
- package/iac/node_modules/aws-cdk-lib/node_modules/universalify/LICENSE +0 -20
- package/iac/node_modules/aws-cdk-lib/node_modules/universalify/README.md +0 -76
- package/iac/node_modules/aws-cdk-lib/node_modules/yallist/LICENSE +0 -15
- package/iac/node_modules/aws-cdk-lib/node_modules/yallist/README.md +0 -204
- package/iac/node_modules/aws-cdk-lib/node_modules/yaml/LICENSE +0 -13
- package/iac/node_modules/aws-cdk-lib/node_modules/yaml/README.md +0 -127
- package/iac/node_modules/aws-cdk-lib/pipelines/README.md +0 -1573
- package/iac/node_modules/aws-cdk-lib/region-info/README.md +0 -84
- package/iac/node_modules/aws-cdk-lib/triggers/README.md +0 -86
- package/iac/node_modules/balanced-match/LICENSE.md +0 -21
- package/iac/node_modules/balanced-match/README.md +0 -97
- package/iac/node_modules/brace-expansion/LICENSE +0 -21
- package/iac/node_modules/brace-expansion/README.md +0 -129
- package/iac/node_modules/buffer-from/LICENSE +0 -21
- package/iac/node_modules/buffer-from/readme.md +0 -69
- package/iac/node_modules/case/LICENSE +0 -22
- package/iac/node_modules/case/README.md +0 -139
- package/iac/node_modules/case/dist/Case.min.js.map +0 -1
- package/iac/node_modules/case/dist/Case.plus.min.js.map +0 -1
- package/iac/node_modules/chalk/license +0 -9
- package/iac/node_modules/chalk/node_modules/ansi-styles/license +0 -9
- package/iac/node_modules/chalk/node_modules/ansi-styles/readme.md +0 -152
- package/iac/node_modules/chalk/readme.md +0 -341
- package/iac/node_modules/color-convert/LICENSE +0 -21
- package/iac/node_modules/color-convert/README.md +0 -68
- package/iac/node_modules/color-name/LICENSE +0 -8
- package/iac/node_modules/color-name/README.md +0 -11
- package/iac/node_modules/concat-map/LICENSE +0 -18
- package/iac/node_modules/concat-map/README.markdown +0 -62
- package/iac/node_modules/constructs/LICENSE +0 -202
- package/iac/node_modules/constructs/README.md +0 -28
- package/iac/node_modules/create-require/LICENSE +0 -25
- package/iac/node_modules/create-require/README.md +0 -46
- package/iac/node_modules/diff/LICENSE +0 -31
- package/iac/node_modules/diff/README.md +0 -207
- package/iac/node_modules/diff-sequences/LICENSE +0 -21
- package/iac/node_modules/diff-sequences/README.md +0 -404
- package/iac/node_modules/fs-extra/LICENSE +0 -15
- package/iac/node_modules/fs-extra/README.md +0 -264
- package/iac/node_modules/fsevents/LICENSE +0 -22
- package/iac/node_modules/fsevents/README.md +0 -83
- package/iac/node_modules/graceful-fs/LICENSE +0 -15
- package/iac/node_modules/graceful-fs/README.md +0 -143
- package/iac/node_modules/has-flag/license +0 -9
- package/iac/node_modules/has-flag/readme.md +0 -89
- package/iac/node_modules/ignore/README.md +0 -412
- package/iac/node_modules/jest-diff/LICENSE +0 -21
- package/iac/node_modules/jest-diff/README.md +0 -671
- package/iac/node_modules/jest-get-type/LICENSE +0 -21
- package/iac/node_modules/jest-matcher-utils/LICENSE +0 -21
- package/iac/node_modules/jest-matcher-utils/README.md +0 -24
- package/iac/node_modules/jsonfile/LICENSE +0 -15
- package/iac/node_modules/jsonfile/README.md +0 -230
- package/iac/node_modules/jsonschema/LICENSE +0 -21
- package/iac/node_modules/jsonschema/README.md +0 -421
- package/iac/node_modules/lru-cache/LICENSE +0 -15
- package/iac/node_modules/lru-cache/README.md +0 -166
- package/iac/node_modules/make-error/LICENSE +0 -5
- package/iac/node_modules/make-error/README.md +0 -112
- package/iac/node_modules/minimatch/LICENSE +0 -15
- package/iac/node_modules/minimatch/README.md +0 -230
- package/iac/node_modules/pretty-format/LICENSE +0 -21
- package/iac/node_modules/pretty-format/README.md +0 -458
- package/iac/node_modules/punycode/README.md +0 -122
- package/iac/node_modules/react-is/LICENSE +0 -21
- package/iac/node_modules/react-is/README.md +0 -104
- package/iac/node_modules/semver/LICENSE +0 -15
- package/iac/node_modules/semver/README.md +0 -568
- package/iac/node_modules/source-map/LICENSE +0 -28
- package/iac/node_modules/source-map/README.md +0 -742
- package/iac/node_modules/source-map/dist/source-map.min.js.map +0 -1
- package/iac/node_modules/source-map-support/LICENSE.md +0 -21
- package/iac/node_modules/source-map-support/README.md +0 -284
- package/iac/node_modules/supports-color/license +0 -9
- package/iac/node_modules/supports-color/readme.md +0 -76
- package/iac/node_modules/ts-node/LICENSE +0 -21
- package/iac/node_modules/ts-node/README.md +0 -1442
- package/iac/node_modules/ts-node/dist/bin-cwd.js.map +0 -1
- package/iac/node_modules/ts-node/dist/bin-esm.js.map +0 -1
- package/iac/node_modules/ts-node/dist/bin-script-deprecated.js.map +0 -1
- package/iac/node_modules/ts-node/dist/bin-script.js.map +0 -1
- package/iac/node_modules/ts-node/dist/bin-transpile.js.map +0 -1
- package/iac/node_modules/ts-node/dist/bin.js.map +0 -1
- package/iac/node_modules/ts-node/dist/child/argv-payload.js.map +0 -1
- package/iac/node_modules/ts-node/dist/child/child-entrypoint.js.map +0 -1
- package/iac/node_modules/ts-node/dist/child/child-loader.js.map +0 -1
- package/iac/node_modules/ts-node/dist/child/child-require.js.map +0 -1
- package/iac/node_modules/ts-node/dist/child/spawn-child.js.map +0 -1
- package/iac/node_modules/ts-node/dist/cjs-resolve-hooks.js.map +0 -1
- package/iac/node_modules/ts-node/dist/configuration.js.map +0 -1
- package/iac/node_modules/ts-node/dist/esm.js.map +0 -1
- package/iac/node_modules/ts-node/dist/file-extensions.js.map +0 -1
- package/iac/node_modules/ts-node/dist/index.js.map +0 -1
- package/iac/node_modules/ts-node/dist/module-type-classifier.js.map +0 -1
- package/iac/node_modules/ts-node/dist/node-module-type-classifier.js.map +0 -1
- package/iac/node_modules/ts-node/dist/repl.js.map +0 -1
- package/iac/node_modules/ts-node/dist/resolver-functions.js.map +0 -1
- package/iac/node_modules/ts-node/dist/transpilers/swc.js.map +0 -1
- package/iac/node_modules/ts-node/dist/transpilers/types.js.map +0 -1
- package/iac/node_modules/ts-node/dist/ts-compiler-types.js.map +0 -1
- package/iac/node_modules/ts-node/dist/ts-internals.js.map +0 -1
- package/iac/node_modules/ts-node/dist/ts-transpile-module.js.map +0 -1
- package/iac/node_modules/ts-node/dist/tsconfig-schema.js.map +0 -1
- package/iac/node_modules/ts-node/dist/tsconfigs.js.map +0 -1
- package/iac/node_modules/ts-node/dist/util.js.map +0 -1
- package/iac/node_modules/ts-node/dist-raw/README.md +0 -36
- package/iac/node_modules/typescript/LICENSE.txt +0 -55
- package/iac/node_modules/typescript/README.md +0 -104
- package/iac/node_modules/typescript/lib/README.md +0 -5
- package/iac/node_modules/universalify/LICENSE +0 -20
- package/iac/node_modules/universalify/README.md +0 -76
- package/iac/node_modules/v8-compile-cache-lib/LICENSE +0 -21
- package/iac/node_modules/v8-compile-cache-lib/README.md +0 -60
- package/iac/node_modules/yallist/LICENSE +0 -15
- package/iac/node_modules/yallist/README.md +0 -204
- package/iac/node_modules/yaml/LICENSE +0 -13
- package/iac/node_modules/yaml/README.md +0 -127
- package/iac/node_modules/yn/license +0 -9
- package/iac/node_modules/yn/readme.md +0 -83
- package/react/Edit.d.ts +0 -3
- package/react/Edit.js +0 -10
- package/react/Edit.js.map +0 -1
|
@@ -1,884 +0,0 @@
|
|
|
1
|
-
# AWS Step Functions Construct Library
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
The `@aws-cdk/aws-stepfunctions` package contains constructs for building
|
|
5
|
-
serverless workflows using objects. Use this in conjunction with the
|
|
6
|
-
`@aws-cdk/aws-stepfunctions-tasks` package, which contains classes used
|
|
7
|
-
to call other AWS services.
|
|
8
|
-
|
|
9
|
-
Defining a workflow looks like this (for the [Step Functions Job Poller
|
|
10
|
-
example](https://docs.aws.amazon.com/step-functions/latest/dg/job-status-poller-sample.html)):
|
|
11
|
-
|
|
12
|
-
## Example
|
|
13
|
-
|
|
14
|
-
```ts
|
|
15
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
16
|
-
|
|
17
|
-
declare const submitLambda: lambda.Function;
|
|
18
|
-
declare const getStatusLambda: lambda.Function;
|
|
19
|
-
|
|
20
|
-
const submitJob = new tasks.LambdaInvoke(this, 'Submit Job', {
|
|
21
|
-
lambdaFunction: submitLambda,
|
|
22
|
-
// Lambda's result is in the attribute `Payload`
|
|
23
|
-
outputPath: '$.Payload',
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const waitX = new sfn.Wait(this, 'Wait X Seconds', {
|
|
27
|
-
time: sfn.WaitTime.secondsPath('$.waitSeconds'),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const getStatus = new tasks.LambdaInvoke(this, 'Get Job Status', {
|
|
31
|
-
lambdaFunction: getStatusLambda,
|
|
32
|
-
// Pass just the field named "guid" into the Lambda, put the
|
|
33
|
-
// Lambda's result in a field called "status" in the response
|
|
34
|
-
inputPath: '$.guid',
|
|
35
|
-
outputPath: '$.Payload',
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
const jobFailed = new sfn.Fail(this, 'Job Failed', {
|
|
39
|
-
cause: 'AWS Batch Job Failed',
|
|
40
|
-
error: 'DescribeJob returned FAILED',
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const finalStatus = new tasks.LambdaInvoke(this, 'Get Final Job Status', {
|
|
44
|
-
lambdaFunction: getStatusLambda,
|
|
45
|
-
// Use "guid" field as input
|
|
46
|
-
inputPath: '$.guid',
|
|
47
|
-
outputPath: '$.Payload',
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const definition = submitJob
|
|
51
|
-
.next(waitX)
|
|
52
|
-
.next(getStatus)
|
|
53
|
-
.next(new sfn.Choice(this, 'Job Complete?')
|
|
54
|
-
// Look at the "status" field
|
|
55
|
-
.when(sfn.Condition.stringEquals('$.status', 'FAILED'), jobFailed)
|
|
56
|
-
.when(sfn.Condition.stringEquals('$.status', 'SUCCEEDED'), finalStatus)
|
|
57
|
-
.otherwise(waitX));
|
|
58
|
-
|
|
59
|
-
new sfn.StateMachine(this, 'StateMachine', {
|
|
60
|
-
definition,
|
|
61
|
-
timeout: Duration.minutes(5),
|
|
62
|
-
});
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
You can find more sample snippets and learn more about the service integrations
|
|
66
|
-
in the `@aws-cdk/aws-stepfunctions-tasks` package.
|
|
67
|
-
|
|
68
|
-
## State Machine
|
|
69
|
-
|
|
70
|
-
A `stepfunctions.StateMachine` is a resource that takes a state machine
|
|
71
|
-
definition. The definition is specified by its start state, and encompasses
|
|
72
|
-
all states reachable from the start state:
|
|
73
|
-
|
|
74
|
-
```ts
|
|
75
|
-
const startState = new sfn.Pass(this, 'StartState');
|
|
76
|
-
|
|
77
|
-
new sfn.StateMachine(this, 'StateMachine', {
|
|
78
|
-
definition: startState,
|
|
79
|
-
});
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
State machines are made up of a sequence of **Steps**, which represent different actions
|
|
83
|
-
taken in sequence. Some of these steps represent *control flow* (like `Choice`, `Map` and `Wait`)
|
|
84
|
-
while others represent calls made against other AWS services (like `LambdaInvoke`).
|
|
85
|
-
The second category are called `Task`s and they can all be found in the module [`aws-stepfunctions-tasks`].
|
|
86
|
-
|
|
87
|
-
[`aws-stepfunctions-tasks`]: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks-readme.html
|
|
88
|
-
|
|
89
|
-
State machines execute using an IAM Role, which will automatically have all
|
|
90
|
-
permissions added that are required to make all state machine tasks execute
|
|
91
|
-
properly (for example, permissions to invoke any Lambda functions you add to
|
|
92
|
-
your workflow). A role will be created by default, but you can supply an
|
|
93
|
-
existing one as well.
|
|
94
|
-
|
|
95
|
-
## State Machine Data
|
|
96
|
-
|
|
97
|
-
An Execution represents each time the State Machine is run. Every Execution has [State Machine
|
|
98
|
-
Data](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-data.html):
|
|
99
|
-
a JSON document containing keys and values that is fed into the state machine,
|
|
100
|
-
gets modified by individual steps as the state machine progresses, and finally
|
|
101
|
-
is produced as output.
|
|
102
|
-
|
|
103
|
-
By default, the entire Data object is passed into every state, and the return data of the step
|
|
104
|
-
becomes new the new Data object. This behavior can be modified by supplying values for `inputPath`,
|
|
105
|
-
`resultSelector`, `resultPath` and `outputPath`.
|
|
106
|
-
|
|
107
|
-
### Manipulating state machine data using inputPath, resultSelector, resultPath and outputPath
|
|
108
|
-
|
|
109
|
-
These properties impact how each individual step interacts with the state machine data:
|
|
110
|
-
|
|
111
|
-
* `inputPath`: the part of the data object that gets passed to the step (`itemsPath` for `Map` states)
|
|
112
|
-
* `resultSelector`: the part of the step result that should be added to the state machine data
|
|
113
|
-
* `resultPath`: where in the state machine data the step result should be inserted
|
|
114
|
-
* `outputPath`: what part of the state machine data should be retained
|
|
115
|
-
|
|
116
|
-
Their values should be a string indicating a [JSON path](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-paths.html) into the State Machine Data object (like `"$.MyKey"`). If absent, the values are treated as if they were `"$"`, which means the entire object.
|
|
117
|
-
|
|
118
|
-
The following pseudocode shows how AWS Step Functions uses these parameters when executing a step:
|
|
119
|
-
|
|
120
|
-
```js
|
|
121
|
-
// Schematically show how Step Functions evaluates functions.
|
|
122
|
-
// [] represents indexing into an object by a using JSON path.
|
|
123
|
-
|
|
124
|
-
input = state[inputPath]
|
|
125
|
-
|
|
126
|
-
result = invoke_step(select_parameters(input))
|
|
127
|
-
|
|
128
|
-
state[resultPath] = result[resultSelector]
|
|
129
|
-
|
|
130
|
-
state = state[outputPath]
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Instead of a JSON path string, each of these paths can also have the special value `JsonPath.DISCARD`, which causes the corresponding indexing expression to return an empty object (`{}`). Effectively, that means there will be an empty input object, an empty result object, no effect on the state, or an empty state, respectively.
|
|
134
|
-
|
|
135
|
-
Some steps (mostly Tasks) have *Parameters*, which are selected differently. See the next section.
|
|
136
|
-
|
|
137
|
-
See the official documentation on [input and output processing in Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-input-output-filtering.html).
|
|
138
|
-
|
|
139
|
-
### Passing Parameters to Tasks
|
|
140
|
-
|
|
141
|
-
Tasks take parameters, whose values can be taken from the State Machine Data object. For example, your
|
|
142
|
-
workflow may want to start a CodeBuild with an environment variable that is taken from the State Machine data, or pass part of the State Machine Data into an AWS Lambda Function.
|
|
143
|
-
|
|
144
|
-
In the original JSON-based states language used by AWS Step Functions, you would
|
|
145
|
-
add `.$` to the end of a key to indicate that a value needs to be interpreted as
|
|
146
|
-
a JSON path. In the CDK API you do not change the names of any keys. Instead, you
|
|
147
|
-
pass special values. There are 3 types of task inputs to consider:
|
|
148
|
-
|
|
149
|
-
* Tasks that accept a "payload" type of input (like AWS Lambda invocations, or posting messages to SNS topics or SQS queues), will take an object of type `TaskInput`, like `TaskInput.fromObject()` or `TaskInput.fromJsonPathAt()`.
|
|
150
|
-
* When tasks expect individual string or number values to customize their behavior, you can also pass a value constructed by `JsonPath.stringAt()` or `JsonPath.numberAt()`.
|
|
151
|
-
* When tasks expect strongly-typed resources and you want to vary the resource that is referenced based on a name from the State Machine Data, reference the resource as if it was external (using `JsonPath.stringAt()`). For example, for a Lambda function: `Function.fromFunctionName(this, 'ReferencedFunction', JsonPath.stringAt('$.MyFunctionName'))`.
|
|
152
|
-
|
|
153
|
-
For example, to pass the value that's in the data key of `OrderId` to a Lambda
|
|
154
|
-
function as you invoke it, use `JsonPath.stringAt('$.OrderId')`, like so:
|
|
155
|
-
|
|
156
|
-
```ts
|
|
157
|
-
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
158
|
-
|
|
159
|
-
declare const orderFn: lambda.Function;
|
|
160
|
-
|
|
161
|
-
const submitJob = new tasks.LambdaInvoke(this, 'InvokeOrderProcessor', {
|
|
162
|
-
lambdaFunction: orderFn,
|
|
163
|
-
payload: sfn.TaskInput.fromObject({
|
|
164
|
-
OrderId: sfn.JsonPath.stringAt('$.OrderId'),
|
|
165
|
-
}),
|
|
166
|
-
});
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
The following methods are available:
|
|
170
|
-
|
|
171
|
-
| Method | Purpose |
|
|
172
|
-
|--------|---------|
|
|
173
|
-
| `JsonPath.stringAt('$.Field')` | reference a field, return the type as a `string`. |
|
|
174
|
-
| `JsonPath.listAt('$.Field')` | reference a field, return the type as a list of strings. |
|
|
175
|
-
| `JsonPath.numberAt('$.Field')` | reference a field, return the type as a number. Use this for functions that expect a number argument. |
|
|
176
|
-
| `JsonPath.objectAt('$.Field')` | reference a field, return the type as an `IResolvable`. Use this for functions that expect an object argument. |
|
|
177
|
-
| `JsonPath.entirePayload` | reference the entire data object (equivalent to a path of `$`). |
|
|
178
|
-
| `JsonPath.taskToken` | reference the [Task Token](https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token), used for integration patterns that need to run for a long time. |
|
|
179
|
-
|
|
180
|
-
You can also call [intrinsic functions](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html) using the methods on `JsonPath`:
|
|
181
|
-
|
|
182
|
-
| Method | Purpose |
|
|
183
|
-
|--------|---------|
|
|
184
|
-
| `JsonPath.array(JsonPath.stringAt('$.Field'), ...)` | make an array from other elements. |
|
|
185
|
-
| `JsonPath.format('The value is {}.', JsonPath.stringAt('$.Value'))` | insert elements into a format string. |
|
|
186
|
-
| `JsonPath.stringToJson(JsonPath.stringAt('$.ObjStr'))` | parse a JSON string to an object |
|
|
187
|
-
| `JsonPath.jsonToString(JsonPath.objectAt('$.Obj'))` | stringify an object to a JSON string |
|
|
188
|
-
|
|
189
|
-
## Amazon States Language
|
|
190
|
-
|
|
191
|
-
This library comes with a set of classes that model the [Amazon States
|
|
192
|
-
Language](https://states-language.net/spec.html). The following State classes
|
|
193
|
-
are supported:
|
|
194
|
-
|
|
195
|
-
* [`Task`](#task)
|
|
196
|
-
* [`Pass`](#pass)
|
|
197
|
-
* [`Wait`](#wait)
|
|
198
|
-
* [`Choice`](#choice)
|
|
199
|
-
* [`Parallel`](#parallel)
|
|
200
|
-
* [`Succeed`](#succeed)
|
|
201
|
-
* [`Fail`](#fail)
|
|
202
|
-
* [`Map`](#map)
|
|
203
|
-
* [`Custom State`](#custom-state)
|
|
204
|
-
|
|
205
|
-
An arbitrary JSON object (specified at execution start) is passed from state to
|
|
206
|
-
state and transformed during the execution of the workflow. For more
|
|
207
|
-
information, see the States Language spec.
|
|
208
|
-
|
|
209
|
-
### Task
|
|
210
|
-
|
|
211
|
-
A `Task` represents some work that needs to be done. Do not use the `Task` class directly.
|
|
212
|
-
|
|
213
|
-
Instead, use one of the classes in the `@aws-cdk/aws-stepfunctions-tasks` module,
|
|
214
|
-
which provide a much more ergonomic way to integrate with various AWS services.
|
|
215
|
-
|
|
216
|
-
### Pass
|
|
217
|
-
|
|
218
|
-
A `Pass` state passes its input to its output, without performing work.
|
|
219
|
-
Pass states are useful when constructing and debugging state machines.
|
|
220
|
-
|
|
221
|
-
The following example injects some fixed data into the state machine through
|
|
222
|
-
the `result` field. The `result` field will be added to the input and the result
|
|
223
|
-
will be passed as the state's output.
|
|
224
|
-
|
|
225
|
-
```ts
|
|
226
|
-
// Makes the current JSON state { ..., "subObject": { "hello": "world" } }
|
|
227
|
-
const pass = new sfn.Pass(this, 'Add Hello World', {
|
|
228
|
-
result: sfn.Result.fromObject({ hello: 'world' }),
|
|
229
|
-
resultPath: '$.subObject',
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
// Set the next state
|
|
233
|
-
const nextState = new sfn.Pass(this, 'NextState');
|
|
234
|
-
pass.next(nextState);
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
The `Pass` state also supports passing key-value pairs as input. Values can
|
|
238
|
-
be static, or selected from the input with a path.
|
|
239
|
-
|
|
240
|
-
The following example filters the `greeting` field from the state input
|
|
241
|
-
and also injects a field called `otherData`.
|
|
242
|
-
|
|
243
|
-
```ts
|
|
244
|
-
const pass = new sfn.Pass(this, 'Filter input and inject data', {
|
|
245
|
-
parameters: { // input to the pass state
|
|
246
|
-
input: sfn.JsonPath.stringAt('$.input.greeting'),
|
|
247
|
-
otherData: 'some-extra-stuff',
|
|
248
|
-
},
|
|
249
|
-
});
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
The object specified in `parameters` will be the input of the `Pass` state.
|
|
253
|
-
Since neither `Result` nor `ResultPath` are supplied, the `Pass` state copies
|
|
254
|
-
its input through to its output.
|
|
255
|
-
|
|
256
|
-
Learn more about the [Pass state](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-pass-state.html)
|
|
257
|
-
|
|
258
|
-
### Wait
|
|
259
|
-
|
|
260
|
-
A `Wait` state waits for a given number of seconds, or until the current time
|
|
261
|
-
hits a particular time. The time to wait may be taken from the execution's JSON
|
|
262
|
-
state.
|
|
263
|
-
|
|
264
|
-
```ts
|
|
265
|
-
// Wait until it's the time mentioned in the the state object's "triggerTime"
|
|
266
|
-
// field.
|
|
267
|
-
const wait = new sfn.Wait(this, 'Wait For Trigger Time', {
|
|
268
|
-
time: sfn.WaitTime.timestampPath('$.triggerTime'),
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
// Set the next state
|
|
272
|
-
const startTheWork = new sfn.Pass(this, 'StartTheWork');
|
|
273
|
-
wait.next(startTheWork);
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### Choice
|
|
277
|
-
|
|
278
|
-
A `Choice` state can take a different path through the workflow based on the
|
|
279
|
-
values in the execution's JSON state:
|
|
280
|
-
|
|
281
|
-
```ts
|
|
282
|
-
const choice = new sfn.Choice(this, 'Did it work?');
|
|
283
|
-
|
|
284
|
-
// Add conditions with .when()
|
|
285
|
-
const successState = new sfn.Pass(this, 'SuccessState');
|
|
286
|
-
const failureState = new sfn.Pass(this, 'FailureState');
|
|
287
|
-
choice.when(sfn.Condition.stringEquals('$.status', 'SUCCESS'), successState);
|
|
288
|
-
choice.when(sfn.Condition.numberGreaterThan('$.attempts', 5), failureState);
|
|
289
|
-
|
|
290
|
-
// Use .otherwise() to indicate what should be done if none of the conditions match
|
|
291
|
-
const tryAgainState = new sfn.Pass(this, 'TryAgainState');
|
|
292
|
-
choice.otherwise(tryAgainState);
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
If you want to temporarily branch your workflow based on a condition, but have
|
|
296
|
-
all branches come together and continuing as one (similar to how an `if ...
|
|
297
|
-
then ... else` works in a programming language), use the `.afterwards()` method:
|
|
298
|
-
|
|
299
|
-
```ts
|
|
300
|
-
const choice = new sfn.Choice(this, 'What color is it?');
|
|
301
|
-
const handleBlueItem = new sfn.Pass(this, 'HandleBlueItem');
|
|
302
|
-
const handleRedItem = new sfn.Pass(this, 'HandleRedItem');
|
|
303
|
-
const handleOtherItemColor = new sfn.Pass(this, 'HanldeOtherItemColor');
|
|
304
|
-
choice.when(sfn.Condition.stringEquals('$.color', 'BLUE'), handleBlueItem);
|
|
305
|
-
choice.when(sfn.Condition.stringEquals('$.color', 'RED'), handleRedItem);
|
|
306
|
-
choice.otherwise(handleOtherItemColor);
|
|
307
|
-
|
|
308
|
-
// Use .afterwards() to join all possible paths back together and continue
|
|
309
|
-
const shipTheItem = new sfn.Pass(this, 'ShipTheItem');
|
|
310
|
-
choice.afterwards().next(shipTheItem);
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
If your `Choice` doesn't have an `otherwise()` and none of the conditions match
|
|
314
|
-
the JSON state, a `NoChoiceMatched` error will be thrown. Wrap the state machine
|
|
315
|
-
in a `Parallel` state if you want to catch and recover from this.
|
|
316
|
-
|
|
317
|
-
#### Available Conditions
|
|
318
|
-
|
|
319
|
-
see [step function comparison operators](https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html#amazon-states-language-choice-state-rules)
|
|
320
|
-
|
|
321
|
-
* `Condition.isPresent` - matches if a json path is present
|
|
322
|
-
* `Condition.isNotPresent` - matches if a json path is not present
|
|
323
|
-
* `Condition.isString` - matches if a json path contains a string
|
|
324
|
-
* `Condition.isNotString` - matches if a json path is not a string
|
|
325
|
-
* `Condition.isNumeric` - matches if a json path is numeric
|
|
326
|
-
* `Condition.isNotNumeric` - matches if a json path is not numeric
|
|
327
|
-
* `Condition.isBoolean` - matches if a json path is boolean
|
|
328
|
-
* `Condition.isNotBoolean` - matches if a json path is not boolean
|
|
329
|
-
* `Condition.isTimestamp` - matches if a json path is a timestamp
|
|
330
|
-
* `Condition.isNotTimestamp` - matches if a json path is not a timestamp
|
|
331
|
-
* `Condition.isNotNull` - matches if a json path is not null
|
|
332
|
-
* `Condition.isNull` - matches if a json path is null
|
|
333
|
-
* `Condition.booleanEquals` - matches if a boolean field has a given value
|
|
334
|
-
* `Condition.booleanEqualsJsonPath` - matches if a boolean field equals a value in a given mapping path
|
|
335
|
-
* `Condition.stringEqualsJsonPath` - matches if a string field equals a given mapping path
|
|
336
|
-
* `Condition.stringEquals` - matches if a field equals a string value
|
|
337
|
-
* `Condition.stringLessThan` - matches if a string field sorts before a given value
|
|
338
|
-
* `Condition.stringLessThanJsonPath` - matches if a string field sorts before a value at given mapping path
|
|
339
|
-
* `Condition.stringLessThanEquals` - matches if a string field sorts equal to or before a given value
|
|
340
|
-
* `Condition.stringLessThanEqualsJsonPath` - matches if a string field sorts equal to or before a given mapping
|
|
341
|
-
* `Condition.stringGreaterThan` - matches if a string field sorts after a given value
|
|
342
|
-
* `Condition.stringGreaterThanJsonPath` - matches if a string field sorts after a value at a given mapping path
|
|
343
|
-
* `Condition.stringGreaterThanEqualsJsonPath` - matches if a string field sorts after or equal to value at a given mapping path
|
|
344
|
-
* `Condition.stringGreaterThanEquals` - matches if a string field sorts after or equal to a given value
|
|
345
|
-
* `Condition.numberEquals` - matches if a numeric field has the given value
|
|
346
|
-
* `Condition.numberEqualsJsonPath` - matches if a numeric field has the value in a given mapping path
|
|
347
|
-
* `Condition.numberLessThan` - matches if a numeric field is less than the given value
|
|
348
|
-
* `Condition.numberLessThanJsonPath` - matches if a numeric field is less than the value at the given mapping path
|
|
349
|
-
* `Condition.numberLessThanEquals` - matches if a numeric field is less than or equal to the given value
|
|
350
|
-
* `Condition.numberLessThanEqualsJsonPath` - matches if a numeric field is less than or equal to the numeric value at given mapping path
|
|
351
|
-
* `Condition.numberGreaterThan` - matches if a numeric field is greater than the given value
|
|
352
|
-
* `Condition.numberGreaterThanJsonPath` - matches if a numeric field is greater than the value at a given mapping path
|
|
353
|
-
* `Condition.numberGreaterThanEquals` - matches if a numeric field is greater than or equal to the given value
|
|
354
|
-
* `Condition.numberGreaterThanEqualsJsonPath` - matches if a numeric field is greater than or equal to the value at a given mapping path
|
|
355
|
-
* `Condition.timestampEquals` - matches if a timestamp field is the same time as the given timestamp
|
|
356
|
-
* `Condition.timestampEqualsJsonPath` - matches if a timestamp field is the same time as the timestamp at a given mapping path
|
|
357
|
-
* `Condition.timestampLessThan` - matches if a timestamp field is before the given timestamp
|
|
358
|
-
* `Condition.timestampLessThanJsonPath` - matches if a timestamp field is before the timestamp at a given mapping path
|
|
359
|
-
* `Condition.timestampLessThanEquals` - matches if a timestamp field is before or equal to the given timestamp
|
|
360
|
-
* `Condition.timestampLessThanEqualsJsonPath` - matches if a timestamp field is before or equal to the timestamp at a given mapping path
|
|
361
|
-
* `Condition.timestampGreaterThan` - matches if a timestamp field is after the timestamp at a given mapping path
|
|
362
|
-
* `Condition.timestampGreaterThanJsonPath` - matches if a timestamp field is after the timestamp at a given mapping path
|
|
363
|
-
* `Condition.timestampGreaterThanEquals` - matches if a timestamp field is after or equal to the given timestamp
|
|
364
|
-
* `Condition.timestampGreaterThanEqualsJsonPath` - matches if a timestamp field is after or equal to the timestamp at a given mapping path
|
|
365
|
-
* `Condition.stringMatches` - matches if a field matches a string pattern that can contain a wild card (\*) e.g: log-\*.txt or \*LATEST\*. No other characters other than "\*" have any special meaning - \* can be escaped: \\\\*
|
|
366
|
-
|
|
367
|
-
### Parallel
|
|
368
|
-
|
|
369
|
-
A `Parallel` state executes one or more subworkflows in parallel. It can also
|
|
370
|
-
be used to catch and recover from errors in subworkflows.
|
|
371
|
-
|
|
372
|
-
```ts
|
|
373
|
-
const parallel = new sfn.Parallel(this, 'Do the work in parallel');
|
|
374
|
-
|
|
375
|
-
// Add branches to be executed in parallel
|
|
376
|
-
const shipItem = new sfn.Pass(this, 'ShipItem');
|
|
377
|
-
const sendInvoice = new sfn.Pass(this, 'SendInvoice');
|
|
378
|
-
const restock = new sfn.Pass(this, 'Restock');
|
|
379
|
-
parallel.branch(shipItem);
|
|
380
|
-
parallel.branch(sendInvoice);
|
|
381
|
-
parallel.branch(restock);
|
|
382
|
-
|
|
383
|
-
// Retry the whole workflow if something goes wrong
|
|
384
|
-
parallel.addRetry({ maxAttempts: 1 });
|
|
385
|
-
|
|
386
|
-
// How to recover from errors
|
|
387
|
-
const sendFailureNotification = new sfn.Pass(this, 'SendFailureNotification');
|
|
388
|
-
parallel.addCatch(sendFailureNotification);
|
|
389
|
-
|
|
390
|
-
// What to do in case everything succeeded
|
|
391
|
-
const closeOrder = new sfn.Pass(this, 'CloseOrder');
|
|
392
|
-
parallel.next(closeOrder);
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
### Succeed
|
|
396
|
-
|
|
397
|
-
Reaching a `Succeed` state terminates the state machine execution with a
|
|
398
|
-
successful status.
|
|
399
|
-
|
|
400
|
-
```ts
|
|
401
|
-
const success = new sfn.Succeed(this, 'We did it!');
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
### Fail
|
|
405
|
-
|
|
406
|
-
Reaching a `Fail` state terminates the state machine execution with a
|
|
407
|
-
failure status. The fail state should report the reason for the failure.
|
|
408
|
-
Failures can be caught by encompassing `Parallel` states.
|
|
409
|
-
|
|
410
|
-
```ts
|
|
411
|
-
const success = new sfn.Fail(this, 'Fail', {
|
|
412
|
-
error: 'WorkflowFailure',
|
|
413
|
-
cause: "Something went wrong",
|
|
414
|
-
});
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
### Map
|
|
418
|
-
|
|
419
|
-
A `Map` state can be used to run a set of steps for each element of an input array.
|
|
420
|
-
A `Map` state will execute the same steps for multiple entries of an array in the state input.
|
|
421
|
-
|
|
422
|
-
While the `Parallel` state executes multiple branches of steps using the same input, a `Map` state will
|
|
423
|
-
execute the same steps for multiple entries of an array in the state input.
|
|
424
|
-
|
|
425
|
-
```ts
|
|
426
|
-
const map = new sfn.Map(this, 'Map State', {
|
|
427
|
-
maxConcurrency: 1,
|
|
428
|
-
itemsPath: sfn.JsonPath.stringAt('$.inputForMap'),
|
|
429
|
-
});
|
|
430
|
-
map.iterator(new sfn.Pass(this, 'Pass State'));
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
### Custom State
|
|
434
|
-
|
|
435
|
-
It's possible that the high-level constructs for the states or `stepfunctions-tasks` do not have
|
|
436
|
-
the states or service integrations you are looking for. The primary reasons for this lack of
|
|
437
|
-
functionality are:
|
|
438
|
-
|
|
439
|
-
* A [service integration](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-service-integrations.html) is available through Amazon States Langauge, but not available as construct
|
|
440
|
-
classes in the CDK.
|
|
441
|
-
* The state or state properties are available through Step Functions, but are not configurable
|
|
442
|
-
through constructs
|
|
443
|
-
|
|
444
|
-
If a feature is not available, a `CustomState` can be used to supply any Amazon States Language
|
|
445
|
-
JSON-based object as the state definition.
|
|
446
|
-
|
|
447
|
-
[Code Snippets](https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-code-snippet.html#tutorial-code-snippet-1) are available and can be plugged in as the state definition.
|
|
448
|
-
|
|
449
|
-
Custom states can be chained together with any of the other states to create your state machine
|
|
450
|
-
definition. You will also need to provide any permissions that are required to the `role` that
|
|
451
|
-
the State Machine uses.
|
|
452
|
-
|
|
453
|
-
The following example uses the `DynamoDB` service integration to insert data into a DynamoDB table.
|
|
454
|
-
|
|
455
|
-
```ts
|
|
456
|
-
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
|
|
457
|
-
|
|
458
|
-
// create a table
|
|
459
|
-
const table = new dynamodb.Table(this, 'montable', {
|
|
460
|
-
partitionKey: {
|
|
461
|
-
name: 'id',
|
|
462
|
-
type: dynamodb.AttributeType.STRING,
|
|
463
|
-
},
|
|
464
|
-
});
|
|
465
|
-
|
|
466
|
-
const finalStatus = new sfn.Pass(this, 'final step');
|
|
467
|
-
|
|
468
|
-
// States language JSON to put an item into DynamoDB
|
|
469
|
-
// snippet generated from https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-code-snippet.html#tutorial-code-snippet-1
|
|
470
|
-
const stateJson = {
|
|
471
|
-
Type: 'Task',
|
|
472
|
-
Resource: 'arn:aws:states:::dynamodb:putItem',
|
|
473
|
-
Parameters: {
|
|
474
|
-
TableName: table.tableName,
|
|
475
|
-
Item: {
|
|
476
|
-
id: {
|
|
477
|
-
S: 'MyEntry',
|
|
478
|
-
},
|
|
479
|
-
},
|
|
480
|
-
},
|
|
481
|
-
ResultPath: null,
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
// custom state which represents a task to insert data into DynamoDB
|
|
485
|
-
const custom = new sfn.CustomState(this, 'my custom task', {
|
|
486
|
-
stateJson,
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
const chain = sfn.Chain.start(custom)
|
|
490
|
-
.next(finalStatus);
|
|
491
|
-
|
|
492
|
-
const sm = new sfn.StateMachine(this, 'StateMachine', {
|
|
493
|
-
definition: chain,
|
|
494
|
-
timeout: Duration.seconds(30),
|
|
495
|
-
});
|
|
496
|
-
|
|
497
|
-
// don't forget permissions. You need to assign them
|
|
498
|
-
table.grantWriteData(sm);
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
## Task Chaining
|
|
502
|
-
|
|
503
|
-
To make defining work flows as convenient (and readable in a top-to-bottom way)
|
|
504
|
-
as writing regular programs, it is possible to chain most methods invocations.
|
|
505
|
-
In particular, the `.next()` method can be repeated. The result of a series of
|
|
506
|
-
`.next()` calls is called a **Chain**, and can be used when defining the jump
|
|
507
|
-
targets of `Choice.on` or `Parallel.branch`:
|
|
508
|
-
|
|
509
|
-
```ts
|
|
510
|
-
const step1 = new sfn.Pass(this, 'Step1');
|
|
511
|
-
const step2 = new sfn.Pass(this, 'Step2');
|
|
512
|
-
const step3 = new sfn.Pass(this, 'Step3');
|
|
513
|
-
const step4 = new sfn.Pass(this, 'Step4');
|
|
514
|
-
const step5 = new sfn.Pass(this, 'Step5');
|
|
515
|
-
const step6 = new sfn.Pass(this, 'Step6');
|
|
516
|
-
const step7 = new sfn.Pass(this, 'Step7');
|
|
517
|
-
const step8 = new sfn.Pass(this, 'Step8');
|
|
518
|
-
const step9 = new sfn.Pass(this, 'Step9');
|
|
519
|
-
const step10 = new sfn.Pass(this, 'Step10');
|
|
520
|
-
const choice = new sfn.Choice(this, 'Choice');
|
|
521
|
-
const condition1 = sfn.Condition.stringEquals('$.status', 'SUCCESS');
|
|
522
|
-
const parallel = new sfn.Parallel(this, 'Parallel');
|
|
523
|
-
const finish = new sfn.Pass(this, 'Finish');
|
|
524
|
-
|
|
525
|
-
const definition = step1
|
|
526
|
-
.next(step2)
|
|
527
|
-
.next(choice
|
|
528
|
-
.when(condition1, step3.next(step4).next(step5))
|
|
529
|
-
.otherwise(step6)
|
|
530
|
-
.afterwards())
|
|
531
|
-
.next(parallel
|
|
532
|
-
.branch(step7.next(step8))
|
|
533
|
-
.branch(step9.next(step10)))
|
|
534
|
-
.next(finish);
|
|
535
|
-
|
|
536
|
-
new sfn.StateMachine(this, 'StateMachine', {
|
|
537
|
-
definition,
|
|
538
|
-
});
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
If you don't like the visual look of starting a chain directly off the first
|
|
542
|
-
step, you can use `Chain.start`:
|
|
543
|
-
|
|
544
|
-
```ts
|
|
545
|
-
const step1 = new sfn.Pass(this, 'Step1');
|
|
546
|
-
const step2 = new sfn.Pass(this, 'Step2');
|
|
547
|
-
const step3 = new sfn.Pass(this, 'Step3');
|
|
548
|
-
|
|
549
|
-
const definition = sfn.Chain
|
|
550
|
-
.start(step1)
|
|
551
|
-
.next(step2)
|
|
552
|
-
.next(step3)
|
|
553
|
-
// ...
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
## State Machine Fragments
|
|
557
|
-
|
|
558
|
-
It is possible to define reusable (or abstracted) mini-state machines by
|
|
559
|
-
defining a construct that implements `IChainable`, which requires you to define
|
|
560
|
-
two fields:
|
|
561
|
-
|
|
562
|
-
* `startState: State`, representing the entry point into this state machine.
|
|
563
|
-
* `endStates: INextable[]`, representing the (one or more) states that outgoing
|
|
564
|
-
transitions will be added to if you chain onto the fragment.
|
|
565
|
-
|
|
566
|
-
Since states will be named after their construct IDs, you may need to prefix the
|
|
567
|
-
IDs of states if you plan to instantiate the same state machine fragment
|
|
568
|
-
multiples times (otherwise all states in every instantiation would have the same
|
|
569
|
-
name).
|
|
570
|
-
|
|
571
|
-
The class `StateMachineFragment` contains some helper functions (like
|
|
572
|
-
`prefixStates()`) to make it easier for you to do this. If you define your state
|
|
573
|
-
machine as a subclass of this, it will be convenient to use:
|
|
574
|
-
|
|
575
|
-
```ts nofixture
|
|
576
|
-
import { Stack } from 'aws-cdk-lib';
|
|
577
|
-
import { Construct } from 'constructs';
|
|
578
|
-
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
|
|
579
|
-
|
|
580
|
-
interface MyJobProps {
|
|
581
|
-
jobFlavor: string;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
class MyJob extends sfn.StateMachineFragment {
|
|
585
|
-
public readonly startState: sfn.State;
|
|
586
|
-
public readonly endStates: sfn.INextable[];
|
|
587
|
-
|
|
588
|
-
constructor(parent: Construct, id: string, props: MyJobProps) {
|
|
589
|
-
super(parent, id);
|
|
590
|
-
|
|
591
|
-
const choice = new sfn.Choice(this, 'Choice')
|
|
592
|
-
.when(sfn.Condition.stringEquals('$.branch', 'left'), new sfn.Pass(this, 'Left Branch'))
|
|
593
|
-
.when(sfn.Condition.stringEquals('$.branch', 'right'), new sfn.Pass(this, 'Right Branch'));
|
|
594
|
-
|
|
595
|
-
// ...
|
|
596
|
-
|
|
597
|
-
this.startState = choice;
|
|
598
|
-
this.endStates = choice.afterwards().endStates;
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
class MyStack extends Stack {
|
|
603
|
-
constructor(scope: Construct, id: string) {
|
|
604
|
-
super(scope, id);
|
|
605
|
-
// Do 3 different variants of MyJob in parallel
|
|
606
|
-
const parallel = new sfn.Parallel(this, 'All jobs')
|
|
607
|
-
.branch(new MyJob(this, 'Quick', { jobFlavor: 'quick' }).prefixStates())
|
|
608
|
-
.branch(new MyJob(this, 'Medium', { jobFlavor: 'medium' }).prefixStates())
|
|
609
|
-
.branch(new MyJob(this, 'Slow', { jobFlavor: 'slow' }).prefixStates());
|
|
610
|
-
|
|
611
|
-
new sfn.StateMachine(this, 'MyStateMachine', {
|
|
612
|
-
definition: parallel,
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
```
|
|
617
|
-
|
|
618
|
-
A few utility functions are available to parse state machine fragments.
|
|
619
|
-
|
|
620
|
-
* `State.findReachableStates`: Retrieve the list of states reachable from a given state.
|
|
621
|
-
* `State.findReachableEndStates`: Retrieve the list of end or terminal states reachable from a given state.
|
|
622
|
-
|
|
623
|
-
## Activity
|
|
624
|
-
|
|
625
|
-
**Activities** represent work that is done on some non-Lambda worker pool. The
|
|
626
|
-
Step Functions workflow will submit work to this Activity, and a worker pool
|
|
627
|
-
that you run yourself, probably on EC2, will pull jobs from the Activity and
|
|
628
|
-
submit the results of individual jobs back.
|
|
629
|
-
|
|
630
|
-
You need the ARN to do so, so if you use Activities be sure to pass the Activity
|
|
631
|
-
ARN into your worker pool:
|
|
632
|
-
|
|
633
|
-
```ts
|
|
634
|
-
const activity = new sfn.Activity(this, 'Activity');
|
|
635
|
-
|
|
636
|
-
// Read this CloudFormation Output from your application and use it to poll for work on
|
|
637
|
-
// the activity.
|
|
638
|
-
new CfnOutput(this, 'ActivityArn', { value: activity.activityArn });
|
|
639
|
-
```
|
|
640
|
-
|
|
641
|
-
### Activity-Level Permissions
|
|
642
|
-
|
|
643
|
-
Granting IAM permissions to an activity can be achieved by calling the `grant(principal, actions)` API:
|
|
644
|
-
|
|
645
|
-
```ts
|
|
646
|
-
const activity = new sfn.Activity(this, 'Activity');
|
|
647
|
-
|
|
648
|
-
const role = new iam.Role(this, 'Role', {
|
|
649
|
-
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
|
|
650
|
-
});
|
|
651
|
-
|
|
652
|
-
activity.grant(role, 'states:SendTaskSuccess');
|
|
653
|
-
```
|
|
654
|
-
|
|
655
|
-
This will grant the IAM principal the specified actions onto the activity.
|
|
656
|
-
|
|
657
|
-
## Metrics
|
|
658
|
-
|
|
659
|
-
`Task` object expose various metrics on the execution of that particular task. For example,
|
|
660
|
-
to create an alarm on a particular task failing:
|
|
661
|
-
|
|
662
|
-
```ts
|
|
663
|
-
declare const task: sfn.Task;
|
|
664
|
-
new cloudwatch.Alarm(this, 'TaskAlarm', {
|
|
665
|
-
metric: task.metricFailed(),
|
|
666
|
-
threshold: 1,
|
|
667
|
-
evaluationPeriods: 1,
|
|
668
|
-
});
|
|
669
|
-
```
|
|
670
|
-
|
|
671
|
-
There are also metrics on the complete state machine:
|
|
672
|
-
|
|
673
|
-
```ts
|
|
674
|
-
declare const stateMachine: sfn.StateMachine;
|
|
675
|
-
new cloudwatch.Alarm(this, 'StateMachineAlarm', {
|
|
676
|
-
metric: stateMachine.metricFailed(),
|
|
677
|
-
threshold: 1,
|
|
678
|
-
evaluationPeriods: 1,
|
|
679
|
-
});
|
|
680
|
-
```
|
|
681
|
-
|
|
682
|
-
And there are metrics on the capacity of all state machines in your account:
|
|
683
|
-
|
|
684
|
-
```ts
|
|
685
|
-
new cloudwatch.Alarm(this, 'ThrottledAlarm', {
|
|
686
|
-
metric: sfn.StateTransitionMetric.metricThrottledEvents(),
|
|
687
|
-
threshold: 10,
|
|
688
|
-
evaluationPeriods: 2,
|
|
689
|
-
});
|
|
690
|
-
```
|
|
691
|
-
|
|
692
|
-
## Error names
|
|
693
|
-
|
|
694
|
-
Step Functions identifies errors in the Amazon States Language using case-sensitive strings, known as error names.
|
|
695
|
-
The Amazon States Language defines a set of built-in strings that name well-known errors, all beginning with the `States.` prefix.
|
|
696
|
-
|
|
697
|
-
* `States.ALL` - A wildcard that matches any known error name.
|
|
698
|
-
* `States.Runtime` - An execution failed due to some exception that could not be processed. Often these are caused by errors at runtime, such as attempting to apply InputPath or OutputPath on a null JSON payload. A `States.Runtime` error is not retriable, and will always cause the execution to fail. A retry or catch on `States.ALL` will NOT catch States.Runtime errors.
|
|
699
|
-
* `States.DataLimitExceeded` - A States.DataLimitExceeded exception will be thrown for the following:
|
|
700
|
-
* When the output of a connector is larger than payload size quota.
|
|
701
|
-
* When the output of a state is larger than payload size quota.
|
|
702
|
-
* When, after Parameters processing, the input of a state is larger than the payload size quota.
|
|
703
|
-
* See [the AWS documentation](https://docs.aws.amazon.com/step-functions/latest/dg/limits-overview.html) to learn more about AWS Step Functions Quotas.
|
|
704
|
-
* `States.HeartbeatTimeout` - A Task state failed to send a heartbeat for a period longer than the HeartbeatSeconds value.
|
|
705
|
-
* `States.Timeout` - A Task state either ran longer than the TimeoutSeconds value, or failed to send a heartbeat for a period longer than the HeartbeatSeconds value.
|
|
706
|
-
* `States.TaskFailed`- A Task state failed during the execution. When used in a retry or catch, `States.TaskFailed` acts as a wildcard that matches any known error name except for `States.Timeout`.
|
|
707
|
-
|
|
708
|
-
## Logging
|
|
709
|
-
|
|
710
|
-
Enable logging to CloudWatch by passing a logging configuration with a
|
|
711
|
-
destination LogGroup:
|
|
712
|
-
|
|
713
|
-
```ts
|
|
714
|
-
import * as logs from 'aws-cdk-lib/aws-logs';
|
|
715
|
-
|
|
716
|
-
const logGroup = new logs.LogGroup(this, 'MyLogGroup');
|
|
717
|
-
|
|
718
|
-
new sfn.StateMachine(this, 'MyStateMachine', {
|
|
719
|
-
definition: sfn.Chain.start(new sfn.Pass(this, 'Pass')),
|
|
720
|
-
logs: {
|
|
721
|
-
destination: logGroup,
|
|
722
|
-
level: sfn.LogLevel.ALL,
|
|
723
|
-
},
|
|
724
|
-
});
|
|
725
|
-
```
|
|
726
|
-
|
|
727
|
-
## X-Ray tracing
|
|
728
|
-
|
|
729
|
-
Enable X-Ray tracing for StateMachine:
|
|
730
|
-
|
|
731
|
-
```ts
|
|
732
|
-
new sfn.StateMachine(this, 'MyStateMachine', {
|
|
733
|
-
definition: sfn.Chain.start(new sfn.Pass(this, 'Pass')),
|
|
734
|
-
tracingEnabled: true,
|
|
735
|
-
});
|
|
736
|
-
```
|
|
737
|
-
|
|
738
|
-
See [the AWS documentation](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-xray-tracing.html)
|
|
739
|
-
to learn more about AWS Step Functions's X-Ray support.
|
|
740
|
-
|
|
741
|
-
## State Machine Permission Grants
|
|
742
|
-
|
|
743
|
-
IAM roles, users, or groups which need to be able to work with a State Machine should be granted IAM permissions.
|
|
744
|
-
|
|
745
|
-
Any object that implements the `IGrantable` interface (has an associated principal) can be granted permissions by calling:
|
|
746
|
-
|
|
747
|
-
* `stateMachine.grantStartExecution(principal)` - grants the principal the ability to execute the state machine
|
|
748
|
-
* `stateMachine.grantRead(principal)` - grants the principal read access
|
|
749
|
-
* `stateMachine.grantTaskResponse(principal)` - grants the principal the ability to send task tokens to the state machine
|
|
750
|
-
* `stateMachine.grantExecution(principal, actions)` - grants the principal execution-level permissions for the IAM actions specified
|
|
751
|
-
* `stateMachine.grant(principal, actions)` - grants the principal state-machine-level permissions for the IAM actions specified
|
|
752
|
-
|
|
753
|
-
### Start Execution Permission
|
|
754
|
-
|
|
755
|
-
Grant permission to start an execution of a state machine by calling the `grantStartExecution()` API.
|
|
756
|
-
|
|
757
|
-
```ts
|
|
758
|
-
const role = new iam.Role(this, 'Role', {
|
|
759
|
-
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
|
|
760
|
-
});
|
|
761
|
-
|
|
762
|
-
declare const definition: sfn.IChainable;
|
|
763
|
-
const stateMachine = new sfn.StateMachine(this, 'StateMachine', {
|
|
764
|
-
definition,
|
|
765
|
-
});
|
|
766
|
-
|
|
767
|
-
// Give role permission to start execution of state machine
|
|
768
|
-
stateMachine.grantStartExecution(role);
|
|
769
|
-
```
|
|
770
|
-
|
|
771
|
-
The following permission is provided to a service principal by the `grantStartExecution()` API:
|
|
772
|
-
|
|
773
|
-
* `states:StartExecution` - to state machine
|
|
774
|
-
|
|
775
|
-
### Read Permissions
|
|
776
|
-
|
|
777
|
-
Grant `read` access to a state machine by calling the `grantRead()` API.
|
|
778
|
-
|
|
779
|
-
```ts
|
|
780
|
-
const role = new iam.Role(this, 'Role', {
|
|
781
|
-
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
|
|
782
|
-
});
|
|
783
|
-
|
|
784
|
-
declare const definition: sfn.IChainable;
|
|
785
|
-
const stateMachine = new sfn.StateMachine(this, 'StateMachine', {
|
|
786
|
-
definition,
|
|
787
|
-
});
|
|
788
|
-
|
|
789
|
-
// Give role read access to state machine
|
|
790
|
-
stateMachine.grantRead(role);
|
|
791
|
-
```
|
|
792
|
-
|
|
793
|
-
The following read permissions are provided to a service principal by the `grantRead()` API:
|
|
794
|
-
|
|
795
|
-
* `states:ListExecutions` - to state machine
|
|
796
|
-
* `states:ListStateMachines` - to state machine
|
|
797
|
-
* `states:DescribeExecution` - to executions
|
|
798
|
-
* `states:DescribeStateMachineForExecution` - to executions
|
|
799
|
-
* `states:GetExecutionHistory` - to executions
|
|
800
|
-
* `states:ListActivities` - to `*`
|
|
801
|
-
* `states:DescribeStateMachine` - to `*`
|
|
802
|
-
* `states:DescribeActivity` - to `*`
|
|
803
|
-
|
|
804
|
-
### Task Response Permissions
|
|
805
|
-
|
|
806
|
-
Grant permission to allow task responses to a state machine by calling the `grantTaskResponse()` API:
|
|
807
|
-
|
|
808
|
-
```ts
|
|
809
|
-
const role = new iam.Role(this, 'Role', {
|
|
810
|
-
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
|
|
811
|
-
});
|
|
812
|
-
|
|
813
|
-
declare const definition: sfn.IChainable;
|
|
814
|
-
const stateMachine = new sfn.StateMachine(this, 'StateMachine', {
|
|
815
|
-
definition,
|
|
816
|
-
});
|
|
817
|
-
|
|
818
|
-
// Give role task response permissions to the state machine
|
|
819
|
-
stateMachine.grantTaskResponse(role);
|
|
820
|
-
```
|
|
821
|
-
|
|
822
|
-
The following read permissions are provided to a service principal by the `grantRead()` API:
|
|
823
|
-
|
|
824
|
-
* `states:SendTaskSuccess` - to state machine
|
|
825
|
-
* `states:SendTaskFailure` - to state machine
|
|
826
|
-
* `states:SendTaskHeartbeat` - to state machine
|
|
827
|
-
|
|
828
|
-
### Execution-level Permissions
|
|
829
|
-
|
|
830
|
-
Grant execution-level permissions to a state machine by calling the `grantExecution()` API:
|
|
831
|
-
|
|
832
|
-
```ts
|
|
833
|
-
const role = new iam.Role(this, 'Role', {
|
|
834
|
-
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
|
|
835
|
-
});
|
|
836
|
-
|
|
837
|
-
declare const definition: sfn.IChainable;
|
|
838
|
-
const stateMachine = new sfn.StateMachine(this, 'StateMachine', {
|
|
839
|
-
definition,
|
|
840
|
-
});
|
|
841
|
-
|
|
842
|
-
// Give role permission to get execution history of ALL executions for the state machine
|
|
843
|
-
stateMachine.grantExecution(role, 'states:GetExecutionHistory');
|
|
844
|
-
```
|
|
845
|
-
|
|
846
|
-
### Custom Permissions
|
|
847
|
-
|
|
848
|
-
You can add any set of permissions to a state machine by calling the `grant()` API.
|
|
849
|
-
|
|
850
|
-
```ts
|
|
851
|
-
const user = new iam.User(this, 'MyUser');
|
|
852
|
-
|
|
853
|
-
declare const definition: sfn.IChainable;
|
|
854
|
-
const stateMachine = new sfn.StateMachine(this, 'StateMachine', {
|
|
855
|
-
definition,
|
|
856
|
-
});
|
|
857
|
-
|
|
858
|
-
//give user permission to send task success to the state machine
|
|
859
|
-
stateMachine.grant(user, 'states:SendTaskSuccess');
|
|
860
|
-
```
|
|
861
|
-
|
|
862
|
-
## Import
|
|
863
|
-
|
|
864
|
-
Any Step Functions state machine that has been created outside the stack can be imported
|
|
865
|
-
into your CDK stack.
|
|
866
|
-
|
|
867
|
-
State machines can be imported by their ARN via the `StateMachine.fromStateMachineArn()` API.
|
|
868
|
-
In addition, the StateMachine can be imported via the `StateMachine.fromStateMachineName()` method, as long as they are in the same account/region as the current construct.
|
|
869
|
-
|
|
870
|
-
```ts
|
|
871
|
-
const app = new App();
|
|
872
|
-
const stack = new Stack(app, 'MyStack');
|
|
873
|
-
sfn.StateMachine.fromStateMachineArn(
|
|
874
|
-
stack,
|
|
875
|
-
"ViaArnImportedStateMachine",
|
|
876
|
-
"arn:aws:states:us-east-1:123456789012:stateMachine:StateMachine2E01A3A5-N5TJppzoevKQ"
|
|
877
|
-
);
|
|
878
|
-
|
|
879
|
-
sfn.StateMachine.fromStateMachineName(
|
|
880
|
-
stack,
|
|
881
|
-
"ViaResourceNameImportedStateMachine",
|
|
882
|
-
"StateMachine2E01A3A5-N5TJppzoevKQ"
|
|
883
|
-
);
|
|
884
|
-
```
|