Created
October 19, 2021 05:58
-
-
Save aidansteele/76b7660014b174f251989a83d9e27e36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Transform: AWS::Serverless-2016-10-31 | |
Resources: | |
Function: | |
Type: AWS::Serverless::Function | |
Properties: | |
Runtime: python3.9 | |
Handler: index.handler | |
InlineCode: | | |
import json | |
import base64 | |
def handler(event, context): | |
print(json.dumps(event)) | |
if event['isBase64Encoded']: | |
print(base64.b64decode(event['body']).decode('utf-8')) | |
else: | |
print(event['body']) | |
Events: | |
DemoApi: | |
Type: HttpApi | |
Outputs: | |
Function: | |
Value: !Ref Function | |
Url: | |
Value: !GetAtt ServerlessHttpApi.ApiEndpoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment