AWS::FMS::NotificationChannel
指定 AWS Firewall Manager 用于记录 SNS 日志的 IAM 角色和 Amazon Simple Notification Service (SNS) 主题。
语法
要在 AWS CloudFormation 模板中声明此实体,请使用以下语法:
JSON
{ "Type" : "AWS::FMS::NotificationChannel", "Properties" : { "SnsRoleName" :
String
, "SnsTopicArn" :String
} }
YAML
Type: AWS::FMS::NotificationChannel Properties: SnsRoleName:
String
SnsTopicArn:String
属性
SnsRoleName
-
允许 Amazon SNS 记录 AWS Firewall Manager 活动的 IAM 角色的 Amazon 资源名称 (ARN)。
必需:是
类型:字符串
Update requires: No interruption
SnsTopicArn
-
从 AWS Firewall Manager 收集通知的 SNS 主题的 Amazon 资源名称 (ARN)。
必需:是
类型:字符串
Update requires: No interruption
返回值
Ref
此资源的 Ref
返回 SnsTopicArn
。这是唯一标识 Amazon Simple Notification Service (Amazon SNS) 主题的 Amazon 资源名称 (ARN)。例如:arn:aws:sns:us-west-2:111122223333:MyTopic
。有关 SNS 的更多信息,请参阅 Amazon Simple Notification Service (SNS) 资源类型参考。
在将此资源的逻辑 ID 传递给内部 Ref
函数时,Ref
返回资源的物理 ID,例如 1234a1a-a1b1-12a1-abcd-a123b123456。
For more information about using the Ref
function, see Ref.
示例
创建 Firewall Manager 通知通道
下面显示了 Firewall Manager 的 SNS 通知通道示例。
YAML
NotificationChannel: Type: AWS::FMS::NotificationChannel Properties: SnsRoleName: !Sub arn:aws:iam::${AWS::AccountId}:role/aws-service-role/fms.amazonaws.com/AWSServiceRoleForFMS SnsTopicArn: !Ref SnsTopic
JSON
"NotificationChannel": { "Type": "AWS::FMS::NotificationChannel", "Properties": { "SnsRoleName": { "Fn::Sub": "arn:aws:iam::${AWS::AccountId}:role/aws-service-role/fms.amazonaws.com/AWSServiceRoleForFMS" }, "SnsTopicArn": { "Ref": "SnsTopic" } } }