The AWS Auto Scaling Goup, configured with a customised Cloud-Init file, sends a notification to an SNS Topic, which in turn passes it onto an SQS queue that the Salt Master is subscribed to. A Reactor watches for the auto scaling events and pre-approves the new minion based on its Auto Scaling group name and instance ID.
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
import json | |
logger.info('Event: %s' % json.dumps(event, indent=2)) | |
See https://gist.github.com/gene1wood/24e431859c7590c8c834 | |
time aws lambda invoke --invocation-type RequestResponse --function-name reportUntaggedInstances --region us-west-2 --log-type Tail --payload '{"region": "us-west-2"}' lambda.log | |
awslogs groups | |
awslogs get /aws/lambda/reportUntaggedInstances --no-group --no-stream -s '15 min ago' |
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
import logging | |
import json | |
logger = logging.getLogger(__name__) | |
logging.getLogger().setLevel(logging.INFO) | |
class PythonObjectEncoder(json.JSONEncoder): | |
"""Custom JSON Encoder that allows encoding of un-serializable objects | |
For object types which the json module cannot natively serialize, if the |
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 | |
set -e | |
DEFAULT_PACKAGES=ssh,language-pack-en-base | |
DEFAULT_COMPONENTS=main,universe | |
DEBOOTSTRAP=/usr/sbin/debootstrap | |
DEFAULT_MIRROR=http://archive.ubuntu.com/ubuntu | |
DEFAULT_VARIANT=minbase | |
MIRROR=${STRAP_MIRROR:-$DEFAULT_MIRROR} | |
ROOTFS=$1 |
A curated list of AWS resources to prepare for the AWS Certifications
A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.
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
* | |
!/.gitignore | |
!/*.xml | |
!/nextBuildNumber | |
!/jobs | |
!/jobs/* | |
!/jobs/*/*.xml | |
/jobs/*/disk-usage.xml | |
/jobs/*/builds |
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
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI. | |
# Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system. | |
# External USB HDD/SSD Installers Notes: Encrypted Arch installs can be booted and run from an external USB HDD or SSD, but | |
# only when the installation is correctly set up. There are several necessary changes to my standard procedure you'll want | |
# to make during the install process. Read my External USB HDD/SSD Installation section below before proceeding. |