Quickstart site to build out a lambda function

Create a mini Spring initializer for AWS Lambda functions. Backend service Builds a layer for the different cookiecutter templates. (NOTE: This will be limited for what we can bundle) Webservice includes a number of parameters for the aws lambda powertools templates: name: defaults to hello-world, is the name of the project runtime: defaults to python3.9, is the language runtime version (could also support typescript via nodejs) architecture: defaults to x86_64, is the CPU architecture (can also be arm64) memory: defaults […]

Read more

Analyze Big Sequence Alignments with PySpark in AWS EMR

This repo hosts my code for the article “Analyze Big Sequence Alignments with PySpark in AWS EMR”. Spark AWS CLI AWS Account Follow the instruction in the article. Once you have uploaded the files into your S3 bucket, run aws emr create-cluster –name “Spark_step_pip” –release-label emr-6.5.0 –applications Name=Spark –log-uri s3://[your_S3_bucket]/logs/ –instance-type m5.xlarge –instance-count 3 –bootstrap-actions Path=s3://[your_S3_bucket]/emr_bootstrap.sh –use-default-roles –auto-terminate –steps “Type=Spark,Name=SparkProgram,ActionOnFailure=CONTINUE,Args=[–deploy-mode,cluster,–master,yarn,–py-files,s3://[your_S3_bucket]/helper_function.py,s3://[your_S3_bucket]/spark_3mer.py,s3://[your_S3_bucket]/test.sam,[your_S3_bucket],sankey.json]”    

Read more

Let’s pretend you want to create a AWS Lambda project called “sns-processor”

Usage Let’s pretend you want to create a AWS Lambda project called “sns-processor”. Rather than using lambda and then editing the results to include your name, email, and various configuration issues that always get forgotten until the worst possible moment, get cookiecutter_ to do all the work. First, get Cookiecutter. Trust me, it’s awesome:: $ pip install “cookiecutter>=1.7.0” Now run it against this repo:: $ cookiecutter https://github.com/zahaar/go-lambda-cookiecutter You’ll be prompted for some values. Provide them, then a Lambda sample project […]

Read more

Boto3 : The AWS SDK for Python

Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for Python, which allows Python developers to write software that makes use of services like Amazon S3 and Amazon EC2. You can find the latest, most up to date, documentation at our doc site, including a list of services that are supported. Getting Started Assuming that you have Python and virtualenv installed, set up your environment and install the required dependencies like this or you can install the library […]

Read more

AWS Lambda Fast API starter application

Fast API starter application compatible with API Gateway and Lambda Function. How to deploy it? Terraform AWS Lambda API is a reusable module that can be used todeploy this Fast Application and It will provision: The AWS Lambda Function resources The AWS Lambda Function CI/CD resources The AWS API Gateway HTTP API resources Structure This Fast Application is using Mangum to adapt AWS API Gateway events toASGI requests. When creating the Lambda Function, make sure that the handler is set […]

Read more

AWS SQS event redrive Lambda With Python

This repository contains one simple AWS Lambda function in Python to redrive AWS SQS events from source queue to destination queue. This script can be triggered periodically via cloudwatch as well if source queue contains too many events and you dont want to redrive them altogether. batch_size can be passed as input which will move only X events in one execution cycle. Default batch size is 10 if no value is passed. This script ensures that if same event is […]

Read more

An AWS Pentesting tool that lets you use one-liner commands to backdoor an AWS account’s resources with a rogue AWS account

An AWS Pentesting tool that lets you use one-liner commands to backdoor an AWS account’s resources with a rogue AWS account – or share the resources with the entire internet? TL;DR: endgame smash –service all to create backdoors across your entire AWS account – by sharing resources either with a rogue IAM user/role or with the entire Internet. Endgame abuses AWS’s resource permission model to grant rogue users (or the Internet) access to an AWS account’s resources with a single […]

Read more

Easily load variables from AWS Parameter store into environment variables

Easily load variables from AWS Parameter store into environment variables. Because it handles AWS pagination so the amount of requests performed to retrieve the parameters are the bare minimum.Also it handles invalid parameters, so you don’t have to deal with undefined variables exceptions, as an option. from awstanding.parameter_store import load_parameters load_parameters({‘/some/path/to/something/stored’: ‘IMPORTANT_SETTING’}) import os print(os.environ.get(‘IMPORTANT_SETTING’)) ‘super-important-value’ import os from awstanding.parameter_store import load_parameters

Read more

Demonstration that AWS IAM policy evaluation docs are incorrect

The flowchart from the AWS IAM policy evaluation documentation page, as of 2021-09-12, and dating back to at least 2018-12-27, is the following: The flowchart indicates that an Allow in a resource policy causes a final decision of Allow, before permissions boundaries have a chance to cause an implicit Deny. This would mean a resource policy could unilaterally grant access to a principal, circumventing its permissions boundary. However, this is only partially correct. Resource policies cannot unilaterally grant access to […]

Read more
1 2