Skip to content

Instantly share code, notes, and snippets.

View taufiqibrahim's full-sized avatar

taufiqibrahim

View GitHub Profile
@taufiqibrahim
taufiqibrahim / serverless_kafka_lambda-2-requirements.txt
Last active December 2, 2020 17:03
serverless_kafka_lambda-2-requirements.txt
avro
confluent-kafka[avro,json]
pendulum
psycopg2-binary
pymysql
sqlalchemy
@taufiqibrahim
taufiqibrahim / data-pipeline-service-graph-using-aws-neptune--neptune-cfn.yaml
Last active March 12, 2021 08:27
Data Pipeline Service Graph Using AWS Neptune - Cloudformation Template
# /*
# * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# *
# * Permission is hereby granted, free of charge, to any person obtaining a copy of this
# * software and associated documentation files (the "Software"), to deal in the Software
# * without restriction, including without limitation the rights to use, copy, modify,
# * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# * permit persons to whom the Software is furnished to do so.
# *
# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
@taufiqibrahim
taufiqibrahim / data-pipeline-service-graph-using-aws-neptune--neptune.params.json
Created March 12, 2021 09:10
Data Pipeline Service Graph Using AWS Neptune - Cloudformation Parameters
[
{
"ParameterKey": "Env",
"ParameterValue": "test"
},
{
"ParameterKey": "AppName",
"ParameterValue": "neptune-data-pipeline-graph"
},
{
@taufiqibrahim
taufiqibrahim / data-pipeline-service-graph-using-aws-neptune--graphexp-Dockerfile
Created March 12, 2021 17:02
Data Pipeline Service Graph Using AWS Neptune - Graphexp Dockerfile
FROM nginx:stable
LABEL maintainer="[email protected]"
ENV http_proxy $http_proxy
ENV https_proxy $https_proxy
ENV no_proxy $no_proxy
ENV PATH /usr/local/bin:$PATH
ENV GRAPHEXP_SOURCE_URL $GRAPHEXP_SOURCE_URL
@taufiqibrahim
taufiqibrahim / data-pipeline-service-graph-using-aws-neptune--graphexp-docker-compose.yml
Created March 12, 2021 17:06
Data Pipeline Service Graph Using AWS Neptune - Graphexp Docker Compose
# https://github.com/bricaud/graphexp/archive/v0.8.0.zip
#
# Copyright IBM Corp All Rights Reserved
#
# SPDX-License-Identifier: Apache-2.0
#
version: "3"
services:
graphexp:
@taufiqibrahim
taufiqibrahim / data-pipeline-service-graph-using-aws-neptune--graphexp-scripts-graphioGremlin.js
Created March 12, 2021 18:18
Data Pipeline Service Graph Using AWS Neptune - Graphexp graphioGremlin.js
function send_to_server(gremlin_query,query_type,active_node,message, callback){
let server_address = $('#server_address').val();
let server_port = $('#server_port').val();
let COMMUNICATION_PROTOCOL = $('#server_protocol').val();
if (COMMUNICATION_PROTOCOL == 'REST'){
let server_url = "https://"+server_address+":"+server_port; // Changed from http to https
run_ajax_request(gremlin_query,server_url,query_type,active_node,message,callback);
}
else if (COMMUNICATION_PROTOCOL == 'websocket'){
{
"AWS_S3_DEPLOYMENT_BUCKET": "my-serverless-deployment",
"AWS_LAMBDA_EXECUTION_ROLE": "arn:aws:iam::ACCOUNT_ID:role/AWSLambdaMSKDemoWalkthroughRole",
"AWS_LAMBDA_EXECUTION_TIMEOUT": "300",
"AWS_LAMBDA_MSK_BATCH_SIZE": "1000",
"AWS_VPC_SECURITY_GROUP_ID_1": "sg-<AWSLambdaMSKDemoWalkthroughSG>",
"AWS_VPC_SUBNET_ID_1": "<SUBNET_ID_1>",
"AWS_VPC_SUBNET_ID_2": "<SUBNET_ID_2>",
"AWS_MSK_CLUSTER_1": "<AWS_MSK_CLUSTER_1_ARN>",
"AWS_MSK_BOOTSTRAP_SERVERS_1": "<AWS_MSK_BOOTSTRAP_SERVERS_1_URLS>",
key value description
AWS_S3_DEPLOYMENT_BUCKET my-serverless-deployment S3 bucket name
AWS_LAMBDA_EXECUTION_ROLE arn:aws:iam::<ACCOUNT_ID>:role/AWSLambdaMSKDemoWalkthroughRole AWSLambdaMSKDemoWalkthroughRole ARN
AWS_LAMBDA_EXECUTION_TIMEOUT 300 Lambda execution timeout
AWS_LAMBDA_MSK_BATCH_SIZE 1000 Execution batch size
AWS_VPC_SECURITY_GROUP_ID_1 sg-
$ serverless print --stage dev
service:
name: demo-walkthrough
frameworkVersion: '2'
provider:
stage: dev
region: ap-southeast-1
name: aws
runtime: python3.8
environment: