This file contains 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
#!/bin/bash | |
username="COGNITO_USER_NAME" | |
password="PASSWORD" | |
clientid="APP_CLIENT_ID" | |
region="eu-west-1" | |
aws_profile="AWS_CLI_PROFILE" | |
response_json="" | |
json_field='IdToken' |
This file contains 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
PROJECT = myProject | |
FUNCTION = $(PROJECT) | |
REGION = us-west-1 | |
ENVCHAIN = my-aws-env | |
all: build | |
.PHONY: clean build deploy | |
clean: |
This file contains 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
:: | |
:: This script installs wormhole (https://github.com/warner/magic-wormhole) and | |
:: its prerequisites. Run this as an administrator. | |
:: | |
:: Install chocolatey. | |
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
:: Install Python 3. | |
choco install -y python |
This file contains 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
from io import BytesIO | |
import gzip | |
import shutil | |
def upload_gzipped(bucket, key, fp, compressed_fp=None, content_type='text/plain'): | |
"""Compress and upload the contents from fp to S3. | |
If compressed_fp is None, the compression is performed in memory. | |
""" |