Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Step Functions #376

Open
garretcharp opened this issue May 5, 2024 · 7 comments
Open

AWS Step Functions #376

garretcharp opened this issue May 5, 2024 · 7 comments
Assignees

Comments

@garretcharp
Copy link
Contributor

garretcharp commented May 5, 2024

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
Copy link

dev2xl commented May 9, 2024

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

@laeijebor
Copy link

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

@jayair
Copy link
Contributor

jayair commented May 14, 2024

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

@garretcharp
Copy link
Contributor Author

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
Copy link

laeijebor commented May 16, 2024 via email

@garretcharp
Copy link
Contributor Author

garretcharp commented May 17, 2024

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
Copy link
Contributor Author

garretcharp commented May 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants