Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions aws_lambda/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ def pip_install_to_target(path):
pip.main(['install', r, '-t', path, '--ignore-installed'])


def get_role_name(account_id):
"""Shortcut to insert the `account_id` into the iam string."""
return "arn:aws:iam::{0}:role/lambda_basic_execution".format(account_id)
def get_role_name(account_id, role):
"""Shortcut to insert the `account_id` and `role` into the iam string."""
return "arn:aws:iam::{0}:role/{1}".format(account_id, role)


def get_account_id(aws_access_key_id, aws_secret_access_key):
Expand Down Expand Up @@ -234,7 +234,7 @@ def create_function(cfg, path_to_zip_file):
aws_secret_access_key = cfg.get('aws_secret_access_key')

account_id = get_account_id(aws_access_key_id, aws_secret_access_key)
role = get_role_name(account_id)
role = get_role_name(account_id, cfg.get('role', 'lambda_basic_execution'))

client = get_client('lambda', aws_access_key_id, aws_secret_access_key,
cfg.get('region'))
Expand Down
1 change: 1 addition & 0 deletions aws_lambda/project_template/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ region: us-east-1

function_name: my_lambda_function
handler: service.handler
# role: lambda_basic_execution
description: My first lambda function

# if access key and secret are left blank, boto will use the credentials
Expand Down