Skip to content

Instantly share code, notes, and snippets.

# Query AWS Athena
def query_aws_athena(params):
# Creating the Client for Athena
client = boto3.client('athena', region_name=params['region'])
# This function executes the query and returns the query execution ID
response_query_execution_id = client.start_query_execution(
QueryString = params['query'],
QueryExecutionContext = {
'Database' : params['database']
def query_aws_cloudwatch(query, log_group, region):
# Get a client
client = boto3.client('logs', region_name=region)
# Launch a query
start_query_response = client.start_query(
logGroupName=log_group,
startTime=int((datetime.today() - timedelta(hours=5)).timestamp()),
endTime=int(datetime.now().timestamp()),
queryString=query,
@alfallouji
alfallouji / README.md
Last active April 26, 2021 02:10 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed