-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add policy and clarify permissions required for bulk export #1985
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
Open
katmayb
wants to merge
1
commit into
main
Choose a base branch
from
bulk-export-permissions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,15 +49,72 @@ Update the LangSmith URL appropriately for self-hosted installations or organiza | |
| For the EU region, use `eu.api.smith.langchain.com`. | ||
| </Note> | ||
|
|
||
| <Note> | ||
| **Permissions required** | ||
| #### Permissions required | ||
|
|
||
| Both the `backend` and `queue` services require write access to the destination bucket: | ||
|
|
||
| - The `backend` service attempts to write a test file to the destination bucket when the export destination is created. | ||
| It will delete the test file if it has permission to do so (delete access is optional). | ||
| - The `backend` service attempts to write a test file to the destination bucket when the export destination is created. It will delete the test file if it has permission to do so (delete access is optional). | ||
| - The `queue` service is responsible for bulk export execution and uploading the files to the bucket. | ||
| </Note> | ||
|
|
||
| **AWS S3 permissions** | ||
|
|
||
| The minimal AWS S3 permission policy requires the following permissions: | ||
|
|
||
| - `s3:PutObject` (required): Allows writing Parquet files to the bucket. | ||
| - `s3:DeleteObject` (optional): Used for cleanup of test files during destination creation. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would add that if this isn't present, the file is left under the |
||
| - `s3:GetObject` (optional but recommended): Used to verify file size after writing. | ||
|
|
||
| Minimal IAM policy example: | ||
|
|
||
| ```json | ||
| { | ||
| "Version": "2012-10-17", | ||
| "Statement": [ | ||
| { | ||
| "Effect": "Allow", | ||
| "Action": [ | ||
| "s3:PutObject" | ||
| ], | ||
| "Resource": [ | ||
| "arn:aws:s3:::YOUR_BUCKET_NAME/*" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| Recommended IAM policy example with additional permissions: | ||
|
|
||
| ```json | ||
| { | ||
| "Version": "2012-10-17", | ||
| "Statement": [ | ||
| { | ||
| "Effect": "Allow", | ||
| "Action": [ | ||
| "s3:PutObject", | ||
| "s3:DeleteObject", | ||
| "s3:GetObject" | ||
| ], | ||
| "Resource": [ | ||
| "arn:aws:s3:::YOUR_BUCKET_NAME/*" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| **Google Cloud Storage (GCS) permissions** | ||
|
|
||
| When using GCS with the S3-compatible XML API, the following IAM permissions are required: | ||
|
|
||
| - `storage.objects.create` (required): Allows writing files to the bucket. | ||
| - `storage.objects.delete` (optional): Used for test file cleanup during destination creation. | ||
| - `storage.objects.get` (optional but recommended): Used for file size verification after writing. | ||
|
|
||
| These permissions can be granted through the "Storage Object Admin" predefined role or a custom role. | ||
|
|
||
| #### Create a destination | ||
|
|
||
| The following example demonstrates how to create a destination using cURL. Replace the placeholder values with your actual configuration details. | ||
| Note that credentials will be stored securely in an encrypted form in our system. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"s3:AbortMultipartUpload",is also recommended to avoid dangling multipart uploads - the library we use under the hood uses multipart uploads