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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Middleware Proposal: S3 #594

Closed
willfarrell opened this issue Jan 3, 2021 · 9 comments 路 Fixed by #961
Closed

New Middleware Proposal: S3 #594

willfarrell opened this issue Jan 3, 2021 · 9 comments 路 Fixed by #961
Assignees

Comments

@willfarrell
Copy link
Member

willfarrell commented Jan 3, 2021

Proposal for a new S3 middleware that could pull string or json from a file in S3 and store to internal.

See ssm for what it could look like: https://github.com/middyjs/middy/tree/main/packages/ssm

Please 馃憤馃徎 this issue if it would have value to you. I'll build it if there > 10 馃憤馃徎

If you can comment with your use case below, that would be helpful.

@willfarrell willfarrell self-assigned this Jan 3, 2021
@willfarrell willfarrell changed the title New Middleware: S3 New Middleware Proposal: S3 Jan 3, 2021
@willfarrell
Copy link
Member Author

@iDVB I was thinking of your middleware could benefit from this. Allow it to be simpler.

@iDVB
Copy link

iDVB commented Jan 3, 2021

thanks @willfarrell this would be great. I think there would have to be some control on caching as well.

Right now middy-reroute caches in memory and on CloudFront responses. And the cache time is configurable.

I'd be interested in talking more or helping out with this.

@willfarrell
Copy link
Member Author

I was thinking it would look just like this, just with s3. https://github.com/middyjs/middy/tree/release/2.x/packages/ssm

@iDVB
Copy link

iDVB commented Jan 3, 2021

Yup, that looks about right. Just a thought. This would only work with one of my S3 calls for my default config file. However, there are other "conditional" calls for 404.html etc that would likely still benefit from being baked into my middleware.

@willfarrell
Copy link
Member Author

willfarrell commented Jan 3, 2021

How the aws middlewares are structured now support multiple requests based on a key mapping. There is no fetch only when needed. Let prefetch request everything you do need, resolve only what you need when you need it. There is an new getInternal util function that does all the magic in v2 :).

@willfarrell
Copy link
Member Author

Closing, been year without enough interest.

@iDVB
Copy link

iDVB commented Jan 7, 2022

Sorry @willfarrell, been super busy on a number of things. This still sounds interesting to me. Is this still something that applys?

@willfarrell
Copy link
Member Author

Re-opening based on a comment from the powertools team (#948 (comment)).

@willfarrell
Copy link
Member Author

I've created PR #961 for this. Please feel free to comment or contribute types.

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

Successfully merging a pull request may close this issue.

2 participants