From 2f960a965123b7bb73bffd5a86c3c9c3a36a2847 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 7 Mar 2024 17:51:12 -0800 Subject: [PATCH] (feat) auto-scale --- deploy/just_ec2.yaml | 49 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/deploy/just_ec2.yaml b/deploy/just_ec2.yaml index 3097b6be0f0..97060b6c3a7 100644 --- a/deploy/just_ec2.yaml +++ b/deploy/just_ec2.yaml @@ -1,17 +1,44 @@ ---- Resources: LiteLLMServer: - Type: "AWS::EC2::Instance" + Type: AWS::EC2::Instance Properties: - AvailabilityZone: "us-east-1a" - ImageId: "ami-0f403e3180720dd7e" # Replace with your desired AMI ID - InstanceType: "t2.micro" + AvailabilityZone: us-east-1a + ImageId: ami-0f403e3180720dd7e + InstanceType: t2.micro + + LiteLLMServerAutoScalingGroup: + Type: AWS::AutoScaling::AutoScalingGroup + Properties: + AvailabilityZones: + - us-east-1a + LaunchConfigurationName: !Ref LiteLLMServerLaunchConfig + MinSize: 1 + MaxSize: 3 + DesiredCapacity: 1 + HealthCheckGracePeriod: 300 + + LiteLLMServerLaunchConfig: + Type: AWS::AutoScaling::LaunchConfiguration + Properties: + ImageId: ami-0f403e3180720dd7e # Replace with your desired AMI ID + InstanceType: t2.micro + + LiteLLMServerScalingPolicy: + Type: AWS::AutoScaling::ScalingPolicy + Properties: + AutoScalingGroupName: !Ref LiteLLMServerAutoScalingGroup + PolicyType: TargetTrackingScaling + TargetTrackingConfiguration: + PredefinedMetricSpecification: + PredefinedMetricType: ASGCPUUtilization + TargetValue: 60.0 + LiteLLMDB: - Type: "AWS::RDS::DBInstance" + Type: AWS::RDS::DBInstance Properties: AllocatedStorage: 5 - Engine: "postgres" - MasterUsername: "litellmAdmin" # Replace with your desired master username - MasterUserPassword: "litellmPassword" # Replace with your desired secure password - DBInstanceClass: "db.t3.micro" - AvailabilityZone: "us-east-1a" + Engine: postgres + MasterUsername: litellmAdmin + MasterUserPassword: litellmPassword + DBInstanceClass: db.t3.micro + AvailabilityZone: us-east-1a \ No newline at end of file