Skip to content

Instantly share code, notes, and snippets.

@s-fujimoto
s-fujimoto / cfnyaml.py
Created May 28, 2016 08:10
CloudFormation parameters use by YAML format
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import json
try:
import boto3
import yaml
except ImportError:
print '*******************************'
@s-fujimoto
s-fujimoto / swap.py
Last active May 22, 2016 02:23
Managed OS Swap space for Ansible Module
#!/usr/bin/env python
# -*- coding: utf-8 -*-
DOCUMENTATION = '''
---
module: swap
author: Shinji Fujimoto
short_description: Managed OS Swap space
requirements: None
description:
@s-fujimoto
s-fujimoto / cloudfront.template.json
Created April 27, 2016 11:04
Elasticsearch Index Template file for CloudFront log
{
"template": "cloudfront-logs-*",
"mappings": {
"logs": {
"_source": {
"enabled": false
},
"_all": {
"enabled": false
},
##################################################
### Elasticsearch host name
ES_HOST = "search-*******************.ap-northeast-1.es.amazonaws.com"
### Elasticsearch prefix for index name
INDEX_PREFIX = "slowquerylog"
### Elasticsearch type name is rds instance id
RDS_ID = "<RDS_INSTANCE_IDENTIFY>"
#!/usr/bin/env python
import os
import requests
import boto3
import base64
import argparse
from getpass import getpass
from bs4 import BeautifulSoup as bs