@@ -216,6 +216,126 @@ docker compose up -d
216216
217217<br >
218218
219+ ### AWS EC2
220+ 1 . Copy the AWS CloudFormation template from below:
221+ ``` yaml
222+ AWSTemplateFormatVersion : ' 2010-09-09'
223+ Parameters :
224+ VpcId :
225+ Type : AWS::EC2::VPC::Id
226+ Description : VPC where the EC2 instance will be launched
227+ SubnetId :
228+ Type : AWS::EC2::Subnet::Id
229+ Description : Subnet where the EC2 instance will be launched
230+ InstanceType :
231+ Type : String
232+ Default : t2.micro
233+ AllowedValues :
234+ - t2.micro
235+ - t2.small
236+ - t2.medium
237+ - t3.micro
238+ - t3.small
239+ Description : EC2 instance type
240+
241+ Resources :
242+ EC2Instance :
243+ Type : AWS::EC2::Instance
244+ Properties :
245+ ImageId : !FindInMap [RegionMap, !Ref "AWS::Region", AMI]
246+ InstanceType : !Ref InstanceType
247+ SecurityGroupIds :
248+ - !Ref InstanceSecurityGroup
249+ SubnetId : !Ref SubnetId
250+ UserData :
251+ Fn::Base64 : |
252+ # !/bin/bash
253+ sudo yum update -y
254+ sudo yum install -y amazon-linux-extras
255+ sudo amazon-linux-extras enable docker
256+ sudo yum install -y docker
257+ sudo systemctl start docker
258+ sudo systemctl enable docker
259+ sudo docker run -p 8787:8787 -d portkeyai/gateway:latest
260+ Tags :
261+ - Key : Name
262+ Value : PortkeyGateway
263+
264+ InstanceSecurityGroup :
265+ Type : AWS::EC2::SecurityGroup
266+ Properties :
267+ GroupDescription : Security group for Portkey Gateway
268+ VpcId : !Ref VpcId
269+ SecurityGroupIngress :
270+ - IpProtocol : tcp
271+ FromPort : 8787
272+ ToPort : 8787
273+ CidrIp : 0.0.0.0/0
274+ SecurityGroupEgress :
275+ - IpProtocol : -1
276+ FromPort : -1
277+ ToPort : -1
278+ CidrIp : 0.0.0.0/0
279+
280+ Mappings :
281+ RegionMap :
282+ Metadata :
283+ Name : amzn2-ami-hvm-2.0.20250220.0-x86_64-gp2
284+ Owner : amazon
285+ CreationDate : 2025-02-20T22:38:11.000Z
286+ eu-west-1 :
287+ AMI : ami-049b732d3f35a4f44
288+ ca-central-1 :
289+ AMI : ami-06816da431adb7634
290+ eu-west-2 :
291+ AMI : ami-0eebf19cec0b40d10
292+ us-east-2 :
293+ AMI : ami-0e7b3e7766d24a6ff
294+ eu-west-3 :
295+ AMI : ami-004f2229fb9afa698
296+ eu-north-1 :
297+ AMI : ami-08fbe5a8c8061068f
298+ us-west-1 :
299+ AMI : ami-01891d4f3898759b2
300+ ap-northeast-3 :
301+ AMI : ami-0316e0efae0ce53d2
302+ us-east-1 :
303+ AMI : ami-0ace34e9f53c91c5d
304+ ap-northeast-2 :
305+ AMI : ami-0891aeb92f786d7a2
306+ sa-east-1 :
307+ AMI : ami-081d377a25d396ece
308+ us-west-2 :
309+ AMI : ami-04c0ab8f1251f1600
310+ ap-northeast-1 :
311+ AMI : ami-00561c77487da40c1
312+ ap-south-1 :
313+ AMI : ami-0f4f6fd19fad11737
314+ ap-southeast-2 :
315+ AMI : ami-044b50caba366ec3a
316+ ap-southeast-1 :
317+ AMI : ami-0301dd2fb476c9850
318+ eu-central-1 :
319+ AMI : ami-014eb100f18a84d89
320+
321+
322+ Outputs :
323+ PortkeyGatewayURL :
324+ Description : URL to access Portkey Gateway
325+ Value : !Sub http://${EC2Instance.PublicDnsName}:8787
326+ ` ` `
327+
328+ 2. Create a new stack in the AWS CloudFormation console with the template above(you can upload in your S3 or directly upload the template).
329+
330+ 3. Fill the following parameters:
331+ - **VpcId**: The VPC ID of the VPC where the EC2 instance will be launched
332+ - **SubnetId**: The Subnet ID of the Subnet where the EC2 instance will be launched
333+ - **InstanceType**: The instance type of the EC2 instance
334+
335+ 4. Create the stack and wait for it to be created.
336+
337+ 5. Once the stack is created, you can access the Portkey Gateway URL from the Outputs section.
338+
219339### Replit
220340
221341[](https://replit.com/@portkey/AI-Gateway?v=1)
0 commit comments