From fdc63353d7ec07ec96e902652215c5df2a970025 Mon Sep 17 00:00:00 2001 From: Cody Born Date: Wed, 27 Nov 2024 04:42:05 -0500 Subject: [PATCH] [TO-BE-REVERTED]: Temporarily remove lambda (#387) * Temporarily remove lambda * build: unused import error --------- Co-authored-by: Alan Wu --- bin/app.ts | 36 ++++++++++++++++++------------------ bin/stacks/api-stack.ts | 30 +++++++++++++++--------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/bin/app.ts b/bin/app.ts index 47779fa..bcd8705 100644 --- a/bin/app.ts +++ b/bin/app.ts @@ -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(); diff --git a/bin/stacks/api-stack.ts b/bin/stacks/api-stack.ts index 1067d35..a595ddc 100644 --- a/bin/stacks/api-stack.ts +++ b/bin/stacks/api-stack.ts @@ -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'; @@ -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, + // }); } /*