Skip to content

Instantly share code, notes, and snippets.

View antoniogrv's full-sized avatar
🌍

Antonio Gravino antoniogrv

🌍
View GitHub Profile
@antoniogrv
antoniogrv / gist:98d2d021f4c260c25190cb9dd43ae35d
Created July 28, 2023 08:54
Redis (from source) over an AMI-powered AWS EC2 instance
# Redis (from source) over an AMI-powered AWS EC2 instance
sudo yum install -y gcc wget
wget http://download.redis.io/redis-stable.tar.gz
&& tar xvzf redis-stable.tar.gz
&& cd redis-stable
&& make
sudo cp src/redis-cli /usr/bin/
# source: https://gist.github.com/todgru/14768fb2d8a82ab3f436?permalink_comment_id=2369248#gistcomment-2369248
@antoniogrv
antoniogrv / serverless.yml
Last active May 10, 2023 18:48
Bref-compatible Task Scheduler on AWS Lambda
# Serverless Framework function that looks for scheduled Laravel jobs and spawns a Lambda instance if needed.
artisan:
name: ${self:service}-${self:provider.stage}-artisan
description: Artisan CLI & Cron Scheduler
handler: artisan
timeout: 60
runtime: php-82-console
layers:
- ${bref-extra:redis-php-82}
@antoniogrv
antoniogrv / docker-compose.yml
Created May 10, 2023 18:32
Composing an AWS Local Development Environment with LocalStack
# Creates a Docker-compatible AWS environment based on LocalStack.
# Allows for locally testing AWS resources, rather than depending on a sandbox/test AWS account.
# Initialization of certain AWS services (i.e. SQS, S3) can be automatized on bootstrap.
version: '3.8'
services:
aws:
image: localstack/localstack
ports:
- "127.0.0.1:4566:4566"
@antoniogrv
antoniogrv / aurora.yml
Created May 10, 2023 18:27
AWS Aurora Serverless v2 CloudFormation Example
# Provisions an AWS Aurora Serverless v2 cluster ..
# .. with stage-based ACU parameters and instance replication.
Resources:
BackendDatabaseCluster:
Type: AWS::RDS::DBCluster
DeletionPolicy: Snapshot
Properties:
Engine: aurora-mysql
EngineVersion: "8.0.mysql_aurora.3.03.1"
@antoniogrv
antoniogrv / serverless.yml
Last active May 10, 2023 18:50
SLS-Provisioned AWS Step Functions Example
# Common use-case example of an AWS-managed state machine that orchestrates AWS Lambda instances.
# Provisioned via Serverless Framework as a CloudFormation stack.
provider:
name: aws
stage: ${opt:stage, self:custom.defaultStage}
region: eu-central-1 // us-east-1, us-west-2, ...
runtime: python3.9 // 3.7, 3.8, ...
stackName: ${self:service}-${self:provider.stage}
timeout: 300