kickstarter / cfn-flow

A practical workflow for AWS CloudFormation
168 stars 15 forks source link

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

Open frewsxcv opened 7 years ago

frewsxcv commented 7 years ago

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/

jamesla commented 7 years ago

+1

s01ipsist commented 7 years ago

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 
et304383 commented 6 years ago

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.