ACloudGuru / serverless-plugin-aws-alerts

A Serverless Framework plugin that creates CloudWatch alarms for functions.
MIT License
529 stars 150 forks source link

Use encryption as default for SNS #117

Open silverfisk opened 4 years ago

silverfisk commented 4 years ago

This is a Feature Proposal

Description

I want to suggest that all resources created is using default encryption. The SNS queue was created without encryption:

nameTemplate: $[functionName]-$[metricName]
topics:
  alarm: ${self:service}-${opt:stage}-alerts-alarm
definitions:
  iteratorAgeAlarm:
    namespace: AWS/Lambda
    metric: IteratorAge
    threshold: 60000 # 1 minute
    statistic: Maximum
    period: 60
    evaluationPeriods: 1
    comparisonOperator: GreaterThanThreshold
    treatMissingData: missing

Additional Data

Framework Core: 1.52.1 Plugin: 3.3.0 SDK: 2.3.0

pedrobento988 commented 3 years ago

I agree with OP. This would be a great feature and I would like to have it implemented.

Currently the workaround that I use is to append the KmsMasterKeyId on the resource created by the plugin serverless-plugin-aws-alerts, using the Serverless "resources". serverless.yml partial example:

provider:
  ...

custom:
  ...
  alerts:
    topics:
      ok:
        topic: sns-alerts-ok

      alarm:
        topic: sns-alerts-alarm

...

functions:
  ...

resources:
  - Resources:
      AwsAlertsOk: # Append the following properties to the resource created by the plugin serverless-plugin-aws-alerts
        Properties:
          KmsMasterKeyId: enter-your-cmk-id-here

      AwsAlertsAlarm: # Append the following properties to the resource created by the plugin serverless-plugin-aws-alerts
        Properties:
          KmsMasterKeyId: enter-your-cmk-id-here

I hope it helps.