Skip to content

Instantly share code, notes, and snippets.

View DevoKun's full-sized avatar

Devon Hubner DevoKun

View GitHub Profile
@chiradeep
chiradeep / idling.py
Last active February 14, 2022 04:35
boto script to find and stop idle instances
import argparse
import boto3
import datetime
from dateutil.tz import tzutc
def is_in_autoscale_group(region, instance_id):
asg = boto3.client('autoscaling', region_name=region)
instances = \
asg.describe_auto_scaling_instances(InstanceIds=[instance_id])
@damusix
damusix / aws_iam_secret_to_smtp_password.md
Last active May 12, 2024 03:23
Convert AWS IAM credentials to AWS SMTP credentials

Convert AWS IAM credentials to AWS SMTP credentials

If you do, or want to, use AWS to deploy your apps, you will end up using AWS SES via SMTP when you're launching an app that sends out emails of any kind (user registrations, email notifications, etc). For example, I have used this configuration on various Ruby on Rails apps, however, it is just basic SMTP configurations and crosses over to any framework that supports SMTP sendmail.

There are two ways to go about this:

Luckily, you found this MD file and the NOT SO EASY WAY is suddenly copy-pasta... sudo yum....

@erhangundogan
erhangundogan / index.js
Created December 5, 2017 13:43
AWS Lambda HTTP basic auth
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
@shortjared
shortjared / list.txt
Last active July 12, 2024 11:42
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@NassK
NassK / aws-auth-cm.yaml.tpl
Last active June 12, 2021 14:17
step_6.tf
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
- rolearn: ${arn_instance_role}
username: system:node:{{EC2PrivateDNSName}}
groups:
@s0enke
s0enke / cdk_with_service_catalog.ts
Last active May 24, 2022 00:14
Generate AWS Service Catalog Products from CDK Constructs
// Possible since https://github.com/aws/aws-cdk/pull/17144
class VpcProduct extends servicecatalog.ProductStack {
vpc: aws_ec2.Vpc;
constructor(scope: Construct, id: string) {
super(scope, id);
this.vpc = new aws_ec2.Vpc(this, 'Vpc', {