File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 5555 run : |
5656 make deploy
5757
58+ - name : Run AWS CLI command
59+ run : |
60+ make run
61+
5862 - name : Integration Tests
5963 run : |
60- npm test
64+ make test
6165
6266 - name : Show Logs
6367 if : always()
Original file line number Diff line number Diff line change @@ -42,6 +42,24 @@ test: ## Run the tests
4242 npm test
4343 @echo " Tests completed successfully."
4444
45+ run : # # Execute a SQL query through the Lambda function
46+ @echo " Executing SQL query through Lambda function..."
47+ @aws_version=$$(aws --version | grep -o "aws-cli/[0-9]*" | cut -d'/' -f2 ) ; \
48+ if [ " $$ aws_version" = " 2" ]; then \
49+ echo " Using AWS CLI version 2 command format..." ; \
50+ awslocal lambda invoke \
51+ --cli-binary-format raw-in-base64-out \
52+ --function-name my-lambda-rds-query-helper \
53+ --payload ' {"sqlQuery": "select Author from books", "secretName":"/rdsinitexample/rds/creds/mysql-01"}' output; \
54+ else \
55+ echo " Using AWS CLI version 1 command format..." ; \
56+ awslocal lambda invoke \
57+ --function-name my-lambda-rds-query-helper \
58+ --payload ' {"sqlQuery": "select Author from books", "secretName":"/rdsinitexample/rds/creds/mysql-01"}' output; \
59+ fi
60+ @echo " Query execution completed. Results:"
61+ @cat output
62+
4563start : # # Start LocalStack in detached mode
4664 @echo " Starting LocalStack..."
4765 @LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN ) localstack start -d
You can’t perform that action at this time.
0 commit comments