Amazon SNS を CLI からいじるときにたまに使うスクリプトをメモっておきます
あるトピックにサブスクリプションを大量登録
$ for i in $(seq 1 100);
do aws sns subscribe --topic-arn [トピックARN] --protocol Email --notification-endpoint "[メアド]+i@example.com";
done;
あるトピックのサブスクリプションをリストアップ
$ aws sns list-subscriptions | jq -r '.Subscriptions[] | select(.TopicArn | test("[トピックARN]")) | .SubscriptionArn'
トピックのサブスクリプションにフィルタポリシーを設定
$ for arn in $(aws sns list-subscriptions | jq -r '.Subscriptions[] | select(.TopicArn | test("[トピック名]")) | .SubscriptionArn'); do
aws sns set-subscription-attributes --subscription-arn "$arn" --attribute-name FilterPolicy --attribute-value "{\"arn\":[\"$arn\"]}";
done;
Pinned Articles
About
ウェブ界隈でエンジニアとして労働活動に励んでいる @gomi_ningen 個人のブログです
Tags
LLM
promptfoo
GenAI
JavaScript
PowerShell
kibana
fluentd
elasticsearch
nginx
村川梨衣
五十嵐裕美
イベント
logrotate
IoT
Java
Scala
iputils
C言語
ICMP
WUG
mastodon
Swift
AWS
Clock
Windows
アーキテクチャ
PoEAA
iOS
DeviceFarm
プログラミング言語
OS
Lambda
StepFunctions
Serverless
terraform
ポエム
RHEL
ネットワーク
GraphQL
CloudWatch
Linux
Coreutils
telnet
network
nc
LinuxKernel
fpinscala
ELB
IAM
AppSync