Yeah right here I'm learning to use Serverless Framework and AWS CDK with Golang.
make deploy-local
make deploy-local-cdk# get restapi_id
awslocal apigateway get-rest-apis --profile localstack
# get resources
awslocal apigateway get-resources --rest-api-id <restapi_id> --profile localstackcurl -X GET \
-H "Content-Type: application/json" \
http://localhost:4566/restapis/<restapi_id>/local/_user_request_/api/v1/rooms
curl -X GET \
-H "Content-Type: application/json" \
http://localhost:4566/restapis/<restapi_id>/local/_user_request_/api/v1/roomsawslocal lambda invoke --profile localstack \
--function-name pewh-local-restapi \
--payload '{"path": "/api/v1/rooms", "httpMethod": "GET", "queryStringParameters": {"key": "value"}}' \
/dev/stdout
awslocal lambda invoke --profile localstack \
--function-name pewh-local-restapi \
--payload '{"path": "/api/v1/rooms/another", "httpMethod": "GET", "queryStringParameters": {"key": "value"}}' \
/dev/stdoutaws sns publish --endpoint-url http://localhost:4566 --profile localstack \
--topic-arn arn:aws:sns:us-east-1:000000000000:booking-created-local \
--message '{"key": "value"}'
aws sns publish --endpoint-url http://localhost:4566 --profile localstack \
--topic-arn arn:aws:sns:us-east-1:000000000000:booking-paid-local \
--message '{"key": "value"}'aws sqs send-message --endpoint-url http://localhost:4566 --profile localstack \
--queue-url http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/booking-canceled-local \
--message-body '{"key": "value", "status": "canceled"}'
# using fifo
aws sqs send-message --endpoint-url http://localhost:4566 --profile localstack \
--queue-url http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/check-in-started-local.fifo \
--message-body '{"key": "value"}' \
--message-group-id "group-1"aws lambda invoke --endpoint-url http://localhost:4566 --profile localstack --function-name pewh-local-bookingCreated --payload fileb://input.json /dev/stdout
aws lambda invoke --endpoint-url http://localhost:4566 --profile localstack --function-name pewh-local-bookingPaid --payload fileb://input.json /dev/stdoutaws lambda invoke --endpoint-url http://localhost:4566 --profile localstack --function-name pewh-local-bookingCanceled --payload fileb://input.json /dev/stdout
aws lambda invoke --endpoint-url http://localhost:4566 --profile localstack --function-name pewh-local-checkInStarted --payload fileb://input.json /dev/stdout