sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.07k stars 118 forks source link

AWS Step Functions #376

Open garretcharp opened 1 month ago

garretcharp commented 1 month ago

Any chance the way step functions are built with CDK could be copied for Ion? The default pulumi def is a pain to use.

CDK: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions-readme.html

Update: To make the request here a bit more clear, I specifically want to be able to create a step function using code instead of using the json string definition (and dont want to deploy with CDK). CDK step functions were super nice to use because of how easy it was to build without needing to reference the AWS console to try and use the visual builder or god forbid try to figure out the json format everytime you need to update or create a new step function.

dev2xl commented 1 month ago

Same here. It would be great to have this on Ion!

laeijebor commented 1 month ago

PR https://github.com/sst/ion/pull/184 from @ryankee looks to add it. Hopefully that will be merged soon!

jayair commented 1 month ago

Yeah I'll have Frank take a look when we get to this.

garretcharp commented 1 month ago

PR #184 from @ryankee looks to add it. Hopefully that will be merged soon!

hmm this seems to be the same def as pulumi has and not CDK. Having to use JSON to build is really annoying I would really want the way CDK does it

laeijebor commented 1 month ago

ion itself is a migration away from CDK to pulumi, which is what makes deployment to other platforms (e.g. Cloudflare Workers, Azure, etc.) possible.

The older CDK (not ion) version of SST supports step functions I believe - in case that helps with your current need


From: Garret Harp @.> Sent: Thursday, May 16, 2024 6:54:49 PM To: sst/ion @.> Cc: Leo Ijebor @.>; Comment @.> Subject: Re: [sst/ion] AWS Step Functions (Issue #376)

PR #184https://github.com/sst/ion/pull/184 from @ryankee https://github.com/ryankee looks to add it. Hopefully that will be merged soon!

hmm this seems to be the same def as pulumi has and not CDK. Having to use JSON to build is really annoying I would really want the way CDK does it

— Reply to this email directly, view it on GitHubhttps://github.com/sst/ion/issues/376#issuecomment-2115867667, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD25EZNHIZ3PIWZG7JGAWV3ZCTXGTAVCNFSM6AAAAABHH7CT6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJVHA3DONRWG4. You are receiving this because you commented.Message ID: @.***>

garretcharp commented 1 month ago

I am very well aware they are moving away from CDK (and I am very glad to move away from that mess) but that doesnt mean they couldn't potentially add a way to create step functions from code like the CDK allowed.

garretcharp commented 1 month ago

To make it more clear:

Instead of this:

new aws.sfn.StateMachine("sfn_state_machine", {
    name: "my-state-machine",
    roleArn: iamForSfn.arn,
    definition: `{
  "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda Function",
  "StartAt": "HelloWorld",
  "States": {
    "HelloWorld": {
      "Type": "Task",
      "Resource": "${lambda.arn}",
      "End": true
    }
  }
}
`,
})

I want this:

const lambdaTask = new tasks.LambdaInvoke(this, 'HelloWorld', {
  lambdaFunction: lambda
})

new aws.sfn.StateMachine(this, 'sfn_state_machine', {
  definitionBody: aws.sfn.DefinitionBody.fromChainable(definition)
})

Updated the main post to make it more clear also

DavidVaness commented 2 weeks ago

Echoing the need for this, currently blocking me to get going