Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zaireali649/f20cc813f70c9b8d706865c057fce814 to your computer and use it in GitHub Desktop.
Save zaireali649/f20cc813f70c9b8d706865c057fce814 to your computer and use it in GitHub Desktop.
Create a Sample Lambda Function
### Create Lambda Function
client_lambda = boto3.client('lambda')
f = open('lambda-handler.zip', 'rb')
lambda_handler_zip = f.read()
f.close()
response_create_function = client_lambda.create_function(
FunctionName='test_Lambda_Function_URLs_boto3',
Runtime= 'python3.9',
Role=role_arn,
Code=dict(ZipFile=lambda_handler_zip),
Handler='lambda_function.lambda_handler'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment