Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
240 changes: 240 additions & 0 deletions cdk/lib/__snapshots__/registration.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
"GuAccessLoggingBucketParameter",
"GuApplicationTargetGroup",
"GuHttpsApplicationListener",
"GuUnhealthyInstancesAlarm",
"GuParameter",
"GuCname",
],
Expand Down Expand Up @@ -973,6 +974,125 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
},
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
},
"UnhealthyInstancesAlarmRegistration921377C3": {
"Properties": {
"ActionsEnabled": true,
"AlarmActions": [
{
"Fn::Join": [
"",
[
"arn:aws:sns:eu-west-1:",
{
"Ref": "AWS::AccountId",
},
":mobile-server-side",
],
],
},
],
"AlarmDescription": "registration's instances have failed healthchecks several times over the last 1 hour.
This typically results in the AutoScaling Group cycling instances and can lead to problems with deployment,
scaling or handling traffic spikes.

Check registration's application logs or ssh onto an unhealthy instance in order to debug these problems.",
"AlarmName": "Unhealthy instances for registration in CODE",
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"DatapointsToAlarm": 30,
"Dimensions": [
{
"Name": "LoadBalancer",
"Value": {
"Fn::Join": [
"",
[
{
"Fn::Select": [
1,
{
"Fn::Split": [
"/",
{
"Ref": "ListenerRegistration1652F707",
},
],
},
],
},
"/",
{
"Fn::Select": [
2,
{
"Fn::Split": [
"/",
{
"Ref": "ListenerRegistration1652F707",
},
],
},
],
},
"/",
{
"Fn::Select": [
3,
{
"Fn::Split": [
"/",
{
"Ref": "ListenerRegistration1652F707",
},
],
},
],
},
],
],
},
},
{
"Name": "TargetGroup",
"Value": {
"Fn::GetAtt": [
"TargetGroupRegistrationF8D1F3E9",
"TargetGroupFullName",
],
},
},
],
"EvaluationPeriods": 60,
"MetricName": "UnHealthyHostCount",
"Namespace": "AWS/ApplicationELB",
"Period": 60,
"Statistic": "Maximum",
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
},
{
"Key": "gu:repo",
"Value": "guardian/mobile-n10n",
},
{
"Key": "Stack",
"Value": "mobile-notifications",
},
{
"Key": "Stage",
"Value": "CODE",
},
],
"Threshold": 1,
"TreatMissingData": "notBreaching",
},
"Type": "AWS::CloudWatch::Alarm",
},
"mobilenotificationsCODEregistration504D3B6F": {
"DependsOn": [
"InstanceRoleRegistrationF217DF71",
Expand Down Expand Up @@ -1161,6 +1281,7 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
"GuAccessLoggingBucketParameter",
"GuApplicationTargetGroup",
"GuHttpsApplicationListener",
"GuUnhealthyInstancesAlarm",
"GuParameter",
"GuCname",
],
Expand Down Expand Up @@ -2108,6 +2229,125 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
},
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
},
"UnhealthyInstancesAlarmRegistration921377C3": {
"Properties": {
"ActionsEnabled": true,
"AlarmActions": [
{
"Fn::Join": [
"",
[
"arn:aws:sns:eu-west-1:",
{
"Ref": "AWS::AccountId",
},
":mobile-server-side",
],
],
},
],
"AlarmDescription": "registration's instances have failed healthchecks several times over the last 1 hour.
This typically results in the AutoScaling Group cycling instances and can lead to problems with deployment,
scaling or handling traffic spikes.

Check registration's application logs or ssh onto an unhealthy instance in order to debug these problems.",
"AlarmName": "Unhealthy instances for registration in PROD",
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"DatapointsToAlarm": 30,
"Dimensions": [
{
"Name": "LoadBalancer",
"Value": {
"Fn::Join": [
"",
[
{
"Fn::Select": [
1,
{
"Fn::Split": [
"/",
{
"Ref": "ListenerRegistration1652F707",
},
],
},
],
},
"/",
{
"Fn::Select": [
2,
{
"Fn::Split": [
"/",
{
"Ref": "ListenerRegistration1652F707",
},
],
},
],
},
"/",
{
"Fn::Select": [
3,
{
"Fn::Split": [
"/",
{
"Ref": "ListenerRegistration1652F707",
},
],
},
],
},
],
],
},
},
{
"Name": "TargetGroup",
"Value": {
"Fn::GetAtt": [
"TargetGroupRegistrationF8D1F3E9",
"TargetGroupFullName",
],
},
},
],
"EvaluationPeriods": 60,
"MetricName": "UnHealthyHostCount",
"Namespace": "AWS/ApplicationELB",
"Period": 60,
"Statistic": "Maximum",
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
},
{
"Key": "gu:repo",
"Value": "guardian/mobile-n10n",
},
{
"Key": "Stack",
"Value": "mobile-notifications",
},
{
"Key": "Stage",
"Value": "PROD",
},
],
"Threshold": 1,
"TreatMissingData": "notBreaching",
},
"Type": "AWS::CloudWatch::Alarm",
},
"mobilenotificationsPRODregistration32DCD2DE": {
"DependsOn": [
"InstanceRoleRegistrationF217DF71",
Expand Down
Loading