Skip to content

Instantly share code, notes, and snippets.

@drafie
drafie / aws_autoscaling_cron.rb
Created January 28, 2021 02:34 — forked from kixorz/aws_autoscaling_cron.rb
Running cron jobs in AWS Auto Scaling group is tricky. When you deploy the same code and configuration to all instances in the group, cron job would run on all of them. You may not want that. This script detects the first instance in the group and allows only this instance to run the job. IAM user used by this script needs to have permissions to…
#!/usr/bin/env ruby
require 'syslog'
require 'net/http'
require 'aws-sdk'
Syslog.open
AWS.config({
:access_key_id => '<iam user key>',
:secret_access_key => '<iam user secret>'
@drafie
drafie / .env
Last active November 22, 2022 17:19
Lumen Mail Amazon SES AWS
# Mail
MAIL_DRIVER: 'ses'
SES_KEY: 'xxxxxxxxxxxxxx'
SES_SECRET: 'xxxxxxxxxxxxxxxxxxxxx'
SES_REGION: 'xxxxxxxxxxxxxxxx'