forked from dxctechnology/dxcf-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommon-Topics.yaml
103 lines (103 loc) · 2.87 KB
/
Common-Topics.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
AWSTemplateFormatVersion: 2010-09-09
Description: Common-Topics Template.
This creates SNS Topics. These Topics are used for System Operation and should be in each Region used.
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Topic Configuration
Parameters:
- TopicPrefix
ParameterLabels:
TopicPrefix:
default: Topic Prefix
Parameters:
TopicPrefix:
Description: Optional Prefix for Topic Display Name
Type: String
Default: ''
AllowedPattern: (^$|^[A-Z][A-Z0-9]{1,4}$)
ConstraintDescription: must begin with an upper-case letter and consist of 1 to 4 additional upper-case letters or digits, if specified.
Conditions:
ConfigureTopicPrefix: !Not [ !Equals [ !Ref TopicPrefix, '' ]]
Resources:
EventsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: Events
DisplayName: !If
- ConfigureTopicPrefix
- !Sub ${TopicPrefix} Events
- Events
UrgentEventsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: UrgentEvents
DisplayName: !If
- ConfigureTopicPrefix
- !Sub ${TopicPrefix} Events
- Events
AlarmsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: Alarms
DisplayName: !If
- ConfigureTopicPrefix
- !Sub ${TopicPrefix} Alarms
- Alarms
UrgentAlarmsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: UrgentAlarms
DisplayName: !If
- ConfigureTopicPrefix
- !Sub ${TopicPrefix} Alarms
- Alarms
CloudTrailTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: CloudTrail
DisplayName: !If
- ConfigureTopicPrefix
- !Sub ${TopicPrefix} CloudTrail
- CloudTrail
CloudTrailTopicPolicy:
Type: AWS::SNS::TopicPolicy
Properties:
Topics:
- !Ref CloudTrailTopic
PolicyDocument:
Version: 2008-10-17
Statement:
- Sid: AllowCloudTrailPublish
Effect: Allow
Principal:
Service: cloudtrail.amazonaws.com
Action: SNS:Publish
Resource: '*'
Outputs:
EventsTopic:
Description: The Events Topic ARN
Value: !Ref EventsTopic
Export:
Name: !Sub ${AWS::StackName}-EventsTopic
UrgentEventsTopic:
Description: The UrgentEvents Topic ARN
Value: !Ref UrgentEventsTopic
Export:
Name: !Sub ${AWS::StackName}-UrgentEventsTopic
AlarmsTopic:
Description: The Alarms Topic ARN
Value: !Ref AlarmsTopic
Export:
Name: !Sub ${AWS::StackName}-AlarmsTopic
UrgentAlarmsTopic:
Description: The UrgentAlarms Topic ARN
Value: !Ref UrgentAlarmsTopic
Export:
Name: !Sub ${AWS::StackName}-UrgentAlarmsTopic
CloudTrailTopic:
Description: The CloudTrail Topic ARN
Value: !Ref CloudTrailTopic
Export:
Name: !Sub ${AWS::StackName}-CloudTrailTopic