sudo apt-get install python3-pip
sudo pip3 install virtualenv
# This file is your Lambda function | |
import json | |
import boto3 | |
def save_to_bucket(event, context): | |
AWS_BUCKET_NAME = 'my-bucket-name' | |
s3 = boto3.resource('s3') | |
bucket = s3.Bucket(AWS_BUCKET_NAME) | |
path = 'my-path-name.txt' |
#!/bin/bash | |
## | |
# Pure BASH interactive CLI/TUI menu (single and multi-select/checkboxes) | |
# | |
# Author: Markus Geiger <mg@evolution515.net> | |
# Last revised 2019-09-11 | |
# | |
# ATTENTION! TO BE REFACTORED! FIRST DRAFT! | |
# |
// A SO answer to https://stackoverflow.com/questions/286141/remove-blank-attributes-from-an-object-in-javascript | |
// based off the recursive cleanEmpty function by @chickens. | |
// This one can also handle Date objects correctly | |
// and has a defaults list for values you want stripped. | |
const cleanEmpty = function(obj, defaults = [undefined, null, NaN, '']) { | |
if (defaults.includes(obj)) return | |
if (Array.isArray(obj)) | |
return obj |
// create the rest API for accessing our lambdas | |
const api: apigw.RestApi = new apigw.RestApi(this, "blogs-api", { | |
description: "blogs api gateway", | |
deploy: true, | |
deployOptions: { | |
// this enables caching on our api gateway, with a ttl of five minutes (unless overridden per method) | |
cachingEnabled: true, | |
cacheClusterEnabled: true, | |
cacheDataEncrypted: true, | |
stageName: "prod", |