AWS SDKを使ったアプリケーションを作る時credentialsの扱いがいつも面倒なので、ベストプラクティス的なものを考えていきたい。
例として、
$ ruby myec2.rb list
export AWS_ACCOUNT_ID=nnnn | |
export AWS_REGION=xxxx | |
export CONTAINER_REPOSITORY=xxxx | |
export CONTAINER_IMAGE_TAG=0.0.x | |
# Docker login to ECR | |
$(aws ecr get-login --no-include-email) # bash, zsh | |
# eval (aws ecr get-login --no-include-email) # fish | |
# build, tag, and push docker image |
RewriteEngine On | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC] | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
#!/usr/bin/env ruby | |
#-*- coding: utf-8 -*- | |
require 'tweetstream' | |
require 'uri' | |
TweetStream.configure do |config| | |
config.consumer_key = 'YOUR_CONSUMER_KEY' | |
config.consumer_secret = 'YOUR_CONSUMER_SECRET' | |
config.oauth_token = 'YOUR_OAUTH_TOKEN' | |
config.oauth_token_secret = 'YOUR_OAUTH_SECRET' | |
config.auth_method = :oauth |