Skip to content

Instantly share code, notes, and snippets.

View arouene's full-sized avatar

Aurélien Rouëné arouene

  • Lucca
  • Nantes (France)
View GitHub Profile
@arouene
arouene / add_ec2_to_route53.py
Created April 16, 2018 14:20
add ec2 instances with tag Name in Route53 Domain
import os
import boto3
HOSTED_ZONE_ID = "ABCDEF123456789"
DOMAIN_NAME = ".example.lan."
def lambda_handler():
# Setup Boto3 client
boto3.setup_default_session(region_name='us-east-1')
ec2 = boto3.client("ec2")
@arouene
arouene / subprocess_run.py
Created April 10, 2018 11:49
Python backports
# Backport subprocess.run for Python 3.3 and 3.4
import subprocess
if not 'run' in subprocess.__all__:
class CompletedProcess(object):
def __init__(self, stdout, stderr, returncode):
self._stdout = stdout
self._stderr = stderr