From ba55903500d86061b31b57fe2760641990fcbc0e Mon Sep 17 00:00:00 2001 From: ljacobsson Date: Sat, 24 Jun 2023 00:29:11 +0200 Subject: [PATCH] new feature :tada: - invoke Lambda and StateMachines --- package.json | 2 +- src/commands/invoke/stepFunctionsInvoker.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 34b3d01..981558f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sam-patterns-cli", - "version": "0.0.49", + "version": "0.0.50", "description": "Command line interface for quickly using patterns from https://github.com/aws-samples/serverless-patterns/", "main": "index.js", "scripts": { diff --git a/src/commands/invoke/stepFunctionsInvoker.js b/src/commands/invoke/stepFunctionsInvoker.js index b76ed48..d1d4086 100644 --- a/src/commands/invoke/stepFunctionsInvoker.js +++ b/src/commands/invoke/stepFunctionsInvoker.js @@ -109,10 +109,13 @@ async function invoke(cmd, sfnArn) { console.log("Invoking state machine with payload:", concatenateAndAddDots(cmd.payload, 100)) const data = await sfnClient.send(params); const response = data.executionArn; + let url; if (response.includes(":express:")) { - const url = `https://${cmd.region}.console.aws.amazon.com/states/home?region=${cmd.region}#/express-executions/details/${response}?startDate=${data.startDate.getTime()}` - console.log("Started:", url); + url = `https://${cmd.region}.console.aws.amazon.com/states/home?region=${cmd.region}#/express-executions/details/${response}?startDate=${data.startDate.getTime()}` + } else { + url = `https://${cmd.region}.console.aws.amazon.com/states/home?region=${cmd.region}#/v2/executions/details/${response}`; } + console.log("Started:", url); } catch (err) { console.log("Error", err);