cfn-flow icon indicating copy to clipboard operation
cfn-flow copied to clipboard

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

Open frewsxcv opened this issue 7 years ago • 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/

frewsxcv avatar Feb 27 '17 18:02 frewsxcv

+1

jamesla avatar Apr 27 '17 23:04 jamesla

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 

s01ipsist avatar May 01 '17 06:05 s01ipsist

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.

et304383 avatar Feb 07 '18 13:02 et304383