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- |
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: '3' | |
services: | |
ftpd_server: | |
image: stilliard/pure-ftpd | |
container_name: pure-ftpd | |
ports: | |
- "21:21" | |
- "30000-30009:30000-30009" | |
volumes: # remember to replace /folder_on_disk/ with the path to where you want to store the files on the host machine | |
- "/ftpdata/ftpuser/buckets:/home/ftpuser/" |
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
# Create directory for ftp | |
export NONROOTUSER=$USER | |
sudo mkdir -p /ftpdata | |
sudo chown -R $NONROOTUSER:$NONROOTUSER /ftpdata | |
mkdir -p /ftpdata/ftpuser/buckets/$BUCKET_NAME | |
mkdir -p /ftpdata/ftpuser/passwd |
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
# install docker | |
sudo apt-get update | |
sudo apt-get install \ | |
ca-certificates \ | |
curl \ | |
gnupg \ | |
lsb-release -y | |
# Add Docker’s official GPG key | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg |
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
kafkacat -C -b <AWS_MSK_BOOTSTRAP_SERVERS_URLS> -t demo-walkthrough-p01OrdersEnrichCustomerLocation -o -20 -e | jq -c | |
% Reached end of topic demo-walkthrough-p01OrdersEnrichCustomerLocation [0] at offset 10: exiting | |
{"OrderNo":"SO-001","OrderDate":"1/6/19","Region":"East","Customer":"Jones","Item":"Pencil","Units":95,"Unit Cost":1.99,"Total":189.05,"address":"1745 T Street Southeast","longitude":"-76.979235","latitude":"38.867033"} | |
{"OrderNo":"SO-002","OrderDate":"1/23/19","Region":"Central","Customer":"Kivell","Item":"Binder","Units":50,"Unit Cost":19.99,"Total":999.5,"address":"6007 Applegate Lane","longitude":"-85.649851","latitude":"38.134301"} | |
{"OrderNo":"SO-003","OrderDate":"2/9/19","Region":"Central","Customer":"Jardine","Item":"Pencil","Units":36,"Unit Cost":4.99,"Total":179.64,"address":"560 Penstock Drive","longitude":"-121.077583","latitude":"39.213076"} | |
{"OrderNo":"SO-004","OrderDate":"2/26/19","Region":"Central","Customer":"Gill","Item":"Pen","Units":27,"Unit Cost":19.99,"Total":539.73,"address": |
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
kafkacat -C -b <AWS_MSK_BOOTSTRAP_SERVERS_URLS> -t demo-walkthrough-orders -o -20 -e | jq -c | |
% Reached end of topic demo-walkthrough-orders [0] at offset 10: exiting | |
{"OrderNo":"SO-001","OrderDate":"1/6/19","Region":"East","Customer":"Jones","Item":"Pencil","Units":95,"Unit Cost":1.99,"Total":189.05} | |
{"OrderNo":"SO-002","OrderDate":"1/23/19","Region":"Central","Customer":"Kivell","Item":"Binder","Units":50,"Unit Cost":19.99,"Total":999.5} | |
{"OrderNo":"SO-003","OrderDate":"2/9/19","Region":"Central","Customer":"Jardine","Item":"Pencil","Units":36,"Unit Cost":4.99,"Total":179.64} | |
{"OrderNo":"SO-004","OrderDate":"2/26/19","Region":"Central","Customer":"Gill","Item":"Pen","Units":27,"Unit Cost":19.99,"Total":539.73} | |
{"OrderNo":"SO-005","OrderDate":"3/15/19","Region":"West","Customer":"Sorvino","Item":"Pencil","Units":56,"Unit Cost":2.99,"Total":167.44} | |
{"OrderNo":"SO-006","OrderDate":"4/1/19","Region":"East","Customer":"Jones","Item":"Binder","Units":60,"Unit Cost":4.99,"Total":299.4} | |
{"OrderNo":"SO-007","OrderDat |
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
$ serverless print --stage dev | |
service: | |
name: demo-walkthrough | |
frameworkVersion: '2' | |
provider: | |
stage: dev | |
region: ap-southeast-1 | |
name: aws | |
runtime: python3.8 | |
environment: |
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
{ | |
"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>", |
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
avro | |
confluent-kafka[avro,json] | |
pyyaml | |
pymysql | |
sqlalchemy |
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
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'){ |