Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TO-BE-REVERTED]: Temporarily remove lambda #387

Merged
merged 2 commits into from
Nov 27, 2024
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
36 changes: 18 additions & 18 deletions bin/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,26 @@ export class APIPipeline extends Stack {

this.addIntegTests(code, betaUsEast2Stage, betaUsEast2AppStage, STAGE.BETA);

// Prod us-east-2
const prodUsEast2Stage = new APIStage(this, 'prod-us-east-2', {
env: { account: '830217277613', region: 'us-east-2' },
provisionedConcurrency: 70,
internalApiKey: internalApiKey.secretValue.toString(),
chatbotSNSArn: 'arn:aws:sns:us-east-2:644039819003:SlackChatbotTopic',
envVars: {
RFQ_WEBHOOK_CONFIG: rfqWebhookConfig.secretValue.toString(),
ORDER_SERVICE_URL: urlSecrets.secretValueFromJson('GOUDA_SERVICE_PROD').toString(),
FILL_LOG_SENDER_ACCOUNT: '316116520258',
ORDER_LOG_SENDER_ACCOUNT: '316116520258',
URA_ACCOUNT: '652077092967',
BOT_ACCOUNT: '456809954954',
},
stage: STAGE.PROD,
});
// // Prod us-east-2
// const prodUsEast2Stage = new APIStage(this, 'prod-us-east-2', {
// env: { account: '830217277613', region: 'us-east-2' },
// provisionedConcurrency: 70,
// internalApiKey: internalApiKey.secretValue.toString(),
// chatbotSNSArn: 'arn:aws:sns:us-east-2:644039819003:SlackChatbotTopic',
// envVars: {
// RFQ_WEBHOOK_CONFIG: rfqWebhookConfig.secretValue.toString(),
// ORDER_SERVICE_URL: urlSecrets.secretValueFromJson('GOUDA_SERVICE_PROD').toString(),
// FILL_LOG_SENDER_ACCOUNT: '316116520258',
// ORDER_LOG_SENDER_ACCOUNT: '316116520258',
// URA_ACCOUNT: '652077092967',
// BOT_ACCOUNT: '456809954954',
// },
// stage: STAGE.PROD,
// });

const prodUsEast2AppStage = pipeline.addStage(prodUsEast2Stage);
// const prodUsEast2AppStage = pipeline.addStage(prodUsEast2Stage);

this.addIntegTests(code, prodUsEast2Stage, prodUsEast2AppStage, STAGE.PROD);
// this.addIntegTests(code, prodUsEast2Stage, prodUsEast2AppStage, STAGE.PROD);

pipeline.buildPipeline();

Expand Down
30 changes: 15 additions & 15 deletions bin/stacks/api-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as cdk from 'aws-cdk-lib';
import { CfnOutput, Duration } from 'aws-cdk-lib';
import * as aws_apigateway from 'aws-cdk-lib/aws-apigateway';
import { MethodLoggingLevel } from 'aws-cdk-lib/aws-apigateway';
import * as aws_asg from 'aws-cdk-lib/aws-applicationautoscaling';
//import * as aws_asg from 'aws-cdk-lib/aws-applicationautoscaling';
import * as aws_cloudwatch from 'aws-cdk-lib/aws-cloudwatch';
import * as aws_dynamo from 'aws-cdk-lib/aws-dynamodb';
import { CfnEIP, NatProvider, Vpc } from 'aws-cdk-lib/aws-ec2';
Expand Down Expand Up @@ -331,20 +331,20 @@ export class APIStack extends cdk.Stack {
});

if (provisionedConcurrency > 0) {
const quoteTarget = new aws_asg.ScalableTarget(this, 'QuoteProvConcASG', {
serviceNamespace: aws_asg.ServiceNamespace.LAMBDA,
maxCapacity: provisionedConcurrency * 10,
minCapacity: provisionedConcurrency,
resourceId: `function:${quoteLambdaAlias.lambda.functionName}:${quoteLambdaAlias.aliasName}`,
scalableDimension: 'lambda:function:ProvisionedConcurrency',
});

quoteTarget.node.addDependency(quoteLambdaAlias);

quoteTarget.scaleToTrackMetric('QuoteProvConcTracking', {
targetValue: 0.7,
predefinedMetric: aws_asg.PredefinedMetric.LAMBDA_PROVISIONED_CONCURRENCY_UTILIZATION,
});
// const quoteTarget = new aws_asg.ScalableTarget(this, 'QuoteProvConcASG', {
// serviceNamespace: aws_asg.ServiceNamespace.LAMBDA,
// maxCapacity: provisionedConcurrency * 10,
// minCapacity: provisionedConcurrency,
// resourceId: `function:${quoteLambdaAlias.lambda.functionName}:${quoteLambdaAlias.aliasName}`,
// scalableDimension: 'lambda:function:ProvisionedConcurrency',
// });

// quoteTarget.node.addDependency(quoteLambdaAlias);

// quoteTarget.scaleToTrackMetric('QuoteProvConcTracking', {
// targetValue: 0.7,
// predefinedMetric: aws_asg.PredefinedMetric.LAMBDA_PROVISIONED_CONCURRENCY_UTILIZATION,
// });
}

/*
Expand Down