get_credentials: Get AWS credentials

Description Usage Arguments Examples

View source: R/get_credentials.R

Description

Get AWS credentials from the first available source (passed arguments, environment variables, specified file, default file, ec2 metadata iam role)

Usage

1
get_credentials(key = NULL, secret = NULL, token = NULL, ...)

Arguments

key

A character string specifying an AWS Access Key ID (optional)

secret

A character string specifying an AWS Secret Access Key (optional)

token

A character string specifying an AWS Session Token (optional)

...

Additional arguments passed to credentials_resolver

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
# build a credentials object
get_credentials(key = "AWS access key id", secret = "AWS secret access key")

# fetch credentials from specified credentials file
get_credentials(filename = "credentials-file", profile = "default")

# fetch credentials from environment variables, or default credentials file,
# or IAM role from EC2 metadata, respectively
get_credentials()

# As above, but skip environment variables and fetch credentials for
# specified profile name
get_credentials(profile = "default")

## End(Not run)

moj-analytical-services/s3tools documentation built on Sept. 13, 2021, 5:31 a.m.