cloudknot.aws.get_profile

cloudknot.aws.get_profile(fallback='from-env')[source]

Get the AWS profile to use

First, check the cloudknot config file for the profile option. If that fails, check for the AWS_PROFILE environment variable. If that fails, return ‘default’ if there is a default profile in AWS config or credentials files. If that fails, return the fallback value.

Parameters

fallback – The fallback value if get_profile cannot find an AWS profile. Default: ‘from-env’

Returns

profile_name (string) – An AWS profile listed in the aws config file or aws shared credentials file