Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

Add support for --profile command-line argument#93

Merged
javamonkey79 merged 2 commits into
nficano:masterfrom
jmehnle:profile_option
Feb 15, 2018
Merged

Add support for --profile command-line argument#93
javamonkey79 merged 2 commits into
nficano:masterfrom
jmehnle:profile_option

Conversation

@jmehnle

@jmehnle jmehnle commented Feb 2, 2018

Copy link
Copy Markdown
Contributor

This allows to choose from what AWS profile to choose credentials from ~/.aws/credentials.

@ricoveri

ricoveri commented Feb 7, 2018

Copy link
Copy Markdown

+1 on this.

Currently, my workaround is to set AWS_PROFILE environment variable since boto/boto3 takes those anyway. This would be a nice to have instead of hardcoding AWS credentials. :) 👍

This allows to choose from what AWS profile to choose credentials from `~/.aws/credentials`.
Comment thread aws_lambda/aws_lambda.py

def read_cfg(path_to_config_file, profile_name):
cfg = read(path_to_config_file, loader=yaml.load)
if profile_name is not None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of:
if profile_name is not None:

Couldn't you just do:
if profile_name:

Comment thread aws_lambda/aws_lambda.py
return boto3.client(
client,
boto3.setup_default_session(
profile_name=profile_name,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a profile name is set, should secret\access keys still be set?

@javamonkey79 javamonkey79 merged commit 92a8913 into nficano:master Feb 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants