forked from phoenix/litellm-mirror
Make Function URL public.
This commit is contained in:
parent
60ca43b6d9
commit
ab09ad9a74
1 changed files with 14 additions and 24 deletions
|
@ -10,36 +10,27 @@ Globals:
|
||||||
Function:
|
Function:
|
||||||
Timeout: 600
|
Timeout: 600
|
||||||
MemorySize: 128
|
MemorySize: 128
|
||||||
|
Environment:
|
||||||
|
Variables:
|
||||||
|
WORKER_CONFIG: !Ref WorkerConfigParameter
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
AliasParameter:
|
AliasParameter:
|
||||||
Type: String
|
Type: String
|
||||||
Default: live
|
Default: live
|
||||||
|
WorkerConfigParameter:
|
||||||
|
Type: String
|
||||||
|
Description: Sample environment variable
|
||||||
|
Default: '{"model": null, "alias": null, "api_base": null, "api_version": "2023-07-01-preview", "debug": false, "temperature": null, "max_tokens": null, "request_timeout": 600, "max_budget": null, "telemetry": true, "drop_params": false, "add_function_to_prompt": false, "headers": null, "save": false, "config": null, "use_queue": false}'
|
||||||
|
|
||||||
Resources:
|
Resources:
|
||||||
LambdaExecutionRole:
|
MyUrlFunctionPermissions:
|
||||||
Type: AWS::IAM::Role
|
Type: AWS::Lambda::Permission
|
||||||
Properties:
|
Properties:
|
||||||
AssumeRolePolicyDocument:
|
FunctionName: !Ref URL
|
||||||
Version: '2012-10-17'
|
Action: lambda:InvokeFunctionUrl
|
||||||
Statement:
|
Principal: "*"
|
||||||
- Effect: Allow
|
FunctionUrlAuthType: NONE
|
||||||
Principal:
|
|
||||||
Service:
|
|
||||||
- lambda.amazonaws.com
|
|
||||||
- edgelambda.amazonaws.com
|
|
||||||
Action: sts:AssumeRole
|
|
||||||
Policies:
|
|
||||||
- PolicyName: LambdaExecutionPolicy
|
|
||||||
PolicyDocument:
|
|
||||||
Version: '2012-10-17'
|
|
||||||
Statement:
|
|
||||||
- Effect: Allow
|
|
||||||
Action:
|
|
||||||
- logs:CreateLogGroup
|
|
||||||
- logs:CreateLogStream
|
|
||||||
- logs:PutLogEvents
|
|
||||||
Resource: 'arn:aws:logs:*:*:*'
|
|
||||||
|
|
||||||
Function:
|
Function:
|
||||||
Type: AWS::Serverless::Function
|
Type: AWS::Serverless::Function
|
||||||
|
@ -49,7 +40,6 @@ Resources:
|
||||||
Handler: proxy/lambda.handler
|
Handler: proxy/lambda.handler
|
||||||
Runtime: python3.11
|
Runtime: python3.11
|
||||||
AutoPublishAlias: !Ref AliasParameter
|
AutoPublishAlias: !Ref AliasParameter
|
||||||
Role: !GetAtt LambdaExecutionRole.Arn
|
|
||||||
Architectures:
|
Architectures:
|
||||||
- x86_64
|
- x86_64
|
||||||
DeploymentPreference:
|
DeploymentPreference:
|
||||||
|
@ -81,7 +71,7 @@ Resources:
|
||||||
Type: AWS::Lambda::Url
|
Type: AWS::Lambda::Url
|
||||||
DependsOn: FunctionAliaslive
|
DependsOn: FunctionAliaslive
|
||||||
Properties:
|
Properties:
|
||||||
AuthType: AWS_IAM
|
AuthType: NONE
|
||||||
Qualifier: live
|
Qualifier: live
|
||||||
TargetFunctionArn: !GetAtt Function.Arn
|
TargetFunctionArn: !GetAtt Function.Arn
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue