Skip to content

Instantly share code, notes, and snippets.

@amlana21
amlana21 / options.md
Created January 13, 2023 23:34
DDB Async architecture options
  • Introduce a caching layer.
    • Do a query to call a Lambda. That lambda calls another lambda in async mode and the 1st lambda responds a req id to caller
    • The 2nd lambda queries ddb and waits for result. On result received from ddb write results to a cache like Elasticache
    • From frontend keep querying cache with request id. WHen result gets available, read the results. This will be much faster than ddb
  • Use websocket
    • Implement a websocket service
    • Open a websocket connection from frontend
    • repeat above steps with 2 lambda (from caching option)
    • but instead of cache, 2nd lambda returns results to websocket and frontend gets result from socket connection
  • Use DAX to improve performance. This will improve DDB performance if you have large number of records
@amlana21
amlana21 / aws-auth-config-map-utility.py
Created June 28, 2022 04:44 — forked from si3mshady/aws-auth-config-map-utility.py
generate aws auth configmap manifest that grants IAM users AWS Roles access to Kubernetes Cluster
import yaml, subprocess, json, re, sys
FILE_NAME = 'auth_config.yaml'
KUBERNETES_GROUP = 'system:masters'
cmd = f'kubectl get configmap aws-auth -n kube-system -o yaml > {FILE_NAME}'
MASTER_PARSER = '({["rolearn":"arn]+[:a-z0-9\/\w-]+"[,"\w\/-:{{{]*[-\w}}",:\[]*[\]]*})' #regex101