Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I really enjoyed making a CLI tool to automate cross-posting blog posts to different places. So, I started looking for another platform to add and Tumblr seemed like a good candidate. Rough code is on Github.
# Rename binary for AWS Lambda custom runtime: # https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html [[bin]] name = "bootstrap" path = "src/main.rs" [dependencies] anyhow = "1.0" aws_sqs = { git = "https://github.com/awslabs/aws-sdk-rust", tag = "v0.0.10-alpha", package = "aws-sdk-sqs" } futures = "0.3" lambda_runtime = "0.3" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tokio = { version = "1.5.0", features = ["full"] } tracing = "0.1" tracing-subscriber = "0.2"
As before, we'll use the AWS Lambda Rust runtime to implement our lambda function. MUSL is used to create a fully static Rust binary.
### Install pre-requisites # For Mac/OSX: install command line tools and cross-compiler xcode-select --install brew install FiloSottile/musl-cross/musl-cross rustup target add x86_64-unknown-linux-musl ### Build OpenSSL with musl wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1f.tar.gz tar xzf OpenSSL_1_1_1f.tar.gz cd openssl-OpenSSL_1_1_1f export CROSS_COMPILE=x86_64-linux-musl- # `-DOPENSSL_NO_SECURE_MEMORY` is to avoid `define OPENSSL_SECURE_MEMORY` which needs `#include ` (which OSX doesn't have). ./Configure CFLAGS="-DOPENSSL_NO_SECURE_MEMORY -fpie -pie" no-shared no-async --prefix=output_abs_path/musl --openssldir=output_abs_path/musl/ssl linux-x86_64 make depend # Use `sysctl -n hw.physicalcpu` or `hw.logicalcpu` with `-j` if so inclined make # Install required stuff to `output_abs_path/musl/` (exclude man-pages, etc.) make install_sw # Set value from `--prefix` above export OPENSSL_DIR=output_abs_path/musl ### Build Rust lambda function cargo build --release
--cli-connect-timeout deals with commands failing with Error: Connection was closed before we received a valid response (see issue)
Related posts
- It is not possible to install ARM64 AWS CLI
- Python Cookiecutter: Streamline Template Projects for Enhanced Developer Experience
- [Engineering_Stuff] S3FS-FUSE - Permet de monter votre lien de seau S3 / Minio vers votre répertoire local
- s3fs-fuse - allows to mount your s3/minio bucket link to your local directory
- AWS S3 storage class invalid - DEEP_ARCHIVE - why?