Copyright | Copyright © 2013-2015 PivotCloud, Inc. |
---|---|
License | Apache-2.0 |
Maintainer | Jon Sterling <jsterling@alephcloud.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
- data CredentialConfigKey = CredentialConfigKey {}
- credentialConfigKeyId :: Lens' CredentialConfigKey ByteString
- credentialConfigKeySecret :: Lens' CredentialConfigKey ByteString
- validateCredentialConfigKey :: ConfigValidation CredentialConfigKey λ
- data CredentialConfigFile = CredentialConfigFile {}
- credentialConfigFileName :: Lens' CredentialConfigFile FilePath
- credentialConfigKeyName :: Lens' CredentialConfigFile Text
- validateCredentialConfigFile :: ConfigValidation CredentialConfigFile λ
- data CredentialConfig = CredentialConfig {}
- credentialConfigKey :: Lens' CredentialConfig (Maybe CredentialConfigKey)
- credentialConfigFile :: Lens' CredentialConfig (Maybe CredentialConfigFile)
- credentialConfigEnvironment :: Lens' CredentialConfig Bool
- credentialConfigInstanceMetadata :: Lens' CredentialConfig Bool
- defaultCredentialConfig :: CredentialConfig
- pCredentialConfig :: String -> MParser CredentialConfig
- pCredentialConfig_ :: MParser CredentialConfig
- validateCredentialConfig :: ConfigValidation CredentialConfig λ
- credentialsFromConfig :: (MonadError LoadCredentialsException m, MonadIO m) => CredentialConfig -> m Credentials
- data LoadCredentialsException
Configuration Types
data CredentialConfigFile Source
CredentialConfigFile | |
|
data CredentialConfig Source
When parsed from configuration files or the command line the settings take the following precedence:
Explicit credential configuration gets precedence over credential file configuration which has precedence over loading the credentials from the environment over loading the credentials from the instance meta data.
Any setting on the command line always has precedence over any setting in a configuration file.
If the configured file does not exist an parse error is triggered. Set this
value of _credentialConfigFile
to Nothing
if you don't want to suppress
this error.
:: String | prefix |
-> MParser CredentialConfig |
A command-line argument parser for CredentialConfig
. The prefix
argument will be prepended directly onto the argument names.
pCredentialConfig_ :: MParser CredentialConfig Source
This is pCredentialConfig
with an empty prefix.
Load Credentials
credentialsFromConfig :: (MonadError LoadCredentialsException m, MonadIO m) => CredentialConfig -> m Credentials Source
Load Credentials according to the credential configuration
Credentials are loaded with a precedence according to the order of
the record fields of CredentialConfig
:
_credentialConfigKey
, loads the explicitely specified credentials,_credentialConfigFile
, loads credentials with the given key name from the given file,_credentialConfigEnvironment
, loads credentials from the environment varialbesAWS_ACCESS_KEY_ID
andAWS_ACCESS_KEY_SECRET
), and_credentialConfigInstanceMetadata
, load the credentials from the EC2 instance metadata.
It is an error if a particular method is specified in the configuration but loading the credentials with that methods fails.