@@ -91,18 +91,18 @@ FUNCTIONS=(
9191log " Creating IAM policies and roles for Lambda functions..."
9292for FUNCTION_INFO in " ${FUNCTIONS[@]} " ; do
9393 read FUNCTION_NAME POLICY_FILE ROLE_NAME <<< " $FUNCTION_INFO"
94-
94+
9595 log " Creating IAM policy for $FUNCTION_NAME ..."
9696 awslocal iam create-policy \
9797 --policy-name ${FUNCTION_NAME} Policy \
9898 --policy-document file://${POLICY_FILE} > /dev/null
99-
99+
100100 log " Creating IAM role $ROLE_NAME ..."
101101 ROLE_ARN=$( awslocal iam create-role \
102102 --role-name ${ROLE_NAME} \
103103 --assume-role-policy-document file://configurations/lambda_trust_policy.json \
104104 --query ' Role.Arn' --output text)
105-
105+
106106 log " Attaching policy to role $ROLE_NAME ..."
107107 awslocal iam attach-role-policy \
108108 --role-name ${ROLE_NAME} \
@@ -141,7 +141,7 @@ LAMBDAS=(
141141
142142for LAMBDA_INFO in " ${LAMBDAS[@]} " ; do
143143 read FUNCTION_NAME ZIP_FILE ROLE_NAME <<< " $LAMBDA_INFO"
144-
144+
145145 log " Creating Lambda function $FUNCTION_NAME ..."
146146 awslocal lambda create-function \
147147 --function-name ${FUNCTION_NAME} \
@@ -190,21 +190,21 @@ ENDPOINTS=(
190190
191191for ENDPOINT_INFO in " ${ENDPOINTS[@]} " ; do
192192 read PATH_PART HTTP_METHOD FUNCTION_NAME <<< " $ENDPOINT_INFO"
193-
193+
194194 log " Setting up API endpoint /$PATH_PART [$HTTP_METHOD ] -> $FUNCTION_NAME "
195-
195+
196196 RESOURCE_ID=$( awslocal apigateway create-resource \
197197 --rest-api-id $API_ID \
198198 --parent-id $PARENT_ID \
199199 --path-part $PATH_PART \
200200 --query ' id' --output text)
201-
201+
202202 awslocal apigateway put-method \
203203 --rest-api-id $API_ID \
204204 --resource-id $RESOURCE_ID \
205205 --http-method $HTTP_METHOD \
206206 --authorization-type " NONE" > /dev/null
207-
207+
208208 awslocal apigateway put-integration \
209209 --rest-api-id $API_ID \
210210 --resource-id $RESOURCE_ID \
@@ -220,7 +220,7 @@ log "Deploying API..."
220220awslocal apigateway create-deployment \
221221 --rest-api-id $API_ID \
222222 --stage-name test > /dev/null
223- API_ENDPOINT=" http://localhost:4566/_aws/execute-api/$API_ID /test/_user_request_ "
223+ API_ENDPOINT=" http://localhost:4566/_aws/execute-api/$API_ID /test"
224224log " API deployed. Endpoint: $API_ENDPOINT "
225225
226226# SQS DLQ -> EventBridge Pipes -> SNS
@@ -348,7 +348,7 @@ LAMBDA_PERMISSIONS=(
348348
349349for PERMISSION_INFO in " ${LAMBDA_PERMISSIONS[@]} " ; do
350350 read FUNCTION_NAME HTTP_METHOD PATH_PART <<< " $PERMISSION_INFO"
351-
351+
352352 log " Adding permission for $FUNCTION_NAME to be invoked by API Gateway..."
353353 awslocal lambda add-permission \
354354 --function-name ${FUNCTION_NAME} \
0 commit comments