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