@@ -225,7 +225,83 @@ resource "aws_cloudwatch_metric_alarm" "trusted_advisor_service_limits" {
225
225
# #
226
226
# #########################################################################
227
227
228
- # TODO implemenet subscription
228
+ resource "aws_sns_topic_subscription" "ami_update_notification_ecs_optimized" {
229
+ depends_on = [aws_sns_topic_subscription . marbot ]
230
+ count = (data. aws_region . current . name == " us-east-1" && var. ami_update_notification_ecs_optimized ) ? 1 : 0
231
+
232
+ topic_arn = " arn:aws:sns:us-east-1:177427601217:ecs-optimized-amazon-ami-update"
233
+ protocol = " https"
234
+ endpoint = " https://api.marbot.io/${ var . stage } /endpoint/${ var . endpoint_id } "
235
+ endpoint_auto_confirms = true
236
+ delivery_policy = << JSON
237
+ {
238
+ "healthyRetryPolicy": {
239
+ "minDelayTarget": 1,
240
+ "maxDelayTarget": 60,
241
+ "numRetries": 100,
242
+ "numNoDelayRetries": 0,
243
+ "backoffFunction": "exponential"
244
+ },
245
+ "throttlePolicy": {
246
+ "maxReceivesPerSecond": 1
247
+ }
248
+ }
249
+ JSON
250
+ }
251
+
252
+
253
+
254
+ resource "aws_sns_topic_subscription" "ami_update_notification_amazon_linux" {
255
+ depends_on = [aws_sns_topic_subscription . marbot ]
256
+ count = (data. aws_region . current . name == " us-east-1" && var. ami_update_notification_amazon_linux ) ? 1 : 0
257
+
258
+ topic_arn = " arn:aws:sns:us-east-1:137112412989:amazon-linux-ami-updates"
259
+ protocol = " https"
260
+ endpoint = " https://api.marbot.io/${ var . stage } /endpoint/${ var . endpoint_id } "
261
+ endpoint_auto_confirms = true
262
+ delivery_policy = << JSON
263
+ {
264
+ "healthyRetryPolicy": {
265
+ "minDelayTarget": 1,
266
+ "maxDelayTarget": 60,
267
+ "numRetries": 100,
268
+ "numNoDelayRetries": 0,
269
+ "backoffFunction": "exponential"
270
+ },
271
+ "throttlePolicy": {
272
+ "maxReceivesPerSecond": 1
273
+ }
274
+ }
275
+ JSON
276
+ }
277
+
278
+
279
+
280
+ resource "aws_sns_topic_subscription" "ami_update_notification_amazon_linux2" {
281
+ depends_on = [aws_sns_topic_subscription . marbot ]
282
+ count = (data. aws_region . current . name == " us-east-1" && var. ami_update_notification_amazon_linux2 ) ? 1 : 0
283
+
284
+ topic_arn = " arn:aws:sns:us-east-1:137112412989:amazon-linux-2-ami-updates"
285
+ protocol = " https"
286
+ endpoint = " https://api.marbot.io/${ var . stage } /endpoint/${ var . endpoint_id } "
287
+ endpoint_auto_confirms = true
288
+ delivery_policy = << JSON
289
+ {
290
+ "healthyRetryPolicy": {
291
+ "minDelayTarget": 1,
292
+ "maxDelayTarget": 60,
293
+ "numRetries": 100,
294
+ "numNoDelayRetries": 0,
295
+ "backoffFunction": "exponential"
296
+ },
297
+ "throttlePolicy": {
298
+ "maxReceivesPerSecond": 1
299
+ }
300
+ }
301
+ JSON
302
+ }
303
+
304
+
229
305
230
306
# #########################################################################
231
307
# #
0 commit comments