Skip to content

Commit

Permalink
Remove redshift cols + readd lambda (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
codyborn authored Nov 27, 2024
1 parent fdc6335 commit fadda3e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 52 deletions.
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
19 changes: 0 additions & 19 deletions bin/stacks/analytics-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
],
});

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

0 comments on commit fadda3e

Please sign in to comment.