Skip to content

Commit cdaee33

Browse files
[Add] - sqs function to push helloworld msg
1 parent ef1cff4 commit cdaee33

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

services/sqs.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,24 @@ function aws_sqs_purge() { # Be careful when using it, it will delete all the me
6666
function aws_sqs_purge_with_hint() {
6767
aws_sqs_purge $(peco_create_menu 'peco_aws_sqs_list')
6868
}
69+
70+
function aws_sqs_push_message() {
71+
local aws_sqs_queue_url=$1
72+
local aws_sqs_message_body=$2
73+
74+
# Check input invalid
75+
if [[ -z "$aws_sqs_queue_url" || -z "$aws_sqs_message_body" ]]; then return; fi
76+
77+
aws_run_commandline "\
78+
aws sqs send-message \
79+
--queue-url '${aws_sqs_queue_url}' \
80+
--message-body '${aws_sqs_message_body}'
81+
"
82+
}
83+
84+
function aws_sqs_push_message_hello_world_with_hint() {
85+
local aws_sqs_queue_url=$(peco_create_menu 'peco_aws_sqs_list')
86+
local aws_sqs_message_body="hello world!"
87+
88+
aws_sqs_push_message "${aws_sqs_queue_url}" "${aws_sqs_message_body}"
89+
}

0 commit comments

Comments
 (0)