Description Usage Arguments Format Details See Also Examples
R6 implementation of AWS Root credential searches and management
AWSRootCredentials$new(AWS_ACCESS_KEY_ID = NULL,
AWS_SECRET_ACCESS_KEY = NULL,
sourceFile = NULL,
profileName = "default",
.silent = T)
AWSRootCredentials$print()
1 |
AWS_ACCESS_KEY_ID |
Your AWS root account access id |
AWS_SECRET_ACCESS_KEY |
Your AWS root account secret key |
sourceFile |
Location of credentials file ex. ~/.aws/.credential |
profileName |
Name of the profile you wish to invoke 'defualt' is used unless otherwise explicitly declared |
An object of class R6ClassGenerator
of length 24.
On initialization if you pass an access and secret key, the search is skipped and the keys you passed are used. Print method, prints only *s to protect your keys.
You can use $ to force print of an attribute if you really want to have it hanging around on your screen.
If no arguments are provided, credential priority... not search order but what will be returned if found... is loosely based on typical SDK fashion:
Environment variables "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"
Credentials file
It is assumed your credentials file follows the guidelines at: https://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.htmlAWS CLI Configuration and Credential Files
If you have multiple profiles in the credentials file, a profile labeled "default" will be searched for UNLESS you explicitly declare the profile name to return.
Differences from SDK Implementations
If Credentials file pointed to explicitly, then this is the only location checked. This is a more intuative behavior; if I tell you where to look, don't give me results from some other location.
Instance MetaData is not searched; this is done with AWSTemporaryCredentials$new().
AWSRootCredentials are a simpler class of credentials (only access and secret keys are necessary. AWSTemporaryCredentials, which are Role based, are generated by STS. I opted to treat root and temporary credentials as distinct class references. This seems less confusing for an end-user then trying to track what will be returned by a single class when referencing the two different credential sources.
Other credential management functions: AWSTemporaryCredentials
,
RcurlAWS
,
credsFromInstanceMetadata
,
genCredentialFilePath
,
getCredentials
, getProfiles
,
getSTSCredentials
,
parseCredentialFile
,
stsGenContentString
,
tempCredentialHandler
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run: rootCreds <- AWSRootCredentials$new()
## Not run: rootCreds <- AWSRootCredentials$new(credentialPrefix = "/i/hide/my/files")
Provide filenames if not using 'config' & 'credentials'
## Not run: rootCreds <- AWSRootCredentials$new(
credentialPrefix = "/i/hide/my/files")
## End(Not run)
credentialFileName = 'myCreds',
configFileName = 'myConfig'
)
## Not run: rootCreds <- AWSRootCredentials$new(AWS_ACCESS_KEY_ID = "blahblah", AWS_SECRET_ACCESS_KEY = "blahblah")
## Not run: rootCreds
## Not run: rootCreds$AWS_ACCESS_KEY_ID
## Not run: rootCreds$AWS_SECRET_ACCESS_KEY
rootCreds$profileSettings
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.