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 boto3 | |
def lambda_handler(event, context): | |
region_name = os.environ['AWS_REGION'] | |
if event: | |
for record in event['Records']: | |
body = record['body'] | |
# process message | |
return { |
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 os | |
import json | |
import boto3 | |
def lambda_handler(event, context): | |
region_name = os.environ['AWS_REGION'] | |
if event: | |
sqs = boto3.client('sqs', region_name=region_name) | |
queue_name = event['Records'][0]['eventSourceARN'].split(':')[-1] | |
queue_url = sqs.get_queue_url( |
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 os | |
import json | |
import boto3 | |
def lambda_handler(event, context): | |
region_name = os.environ['AWS_REGION'] | |
if event: | |
sqs = boto3.resource('sqs', region_name=region_name) | |
queue_name = event['Records'][0]['eventSourceARN'].split(':')[-1] | |
queue = sqs.get_queue_by_name(QueueName=queue_name) |
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 os | |
import json | |
import boto3 | |
def lambda_handler(event, context): | |
if event: | |
messages_to_reprocess = [] | |
batch_failure_response = {} | |
for record in event["Records"]: | |
try: |
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
#!/usr/bin/env python3 | |
# Demonstrates the use of Python to work with Cognito. | |
# Create a new a user, log in, check tokens and call an API. | |
# The purpose was to learn about Cognito. Security has been | |
# circumvented in the interest of keeping it simple. | |
# Notably, the authentication procedure uses the most insecure | |
# method. This code is not intended for use in production. | |
# | |
# https://www.neant.ro/aws/working-with-cognito-and-api-gateway-in-python.html |
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
# needs Python3, though easily adapted | |
from __future__ import unicode_literals | |
import boto3 | |
def main(): | |
session = boto3.session.Session(profile_name='aws_credentials_profile') | |
ec2 = session.resource('ec2') | |
# define instance parameters |
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
[ | |
{ | |
"id": 1, | |
"thumbnail": "aquaman", | |
"title": "Ciccio Pasticcio", | |
"description": "Once home to the most advanced civilization on Earth, the city of Atlantis is now an underwater kingdom ruled by the power-hungry King Orm. With a vast army at his disposal, Orm plans to conquer the remaining oceanic people -- and then the surface world. Standing in his way is Aquaman, Orm's half-human, half-Atlantean brother and true heir to the throne. With help from royal counselor Vulko, Aquaman must retrieve the legendary Trident of Atlan and embrace his destiny as protector of the deep.", | |
"trailerLink" : "https://www.youtube.com/watch?v=WDkg3h8PCVU", | |
"catagory": "DC", | |
"isFeaturedMovie": false |