integration/resources/templates/combination/function_with_implicit_http_api.yaml (20 lines of code) (raw):
Resources:
MyLambdaFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: python3.11
InlineCode: |
def handler(event, context):
return {'body': 'Hello World!', 'statusCode': 200}
MemorySize: 128
Events:
GetApi:
Type: HttpApi
Outputs:
ApiUrl:
Description: API endpoint URL for Prod environment
Value:
Fn::Sub: https://${ServerlessHttpApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/
Metadata:
SamTransformTest: true