From 2acfe1aa0e0c6a9c316fbec508f43dcf9f292ce3 Mon Sep 17 00:00:00 2001 From: Eduardo Dos Santos Vilke Date: Thu, 5 Sep 2024 14:40:19 -0300 Subject: feat(localstack): add plugin (#12595) --- plugins/localstack/localstack.plugin.zsh | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugins/localstack/localstack.plugin.zsh (limited to 'plugins/localstack/localstack.plugin.zsh') diff --git a/plugins/localstack/localstack.plugin.zsh b/plugins/localstack/localstack.plugin.zsh new file mode 100644 index 000000000..080b14a54 --- /dev/null +++ b/plugins/localstack/localstack.plugin.zsh @@ -0,0 +1,37 @@ +# CLI support for LOCALSTACK interaction +# +# See README.md for details +lsk() { + case $1 in + sqs-send) + shift + sqs-send "$@" + ;; + *) + echo "Command not found: $1" + return 1 + ;; + esac +} + +# Send SQS function +# +# This function sends a given message in sqs to a given queue, when used Localstack +# +# Use: +# sqs-send +# +# Parameters +# A given queue +# A content of message em json archive +# +# Example +# sqs-send user user.json +sqs-send(){ + if [ -z "$1" ]; then + echo "Use: sqs-send " + return 1 + fi + + curl -X POST "http://localhost:4566/000000000000/$1" -d "Action=SendMessage" -d "MessageBody=$(cat $2)" +} \ No newline at end of file -- cgit v1.2.3-70-g09d2