wizeline / serverless-fullstack

Get started developing applications quickly with best practices using Serverless on AWS.
MIT License
32 stars 8 forks source link

Add CloudFormation Rollback Alarms/Triggers #11

Open brettstack opened 4 years ago

brettstack commented 4 years ago

CloudFormation should automatically roll back when the 5xx alarms fire.

brettstack commented 4 years ago

Documentation here https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RollbackConfiguration.html

We'll need to add this as a top-level entry to serverless.yaml and add the correct Alarm resources

RollbackConfiguration:
  MonitoringTimeInMinutes: 30
  RollbackTriggers:
  - Arn: !GetAtt MyAlarm.Arn
    Type: AWS::CloudWatch::Alarm
  - Arn: !GetAtt MySecondAlarm.Arn
    Type: AWS::CloudWatch::Alarm
brettstack commented 4 years ago

We have some basic alarms defined using a Serverless Framework Plugin https://github.com/wizeline/serverless-fullstack/blob/master/serverless.yaml#L118. You'll need to look at the generated CloudFormation template to discover the correct names of the AWS::CloudWatch::Alarm Resources