■ はじめに
CloudFormation で SNS を作るところをメモ。
目次
【1】API 1)AWS::SNS::Topic 2)AWS::SNS::Subscription 【2】サンプル 例1:Hello world
【1】API
1)AWS::SNS::Topic
* SNSのTopic作成
https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html
2)AWS::SNS::Subscription
* SNSのSubscription作成
【2】サンプル
例1:Hello world
AWSTemplateFormatVersion: "2010-09-09" Description: "Create SNS Topic" Parameters: SnsTopicName: Description: SNS Topic Name Type: String Default: "demo-sns-topic" SnsEmailAddress: Description: Email address for SNS Type: String Default: "your-email@xxxx.com" Resources: # SNS Topic SnsTopic: Type: "AWS::SNS::Topic" Properties: TopicName: !Ref SnsTopicName DisplayName: !Sub SnsTopicName-${SnsTopicName} Tags: - Key: "Name" Value: !Ref SnsTopicName # Subscription Subscription: Type: "AWS::SNS::Subscription" Properties: TopicArn: !Ref SnsTopic Endpoint: !Ref SnsEmailAddress Protocol: "email" # Outputs Outputs: SnsTopicOutput: Value: !Ref SnsTopic Export: Name: demo-sns-topic-arn
参考文献
https://dev.classmethod.jp/articles/cloudformation-foreach-sns-email/
関連記事
CloudFormation ~ 基礎知識編 ~
https://dk521123.hatenablog.com/entry/2024/02/10/231900
CloudFormation ~ 入門編 ~
https://dk521123.hatenablog.com/entry/2021/10/26/224812
CloudFormation ~ 基本編 ~
https://dk521123.hatenablog.com/entry/2021/12/01/170326
CloudFormation ~ 開発環境 ~
https://dk521123.hatenablog.com/entry/2022/05/22/000000
CloudFormation ~ 組み込み関数 ~
https://dk521123.hatenablog.com/entry/2021/12/04/202519
CloudFormation ~ 条件分岐 ~
https://dk521123.hatenablog.com/entry/2022/07/02/214543
CloudFormation ~ Parameters ~
https://dk521123.hatenablog.com/entry/2024/02/29/220042
CloudFormation ~ 疑似パラメータ ~
https://dk521123.hatenablog.com/entry/2021/12/05/134313
CloudFormation ~ DeletionPolicy 属性 ~
https://dk521123.hatenablog.com/entry/2021/12/27/211328
CloudFormation ~ 認証情報の扱い ~
https://dk521123.hatenablog.com/entry/2021/12/28/224501
CloudFormation ~ S3 ~
https://dk521123.hatenablog.com/entry/2022/05/25/220037
CloudFormation ~ KMS ~
https://dk521123.hatenablog.com/entry/2022/05/26/112627
CloudFormation ~ IAM ~
https://dk521123.hatenablog.com/entry/2022/05/27/100820
CloudFormation ~ EC2 ~
https://dk521123.hatenablog.com/entry/2024/02/11/010935