caltrans-pt / lambda-deployment /template.yaml
mousom's picture
Upload folder using huggingface_hub
e6c137b verified
Raw History Blame Contribute Delete
1.64 kB
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: 'Caltrans Payment Tracking API - Lambda deployment'
Globals:
Function:
Timeout: 30
MemorySize: 512
Runtime: python3.10
Resources:
CaltransPaymentTrackingAPI:
Type: AWS::Serverless::Function
Properties:
FunctionName: caltrans-payment-tracking-api
CodeUri: .
Handler: lambda_function.lambda_handler
Runtime: python3.10
Timeout: 30
MemorySize: 512
Environment:
Variables:
PYTHONPATH: /var/task
Events:
HttpApiEvent:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
RestApiId: !Ref ApiGateway
RootHttpApiEvent:
Type: Api
Properties:
Path: /
Method: ANY
RestApiId: !Ref ApiGateway
ApiGateway:
Type: AWS::Serverless::Api
Properties:
Name: caltrans-payment-tracking-api
StageName: prod
Cors:
AllowMethods: "'GET,POST,OPTIONS'"
AllowHeaders: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
AllowOrigin: "'*'"
BinaryMediaTypes:
- "*/*"
Outputs:
ApiUrl:
Description: "API Gateway endpoint URL for the Caltrans Payment Tracking API"
Value: !Sub "https://${ApiGateway}.execute-api.${AWS::Region}.amazonaws.com/prod/"
Export:
Name: !Sub "${AWS::StackName}-ApiUrl"
FunctionArn:
Description: "Lambda Function ARN"
Value: !GetAtt CaltransPaymentTrackingAPI.Arn
Export:
Name: !Sub "${AWS::StackName}-FunctionArn"