forked from TrueCloudLab/rclone
s3: set session token when using STS
This commit is contained in:
parent
d6eb625815
commit
2f0551074c
2 changed files with 5 additions and 2 deletions
|
@ -240,12 +240,14 @@ There are two ways to supply `rclone` with a set of AWS
|
||||||
credentials. In order of precedence:
|
credentials. In order of precedence:
|
||||||
|
|
||||||
- Directly in the rclone configuration file (as configured by `rclone config`)
|
- Directly in the rclone configuration file (as configured by `rclone config`)
|
||||||
- set `access_key_id` and `secret_access_key`
|
- set `access_key_id` and `secret_access_key`. `session_token` can be
|
||||||
|
optionally set when using AWS STS.
|
||||||
- Runtime configuration:
|
- Runtime configuration:
|
||||||
- set `env_auth` to `true` in the config file
|
- set `env_auth` to `true` in the config file
|
||||||
- Exporting the following environment variables before running `rclone`
|
- Exporting the following environment variables before running `rclone`
|
||||||
- Access Key ID: `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY`
|
- Access Key ID: `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY`
|
||||||
- Secret Access Key: `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY`
|
- Secret Access Key: `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY`
|
||||||
|
- Session Token: `AWS_SESSION_TOKEN`
|
||||||
- Running `rclone` on an EC2 instance with an IAM role
|
- Running `rclone` on an EC2 instance with an IAM role
|
||||||
|
|
||||||
If none of these option actually end up providing `rclone` with AWS
|
If none of these option actually end up providing `rclone` with AWS
|
||||||
|
|
1
s3/s3.go
1
s3/s3.go
|
@ -313,6 +313,7 @@ func s3Connection(name string) (*s3.S3, *session.Session, error) {
|
||||||
v := credentials.Value{
|
v := credentials.Value{
|
||||||
AccessKeyID: fs.ConfigFileGet(name, "access_key_id"),
|
AccessKeyID: fs.ConfigFileGet(name, "access_key_id"),
|
||||||
SecretAccessKey: fs.ConfigFileGet(name, "secret_access_key"),
|
SecretAccessKey: fs.ConfigFileGet(name, "secret_access_key"),
|
||||||
|
SessionToken: fs.ConfigFileGet(name, "session_token"),
|
||||||
}
|
}
|
||||||
|
|
||||||
// first provider to supply a credential set "wins"
|
// first provider to supply a credential set "wins"
|
||||||
|
|
Loading…
Reference in a new issue