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 / approve_release.py
Created March 27, 2017 01:41
Approve CodePipeline approval action with Lambda function
import boto3
def lambda_handler(event, context):
pipeline_name=event['PIPELINE_NAME']
stage_name=event['STAGE_NAME']
action_name=event['ACTION_NAME']
cp = boto3.client('codepipeline')
state = cp.get_pipeline_state(name=pipeline_name)
@s-fujimoto
s-fujimoto / s3-to-es-lambda-with-ingest.py
Last active May 9, 2019 19:57
Transfer s3 to Elasticsearch log from by Lambda
import boto3
import os
import gzip
from datetime import datetime
from botocore.awsrequest import AWSRequest
from botocore.auth import SigV4Auth
from botocore.endpoint import BotocoreHTTPSession
from botocore.credentials import Credentials
def lambda_handler(event, context):
#!/usr/bin/env python
import twitter
import boto3
import os
keyword = '#reinvent'
lang = 'en'
region = 'us-east-1'
size = 100 * 100
#!/usr/bin/env python
import twitter
import boto3
import os
keyword = 'dev.classmethod.jp'
region = 'us-east-1'
size = 10 * 100