Skip to content

Commit

Permalink
Fixed timing issue when creating IAM role for Lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
benrady committed Feb 29, 2016
1 parent 31829e6 commit 704e644
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sspa
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,12 @@ function create_lambda_service() {
local service_dir=${1%/}
local function_name=$(basename $service_dir)
create_iam_role lambda_exec "file://conf/iam/policies/lambda_trust.json"
local role_arn=$(support/jsed.py conf/iam/roles/learnjs_lambda_exec/info.json 'Role.Arn')
echo -n "Waiting for IAM Role to become available..."
local role_arn=$(support/jsed.py conf/iam/roles/${app_name}_lambda_exec/info.json 'Role.Arn')
while ! aws iam get-role --role-name ${app_name}_lambda_exec &> /dev/null; do
echo -n .
done
echo "...done!"
if [[ ! -e ${service_dir}/info.json ]]; then
aws --profile $profile lambda create-function \
--function-name ${function_name} \
Expand Down

0 comments on commit 704e644

Please sign in to comment.