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
fluentd
kibana
elasticsearch
nginx
村川梨衣
五十嵐裕美
イベント
logrotate
IoT
Scala
Java
ICMP
iputils
C言語
WUG
mastodon
Swift
AWS
Windows
Clock
PoEAA
アーキテクチャ
iOS
DeviceFarm
プログラミング言語
OS
StepFunctions
Lambda
Serverless
terraform
ポエム
RHEL
ネットワーク
GraphQL
CloudWatch
Linux
Coreutils
nc
network
telnet
LinuxKernel
fpinscala
ELB
IAM
AppSync