Skip to content

Commit

Permalink
update health check port
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcasey committed Sep 8, 2024
1 parent 0a2b779 commit 5162754
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions .cdk/StagingStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion .cdk/bin/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5162754

Please sign in to comment.