From 51627543ab2b4ada08016edb52a13fbf7a8863e1 Mon Sep 17 00:00:00 2001 From: mattcasey Date: Sun, 8 Sep 2024 00:07:12 -0600 Subject: [PATCH] update health check port --- .cdk/StagingStack.ts | 14 +++++++++++--- .cdk/bin/app.ts | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.cdk/StagingStack.ts b/.cdk/StagingStack.ts index 3ab5e1cdb4..24989c39d3 100644 --- a/.cdk/StagingStack.ts +++ b/.cdk/StagingStack.ts @@ -6,14 +6,17 @@ import { Construct } from 'constructs'; const domain = 'charmverse.co'; -type CustomOptions = { healthCheck?: string; options?: elasticbeanstalk.CfnEnvironment.OptionSettingProperty[] }; +type CustomOptions = { + healthCheck?: { port: number; path: string }; + options?: elasticbeanstalk.CfnEnvironment.OptionSettingProperty[]; +}; export class StagingStack extends Stack { constructor( scope: Construct, appName: string, props: StackProps, - { healthCheck = '/api/health', options = [] }: CustomOptions = {} + { healthCheck = { path: '/api/health', port: 80 }, options = [] }: CustomOptions = {} ) { super(scope, appName, props); @@ -140,7 +143,12 @@ export class StagingStack extends Stack { // ALB health check namespace: 'aws:elasticbeanstalk:application', optionName: 'Application Healthcheck URL', - value: healthCheck + value: healthCheck.path + }, + { + namespace: 'aws:elasticbeanstalk:application', + optionName: 'Application Healthcheck Port', + value: healthCheck.port.toString() }, { namespace: 'aws:elasticbeanstalk:application:environment', diff --git a/.cdk/bin/app.ts b/.cdk/bin/app.ts index e56decc8d4..c9a09c74e8 100644 --- a/.cdk/bin/app.ts +++ b/.cdk/bin/app.ts @@ -39,7 +39,7 @@ else if (stackNameParam.startsWith('prd')) { } else if (stackNameParam.startsWith('stg-webapp')) { new WebappStagingStack(app, stackNameParam, deployProps); } else if (stackNameParam.startsWith('stg-ceramic')) { - new StagingStack(app, stackNameParam, deployProps, { healthCheck: '/graphql' }); + new StagingStack(app, stackNameParam, deployProps, { healthCheck: { path: '/graphql', port: 5001 } }); } else if (stackNameParam.startsWith('stg-')) { new StagingStack(app, stackNameParam, deployProps); } else {