forked from dxctechnology/dxcf-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Billing-BillingCustomSubscriptions.yaml
187 lines (187 loc) · 7.67 KB
/
Billing-BillingCustomSubscriptions.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
AWSTemplateFormatVersion: 2010-09-09
Description: Billing-BillingCustomSubscriptions Template.
This creates Custom Subscriptions to Billing SNS Topics.
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Stack Dependencies
Parameters:
- BillingTopicsStackName
- Label:
default: Subscription Configuration
Parameters:
- TopicTestEmailEndpoint
- UrgentTopicTestPhoneEndpoint
ParameterLabels:
BillingTopicsStackName:
default: Billing Topics Stack Name
TopicTestEmailEndpoint:
default: Topic Test Email Endpoint
UrgentTopicTestEmailEndpoint:
default: UrgentTopic Test Email Endpoint
UrgentTopicTestPhoneEndpoint:
default: UrgentTopic Test Phone Endpoint
Parameters:
BillingTopicsStackName:
Description: Name of the CloudFormation Stack containing Billing Topics
Type: String
MinLength: 2
MaxLength: 64
Default: BillingTopics
AllowedPattern: ^[A-Z][-a-zA-Z0-9]*$
ConstraintDescription: must begin with an upper case letter and contain alphanumeric characters and dashes.
TopicTestEmailEndpoint:
Description: Optional test email Endpoint for Topics. If specified, test Subscriptions will be created instead of normal Subscriptions. Use hyphen to skip
Type: String
Default: ''
AllowedPattern: (^$|^-$|[^\s@]+@[^\s@]+\.[^\s@]+$)
ConstraintDescription: must be a valid email address.
UrgentTopicTestEmailEndpoint:
Description: Optional test email Endpoint for Urgent Topics. If specified, test Subscriptions will be created instead of normal Subscriptions. Use hyphen to skip
Type: String
Default: ''
AllowedPattern: (^$|^-$|[^\s@]+@[^\s@]+\.[^\s@]+$)
ConstraintDescription: must be a valid email address.
UrgentTopicTestPhoneEndpoint:
Description: Optional test Phone Endpoint for Urgent Topics. If specified, test Subscriptions will be created instead of normal Subscriptions. Use hyphen to skip
Type: String
Default: ''
AllowedPattern: (^$|^-$|^\+\d{11,12}$)
ConstraintDescription: must be a valid phone number.
Rules:
ValidateRegion:
Assertions:
- Assert: !Equals [ !Ref 'AWS::Region', us-east-1 ]
AssertDescription: This Template can only be used in Region us-east-1.
Conditions:
ConfigureNormalTopicEmailSubscriptions: !Equals [ !Ref TopicTestEmailEndpoint, '' ]
ConfigureTestTopicEmailSubscriptions: !And [ !Not [ !Condition ConfigureNormalTopicEmailSubscriptions ],
!Not [ !Equals [ !Ref TopicTestEmailEndpoint, '-' ]]]
ConfigureNormalUrgentTopicEmailSubscriptions: !Equals [ !Ref UrgentTopicTestEmailEndpoint, '' ]
ConfigureTestUrgentTopicEmailSubscriptions: !And [ !Not [ !Condition ConfigureNormalUrgentTopicEmailSubscriptions ],
!Not [ !Equals [ !Ref UrgentTopicTestEmailEndpoint, '-' ]]]
ConfigureNormalUrgentTopicPhoneSubscriptions: !Equals [ !Ref UrgentTopicTestPhoneEndpoint, '' ]
ConfigureTestUrgentTopicPhoneSubscriptions: !And [ !Not [ !Condition ConfigureNormalUrgentTopicPhoneSubscriptions ],
!Not [ !Equals [ !Ref UrgentTopicTestPhoneEndpoint, '-' ]]]
Resources:
BillsTopicTestEmailSubscription:
Type: AWS::SNS::Subscription
Properties:
TopicArn: !ImportValue
Fn::Sub: ${BillingTopicsStackName}-BillsTopic
Protocol: email
Endpoint: !Ref TopicTestEmailEndpoint
Condition: ConfigureTestTopicEmailSubscriptions
BillsTopicMCrawfordEmailSubscription:
Type: AWS::SNS::Subscription
Properties:
TopicArn: !ImportValue
Fn::Sub: ${BillingTopicsStackName}-BillsTopic
Protocol: email
Endpoint: mcrawford@dxc.com
Condition: ConfigureNormalTopicEmailSubscriptions
# BillsTopicVMatukumalliEmailSubscription:
# Type: AWS::SNS::Subscription
# Properties:
# TopicArn: !ImportValue
# Fn::Sub: ${BillingTopicsStackName}-BillsTopic
# Protocol: email
# Endpoint: nageswara-rao.matukumalli@dxc.com
# Condition: ConfigureNormalTopicEmailSubscriptions
# BillsTopicSRamalingamEmailSubscription:
# Type: AWS::SNS::Subscription
# Properties:
# TopicArn: !ImportValue
# Fn::Sub: ${BillingTopicsStackName}-BillsTopic
# Protocol: email
# Endpoint: soundar.r@dxc.com
# Condition: ConfigureNormalTopicEmailSubscriptions
# BillsTopicRRoslonEmailSubscription:
# Type: AWS::SNS::Subscription
# Properties:
# TopicArn: !ImportValue
# Fn::Sub: ${BillingTopicsStackName}-BillsTopic
# Protocol: email
# Endpoint: robert.roslon@dxc.com
# Condition: ConfigureNormalTopicEmailSubscriptions
UrgentBillsTopicTestEmailSubscription:
Type: AWS::SNS::Subscription
Properties:
TopicArn: !ImportValue
Fn::Sub: ${BillingTopicsStackName}-UrgentBillsTopic
Protocol: email
Endpoint: !Ref UrgentTopicTestEmailEndpoint
Condition: ConfigureTestUrgentTopicEmailSubscriptions
UrgentBillsTopicMCrawfordEmailSubscription:
Type: AWS::SNS::Subscription
Properties:
TopicArn: !ImportValue
Fn::Sub: ${BillingTopicsStackName}-UrgentBillsTopic
Protocol: email
Endpoint: mcrawford@dxc.com
Condition: ConfigureNormalUrgentTopicEmailSubscriptions
# UrgentBillsTopicVMatukumalliEmailSubscription:
# Type: AWS::SNS::Subscription
# Properties:
# TopicArn: !ImportValue
# Fn::Sub: ${BillingTopicsStackName}-UrgentBillsTopic
# Protocol: email
# Endpoint: nageswara-rao.matukumalli@dxc.com
# Condition: ConfigureNormalUrgentTopicEmailSubscriptions
# UrgentBillsTopicSRamalingamEmailSubscription:
# Type: AWS::SNS::Subscription
# Properties:
# TopicArn: !ImportValue
# Fn::Sub: ${BillingTopicsStackName}-UrgentBillsTopic
# Protocol: email
# Endpoint: soundar.r@dxc.com
# Condition: ConfigureNormalUrgentTopicEmailSubscriptions
# UrgentBillsTopicRRoslonEmailSubscription:
# Type: AWS::SNS::Subscription
# Properties:
# TopicArn: !ImportValue
# Fn::Sub: ${BillingTopicsStackName}-UrgentBillsTopic
# Protocol: email
# Endpoint: robert.roslon@dxc.com
# Condition: ConfigureNormalUrgentTopicEmailSubscriptions
UrgentBillsTopicTestPhoneSubscription:
Type: AWS::SNS::Subscription
Properties:
TopicArn: !ImportValue
Fn::Sub: ${BillingTopicsStackName}-UrgentBillsTopic
Protocol: sms
Endpoint: !Ref UrgentTopicTestPhoneEndpoint
Condition: ConfigureTestUrgentTopicPhoneSubscriptions
UrgentBillsTopicMCrawfordPhoneSubscription:
Type: AWS::SNS::Subscription
Properties:
TopicArn: !ImportValue
Fn::Sub: ${BillingTopicsStackName}-UrgentBillsTopic
Protocol: sms
Endpoint: '+14156525483'
Condition: ConfigureNormalUrgentTopicPhoneSubscriptions
# UrgentBillsTopicVMatukumalliPhoneSubscription:
# Type: AWS::SNS::Subscription
# Properties:
# TopicArn: !ImportValue
# Fn::Sub: ${BillingTopicsStackName}-UrgentBillsTopic
# Protocol: sms
# Endpoint: '+17708276963'
# Condition: ConfigureNormalUrgentTopicPhoneSubscriptions
# UrgentBillsTopicSRamalingamPhoneSubscription:
# Type: AWS::SNS::Subscription
# Properties:
# TopicArn: !ImportValue
# Fn::Sub: ${BillingTopicsStackName}-UrgentBillsTopic
# Protocol: sms
# Endpoint: '+18478486382'
# Condition: ConfigureNormalUrgentTopicPhoneSubscriptions
# UrgentBillsTopicRRoslonPhoneSubscription:
# Type: AWS::SNS::Subscription
# Properties:
# TopicArn: !ImportValue
# Fn::Sub: ${BillingTopicsStackName}-UrgentBillsTopic
# Protocol: sms
# Endpoint: '+48507009018'
# Condition: ConfigureNormalUrgentTopicPhoneSubscriptions