From fadda3ed55fd6db75de94556b9455b5da5ce840d Mon Sep 17 00:00:00 2001 From: Cody Born Date: Wed, 27 Nov 2024 05:18:21 -0500 Subject: [PATCH] Remove redshift cols + readd lambda (#388) --- bin/app.ts | 36 +++++++++++++++++------------------ bin/stacks/analytics-stack.ts | 19 ------------------ bin/stacks/api-stack.ts | 30 ++++++++++++++--------------- 3 files changed, 33 insertions(+), 52 deletions(-) diff --git a/bin/app.ts b/bin/app.ts index bcd8705..47779fa 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/analytics-stack.ts b/bin/stacks/analytics-stack.ts index f484188..7f6fc16 100644 --- a/bin/stacks/analytics-stack.ts +++ b/bin/stacks/analytics-stack.ts @@ -240,25 +240,6 @@ export class AnalyticsStack extends cdk.NestedStack { { name: 'routing', dataType: RS_DATA_TYPES.ROUTING }, { name: 'createdAt', dataType: RS_DATA_TYPES.TIMESTAMP }, { name: 'createdAtMs', dataType: RS_DATA_TYPES.TIMESTAMP_MS }, - { name: 'slippageTolerance', dataType: RS_DATA_TYPES.SLIPPAGE }, - { name: 'startTimeBufferSecs', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'stdAuctionPeriodSecs', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'deadlineBufferSecs', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'minimumOrderSizeUSD', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'minimumPriceImpactBps', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'minimumPriceImpactUSD', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'filterOpenOrdersOnTokenList', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'forceOpenOrders', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'priceImprovementBps', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'largeAuctionPeriodSecs', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'priceBufferBps_external\-api', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'priceBufferBps_external\-api:mobile', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'priceBufferBps_uniswap\-android', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'priceBufferBps_uniswap\-extension', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'priceBufferBps_uniswap\-ios', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'priceBufferBps_uniswap\-web', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'priceBufferBps_unknown', dataType: RS_DATA_TYPES.INTEGER }, - { name: 'mpsPerPriorityFeeWei', dataType: RS_DATA_TYPES.INTEGER }, ], }); diff --git a/bin/stacks/api-stack.ts b/bin/stacks/api-stack.ts index a595ddc..1067d35 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, + }); } /*