Add sessiontoken for aws s3 storage

Fixes #3961
 Update s3.md doc

Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
stonezdj 2023-07-18 10:11:43 +08:00
parent 003dd5aaa1
commit a380aa4584
2 changed files with 21 additions and 17 deletions

View file

@ -10,9 +10,10 @@ Amazon S3 or S3 compatible services for object storage.
## Parameters
| Parameter | Required | Description |
|:--------------|:---------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|:-----------------|:---------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `accesskey` | no | Your AWS Access Key. If you use [IAM roles](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html), omit to fetch temporary credentials from IAM. |
| `secretkey` | no | Your AWS Secret Key. If you use [IAM roles](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html), omit to fetch temporary credentials from IAM. |
| `sessiontoken` | no | Your AWS Session token. If you use [IAM roles](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html), omit to fetch temporary credentials from IAM. |
| `region` | yes | The AWS region in which your bucket exists. |
| `regionendpoint` | no | Endpoint for S3 compatible storage services (Minio, etc). |
| `forcepathstyle` | no | To enable path-style addressing when the value is set to `true`. The default is `true`. |

View file

@ -417,6 +417,9 @@ func FromParameters(parameters map[string]interface{}) (*Driver, error) {
}
sessionToken := ""
if sk, ok := parameters["sessiontoken"].(string); ok {
sessionToken = sk
}
accelerateBool := false
accelerate := parameters["accelerate"]