-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add feature for Step Functions. * AWS function for wrapping the step function * Added docs and examples for how to run step functions and check on them * Update package.json * Updated yarn file * tz/297/aws-step-functions * fix linting ---------
- Loading branch information
1 parent
856c36e
commit 8a01dc5
Showing
8 changed files
with
1,109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import aws from 'api/src/lib/aws' | ||
|
||
export default async ({ args }) => { | ||
/* | ||
Example running: | ||
yarn redwood exec awsTest --input '{"var1":"val1"}' --arn arn:aws:states:us-west-2:000000000000:stateMachine:run-sample-functions --name "testing" | ||
Using the executionArn from above in the next command. | ||
The arn should looks something like | ||
arn:aws:states:us-west-2:000000000000:execution:run-sample-functions:8110adbe-6807-443f-82ba-6acf9bc527ea | ||
To check the output, do the following: | ||
docker exec -it cpf-reporter-localstack-main /bin/bash | ||
awslocal stepfunctions describe-execution --execution-arn [executionArn from above] | ||
*/ | ||
|
||
console.log(':: Executing script with args ::') | ||
console.log(`Received following arguments: ${Object.keys(args)}`) | ||
|
||
const result = await aws.startStepFunctionExecution(args.arn, args.name, args.input, ''); | ||
console.log(result); | ||
console.log(result.body); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* To build this, zip it using zip scripts/function.zip scripts/sample_lambda.js | ||
*/ | ||
exports.handler = async (event) => { | ||
//console.log("EVENT: " + JSON.stringify(event)); | ||
const response = { | ||
statusCode: 200, | ||
body: "Hello from my LocalStack Lambda function!\n" + event.input, | ||
}; | ||
return response; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
""" | ||
To build this, zip it using zip scripts/function.zip scripts/sample_lambda.py | ||
""" | ||
def lambda_handler(event, context): | ||
print(event) | ||
return {k: f"{v}_sample" for k, v in event["input"].items()} |
Oops, something went wrong.