aws-configuration-tools- Configuration types, parsers & renderers for AWS services

CopyrightCopyright © 2013-2015 PivotCloud, Inc.
MaintainerJon Sterling <>
Safe HaskellNone






Configuration Types

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.

pCredentialConfig Source


:: String


-> MParser CredentialConfig 

A command-line argument parser for CredentialConfig. The prefix argument will be prepended directly onto the argument names.

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:

  1. _credentialConfigKey, loads the explicitely specified credentials,
  2. _credentialConfigFile, loads credentials with the given key name from the given file,
  3. _credentialConfigEnvironment, loads credentials from the environment varialbes AWS_ACCESS_KEY_ID and AWS_ACCESS_KEY_SECRET), and
  4. _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.