kickstarter/cfn-flow

Add support for --profile flag for specifying AWS credentials profile

Opened this issue · 3 comments

Instead of relying on environment variables or the "default" profile for AWS credentials, it'd be great if one could specify --profile for cfn-flow networking fetching commands (deploy, list, etc.) that specified which AWS credentials profile to use.

This matches the CLI interface that the official AWS CLI tool provides:

http://docs.aws.amazon.com/cli/latest/reference/

+1

It would be good to document in the README but this is already supported through env vars.

AWS_PROFILE=test cfn-flow list

From http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html

Setting the AWS_PROFILE environment variable affects credential loading for all officially supported AWS SDKs and Tools 

This is a rabbit hole. The environment variables are the preferred way to configure any of the AWS SDKs.

Imagine you use the Python SDK for your Flask app. Would you ask Flask to support a --profile parameter?

I know that's an extreme case because Flask isn't designed as a wrapper to the SDK, but the argument remains the same. Tools like this any various other tools designed to make our lives easier are just custom logic wrapping one of the various AWS SDKs. The SDKs support certain methods for configuration and the least invasive method is the environment variables.