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

S3 direct upload from EKS #2414

Open
kizmanj opened this issue Jan 30, 2024 · 1 comment
Open

S3 direct upload from EKS #2414

kizmanj opened this issue Jan 30, 2024 · 1 comment
Labels
type: enhancement New feature or request

Comments

@kizmanj
Copy link

kizmanj commented Jan 30, 2024

Summary

When running in a container from EKS and using service accounts, AWS services are not accessed with a static key/secret pair, but with temporary credentials received from STS. (keyId, secret, sessionToken)

https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html
https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role-with-web-identity.html

Describe the solution you'd like

The following files will need to be updated to add x-amz-security-token to the policy document and the upload's form data:
src/Http/ViewComposers/MediasUploaderConfig.php
frontend/js/components/media-library/Uploader.vue

Additional context

Working on a branch with the changes

@ifox
Copy link
Member

ifox commented Feb 8, 2024

Hi @kizmanj, we're aware of this use case. For example, since this PR has been merged, it has been possible to use IAM roles on EC2 instances instead of access key pairs. It implies that you use the local endpoint type of the media library and specify a remote disk under twill.media_library.disk. That way the Twill uploader doesn't attempt to direct upload to S3, it uploads to your application first, which can be authorized to communicate with S3 to actually store the file. Maybe you've tried that and it didn't work?

Happy to review a PR improving compatibility for sure!

@ifox ifox added the type: enhancement New feature or request label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants