Skip to content

Commit 2e781c6

Browse files
committed
fix: use payload file protocol accordingly Aws Cli version
1 parent 9378f57 commit 2e781c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sample-apps/blank-csharp/3-invoke.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22
set -eo pipefail
33
FUNCTION=$(aws cloudformation describe-stack-resource --stack-name blank-csharp --logical-resource-id function --query 'StackResourceDetail.PhysicalResourceId' --output text)
4-
4+
if [[ $(aws --version) =~ "aws-cli/2." ]]; then PAYLOAD_PROTOCOL="fileb"; else PAYLOAD_PROTOCOL="file"; fi;
55
while true; do
6-
aws lambda invoke --function-name $FUNCTION --payload file://event.json out.json
6+
aws lambda invoke --function-name $FUNCTION --payload $PAYLOAD_PROTOCOL://event.json out.json
77
cat out.json
88
echo ""
99
sleep 2

0 commit comments

Comments
 (0)