AWS SDKを使ったアプリケーションを作る時credentialsの扱いがいつも面倒なので、ベストプラクティス的なものを考えていきたい。
例として、
$ ruby myec2.rb list
source 'https://rubygems.org' | |
gem 'fluentd' | |
gem 'fluent-plugin-td' | |
gem 'fluent-plugin-elasticsearch' |
#! /bin/bash | |
# HEADS UP! Make sure to use '*' or a valid hostname for the FDQN prompt | |
echo 01 > ca.srl | |
openssl genrsa -des3 -out ca-key.pem | |
openssl req -new -x509 -days 365 -key ca-key.pem -out ca.pem | |
openssl genrsa -des3 -out server-key.pem | |
openssl req -new -key server-key.pem -out server.csr |
import json | |
import urllib | |
import urllib2 | |
url = 'http://localhost:8888/ansible' | |
def post(category, data): | |
data['category'] = category | |
invocation = data.pop('invocation', None) |
#! /usr/bin/perl | |
# | |
# Written in 2017 by Kazuho Oku | |
# | |
# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. | |
# You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. | |
# | |
use strict; | |
use warnings; |
# encoding: UTF-8 | |
require 'optparse' | |
require 'net/http' | |
require 'json' | |
def parse_options(argv) | |
opts = {} | |
@parser = OptionParser.new do |o| |
resource "aws_acm_certificate" "mizzy_org" { | |
provider = aws.us-east-1 | |
domain_name = "mizzy.org" | |
validation_method = "EMAIL" | |
} | |
resource "aws_cloudfront_distribution" "mizzy_org" { | |
enabled = true | |
aliases = ["mizzy.org"] |
>>> import itertools | |
>>> import string | |
>>> from elasticsearch import Elasticsearch,helpers | |
es = Elasticsearch() | |
>>> # k is a generator expression that produces | |
... # a series of dictionaries containing test data. | |
... # The test data are just letter permutations | |
... # created with itertools.permutations. | |
... # | |
... # We then reference k as the iterator that's |