Last active
May 5, 2020 19:25
-
-
Save sk-t3ch/28b0e25d8a17b7a1e8079779ba763728 to your computer and use it in GitHub Desktop.
Hello World API CloudFormation - Python Lambda with CORS enabled
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
Lambda: | |
Type: AWS::Lambda::Function | |
Properties: | |
Code: | |
ZipFile: | | |
def handler(event, context): | |
response = { | |
'isBase64Encoded': False, | |
'statusCode': 200, | |
'body': 'HELLO WORLD!', | |
'headers': { | |
'access-control-allow-methods': 'GET', | |
'access-control-allow-origin': '*', | |
'access-control-allow-headers': 'Content-Type, Access-Control-Allow-Headers' | |
} | |
} | |
return response | |
Handler: lambda_function.handler | |
Role: !GetAtt LambdaRole.Arn | |
Runtime: python3.7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment