This file contains hidden or 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 get_fields_in_json(self, json_schema): | |
''' | |
Description: | |
This function takes in the schema in json format and returns the metadata of the schema | |
:param json_schema: [type : str] a string containing path to raw data | |
:return fields: [type : dict] contains metadata of the schema | |
''' | |
a = json_schema.json() | |
schema_dict = json.loads(a) |
This file contains hidden or 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
class AutoFlatten: | |
def __init__(self, json_schema): | |
self.fields_in_json = self.get_fields_in_json(json_schema) | |
self.all_fields = {} | |
self.cols_to_explode = set() | |
self.structure = {} | |
self.order = [] | |
self.bottom_to_top = {} | |
self.rest = set() |
This file contains hidden or 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 | |
class AutoFlatten: | |
def __init__(self, json_schema): | |
self.fields_in_json = self.get_fields_in_json(json_schema) | |
self.all_fields = {} | |
self.cols_to_explode = set() | |
self.structure = {} | |
self.order = [] | |
self.bottom_to_top = {} |
This file contains hidden or 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
--- | |
Version: '2008-10-17' | |
Id: arn:aws:sqs:us-east-1:000000000000:PageVisitQueue/SQSDefaultPolicy | |
Statement: | |
- Sid: AllowedSQSPermissions | |
Effect: Allow | |
Principal: | |
AWS: arn:aws:iam::111111111111:role/crossaccount_sqs_lambda_role | |
Action: | |
- SQS:ReceiveMessage |
This file contains hidden or 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 | |
import traceback | |
import json | |
import os | |
import uuid | |
kinesis_client = boto3.client('kinesis') | |
config_file_path = 'sqs_to_kinesis_mapping.json' | |
dlq_stream_name = 'DLQStream' |
This file contains hidden or 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
{ | |
"arn:aws:sqs:us-east-1:000000000000:PageVisitEventQueue": "PageVisitEventStream", | |
"arn:aws:sqs:us-east-1:000000000000:ClickedEventQueue": "ClickedEventStream" | |
} |
This file contains hidden or 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
--- | |
Version: '2012-10-17' | |
Statement: | |
- Sid: VisualEditor0 | |
Effect: Allow | |
Action: | |
- ec2:DescribeSecurityGroups | |
- ec2:DescribeSubnets | |
- ec2:DescribeVpcs | |
- ec2:DescribeNetworkInterfaces |
NewerOlder