Skip to content

Instantly share code, notes, and snippets.

Facebokkの認証のWeb Identity Federationを使ってみる

流れを把握する

  • IAMのページの右下にあるWeb Identity Federation Playgroundを確認すると以降の全体の流れが把握できる

Web Identity Federation用のIAMROleを作成

  • Roleを作る
  • Select Role TypeではRole for Identity Provider AccessGrant access to web identity providersを指定する。

install

設定

  • デフォルト設定ではクラスタ名が「elasticsearch」となるので、「cluster.name = test_cluster」などのようにクラスタ名称を変更すること
module Hoge
def filter_record
puts "hoge hello"
end
end
module Fuga
include Hoge
def filter_record
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "A simple stack that launches an instance.",
"Parameters" : {
"InstanceTypeParameter" : {
"Type" : "String",
"Default" : "t2.micro"
},
"KeyNameParameter" : {
"Type" : "String"
# dry run
logrotate -d /etc/logrotate.conf
# specific conf
logrotate -d /etc/logrotate.d/httpd
# force execute(Normally logrotate confirms /var/lib/logrotate.status)
logrotate -f /etc/logrotate.conf
# valid
aws cloudformation validate-template --template-body file://MyStack.json
# create stack
aws cloudformation create-stack --template-body file://Mystack.json --stack-name MyFirstStack
# create stack with parameter
aws cloudformation create-stack --template-body file://CloufFormationSample.json --stack-name MyFirstStack --parameters ParameterKey=KeyNameParameter,ParameterValue=HogeKeyPair
# update stack
#!/bin/bash
dir=/etc/crontab
echo -e "\n**************${dir}****************"
cat ${dir}
echo "***********************************"
for dir in `ls -d /var/spool/cron/*`
do
echo -e "\n**************${dir}****************"
# *.deb or *.sh
find . -type f -name "*.deb" -or -name "*.sh"
# not *.deb or *.sh
find . -type f ! -name "*.deb" -and ! -name "*.sh"
# date format(hoge_20150307 etc...)
find . -type f -name "*`date +%Y%m%d`"
WAPFILENAME=/swap.img
MEMSIZE=`cat /proc/meminfo | grep MemTotal | awk '{print $2}'`
if [ $MEMSIZE -lt 2097152 ]; then
SIZE=$(($MEMSIZE * 2))k
elif [ $MEMSIZE -lt 8388608 ]; then
SIZE=${MEMSIZE}k
elif [ $MEMSIZE -lt 67108864 ]; then
SIZE=$(($MEMSIZE / 2))k
else
require "selenium-webdriver"
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://www.google.co.jp"
element = driver.find_element(:name, 'q')
element.send_keys "selenium"
element.submit
puts driver.title