Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Added HealthCheck (#715)

Michał Rutkaf1cc2d67aa78
diff --git a/.ci_cd/aws/cloudformation-create-ec2.yml b/.ci_cd/aws/cloudformation-create-ec2.yml
index 307bbe535..9f3756ef3 100644
--- a/.ci_cd/aws/cloudformation-create-ec2.yml
+++ b/.ci_cd/aws/cloudformation-create-ec2.yml
@@ -706,4 +706,36 @@ Resources:
- Name: InstanceId
Value: !Ref EC2Instance
+ HealthCheckAlarm:
+ Type: AWS::CloudWatch::Alarm
+ Properties:
+ Namespace: AWS/Route53
+ MetricName: HealthCheckStatus
+ Statistic: Sum
+ Period: 60
+ EvaluationPeriods: 15
+ ComparisonOperator: LessThanThreshold
+ Threshold: 1
+ AlarmActions:
+ - !Ref SnsTopic
+ OKActions:
+ - !Ref SnsTopic
+ Dimensions:
+ - Name: HealthCheckId
+ Value: !Ref HealthCheck
+
+ HealthCheck:
+ Type: AWS::Route53::HealthCheck
+ DependsOn: EC2Instance
+ Properties:
+ HealthCheckConfig:
+ Port: 443
+ Type: HTTPS
+ ResourcePath: '/api/master/info'
+ FullyQualifiedDomainName: !Sub ${Host}
+ RequestInterval: 30
+ FailureThreshold: 10
+ HealthCheckTags:
+ - Key: Name
+ Value: !Sub ${Host}