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
def hello_world(): | |
print("Hello World.") | |
def hello_world_return(): | |
return("Hello World.") | |
if __name__ == '__main__': | |
hello_world() |
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
print("Hello World") |
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
import json | |
import os | |
import zipfile | |
import boto3 | |
s3 = boto3.client('s3') | |
aws_lambda = boto3.client('lambda') | |
s3_bucket_name = 'zali-catch-all' | |
library = 'pandas' |
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
### Create Lambda Function URL | |
client_lambda = boto3.client('lambda') | |
response_create_function_url_config = client_lambda.create_function_url_config( | |
FunctionName='test_Lambda_Function_URLs_boto3', | |
AuthType='NONE' | |
) | |
function_URL = response_create_function_url_config['FunctionUrl'] |
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
### 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', |
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
### Create Trust Policy for IAM Role | |
import json | |
trust_policy = json.dumps({ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { |
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
### Create Hello Lambda .py ### | |
lambda_code = ''' | |
import json | |
def lambda_handler(event, context): | |
# TODO implement | |
return { | |
'statusCode': 200, | |
'body': json.dumps('Hello from Lambda!') |
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
######## Create a Sample Lambda Function URL and the necessary dependencies ######## | |
import boto3 |
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
import boto3 | |
# replace the keys below | |
dynamodb = boto3.client( | |
'dynamodb', | |
aws_access_key_id='*****', | |
aws_secret_access_key='*****', | |
) |
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
#%% | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import random | |
import plotly.graph_objects as go | |
from plotly.subplots import make_subplots | |
#%% |
NewerOlder