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

introduce aws-sdk invocation workaround #5

Merged
merged 3 commits into from
Jan 20, 2022
Merged

Conversation

dominikschubert
Copy link
Member

Tried to keep it simple here by directly re-using the existing lambda executor for "aws-sdk" integrations (e.g. arn:aws:states:::aws-sdk:sns:createTopic)

A few tradeoffs I've encountered:

  • Errors aren't properly mapped right now because they're wrapped in an InvocationException by our lambda API. This should get fixed with the upcoming lambda fixes though.
  • Currently only supports aws-sdk invocations without specifying explicit integration pattern. (i.e. task resource ending in .sync or .waitForCallback) will break. The invocation itself is inherently synchronous. Support for these could be added fairly easily though.
  • There's now an additional small delay on the first invocation in a region because localstack will lazily create the utility lambda localstack-internal-awssdk upon the first invoke call that contains this function name.

Copy link
Member

@whummer whummer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes @dominikschubert ! 💯 Can we also add the source index.ts and a short script/README on how to generate the compiled index.js?

String filteredInput = this.getFilteredInput();
String effectiveInput = this.getEffectiveInput(this.taskState.getParameters());

// map aws-sdk tasks to lambda tasks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We could try adding an aspect around getEffectiveInput(..), then we could potentially get rid of the source patches entirely..? (would need to look into the other/existing patches as well, though - just food for thought, maybe in a future iteration..)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add the source index.ts and a short script/README on how to generate the compiled index.js?

It's basically just a file that is generated by the CDK by bundling with the aws-sdk lib. Maybe it makes more sense to just use the index.js directly and package the aws-sdk in a node_modules folder in a zip file.
Still not super happy about that since the only reason we're not having a single small .js file is a shortcoming in the local executor for node.js (which doesn't provide the aws-sdk lib atm).

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

Successfully merging this pull request may close these issues.

None yet

2 participants