SlideShare a Scribd company logo
RSpec for 

AWS


RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
① 名刺をスキャン ③ OCR処理&オペレーター⼊⼒
OCRとオペレーターによる多重⼊⼒
④ データベース化
• テキストデータ
• 画像データ
⑤ アプリケーションで活⽤
名刺の検索・閲覧・編集
②データ送信
インターネット
お客様
Database
名刺を
“資産”として管理
名刺を
資産として管理
⼊⼒サービス
クラウドサー
ビス
RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
150万⼈が利⽤する、名刺を軸にしたビジネスSNS
4 

28


RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス


RSpec for AWSフルマネージドサービス
🤔
RSpec for AWSフルマネージドサービス


150


1


10%


RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
D
I DKPI
D
D N
B
P
P
A B/I
N W D W
RecommendationFeed
AWS 💊
AWS100
😌
(CI)
$
Aws.config[:stub_responses] = true
it ‘true true ’ do
expect(true).to eq true
end


~/.aws/credentials
aws_access_key_id=[staging key]
aws_secret_access_key=[staging secret]
bundle exec rake db migrate:reset
🎉


RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
Aurora
DynamoDB
ElastiCache
Elasticsearch
Service
SQS
CloudSearch
S3Redshift
RSpec for AWSフルマネージドサービス
Aurora Mysql5.6
Redshift Postgres
DynamoDB DynamoDB Local
SQS ElasticMQ
S3 FakeS3
Elasticsearch Service Elasticsearch
ElastiCache Memcached & Redis
CloudSearch nozama-cloudsearch


~/config/initializers/aws.rb
if Rails.env.test? || Rails.env.development?
Aws.config[:dynamodb] = {
endpoint: 'http://localhost:8000',
access_key_id: 'fake_akid',
secret_access_key: ‘fake_secret’,
}
…
end
🎉


https://qiita.com/yotaro/items/caff6dc4c6b6ed2b19ee






config.before(:suite) do
…
WebMock.disable_net_connect!(
allow_localhost: true,
allow: [‘http://127.0.0.1:8000'], # DynamoDB Local
)
end


😅
'
4010
RSpec for AWSフルマネージドサービス
🐎






🔖
RSpec.configure do |config|
config.prepend_before(:each, :dynamodb) do
# dynamodb
#
...
end
end
describe 'DynamoDB ', :dynamodb do
# dynamodb
…
end
describe 'DynamoDB ' do
# dynamodb
# item
…
end
📝
module	UsedTableRecorder	
		def	used_tables	
				@used_tables	||=	[]	
		end	
		def	clear_used_tables	
				@used_tables	=	[]	
		end	
		[:put_item,	:update_item].each	do|method|	
				define_method	method	do|*args,	&block|	
						request_item	=	args[0]	
						used_tables	<<	request_item[:table_name]	
						super(*args,	&block)	
				end	
		end	
		[:batch_write_item].each	do|method|	
				define_method	method	do|*args,	&block|	
						request_items	=	args[0][:request_items]	
						used_tables.concat(request_items.keys)	
						super(*args,	&block)	
				end	
		end	
end
client	=	Aws::DynamoDB::Client.new(	
		stub_responses:	false	
)	
client.extend(UsedTableRecorder)	
RSpec.configure	do	|config|	
config.prepend_before(:each,	:dynamo
db)	do	
				#	 	
				truncate_tables	=	
client.used_tables.uniq.compact	
				#	 	
				...	
		end	
end
😄
4010 13
😍
'
RSpec for AWSフルマネージドサービス
⚙
RSpec for AWSフルマネージドサービス
version:	'2'	
services:	
		dynamodb:	
				image:	['ECR image ']	
				ports:	
						-	"8000:8000"	
				restart:	always	
		elasticmq:	
				image:	['ECR image ']	
				ports:	
						-	"9324:9324"	
				restart:	always	
		redis:	
				image:	redis:alpine	
				ports:	
						-	"6379:6379"	
				restart:	always	
		mysqld:	
				image:	mysql:5.6	
				ports:	
						-	"3306:3306"	
				environment:	
						MYSQL_ROOT_PASSWORD:	rootpass	
				restart:	always	
		elasticsearch:	
				image:	elasticsearch:5.3	
				ports:	
						-	"9200:9200"	
						-	"9300:9300"	
				environment:	
						-	"ES_JAVA_OPTS=-Xms300m	-Xmx500m"	
				restart:	always
fakes3:	
				image:	['ECR image ']	
				ports:	
						-	"4569:4569"	
				restart:	always	
		fakes3test:	
				image:	['ECR image ']	
				ports:	
						-	"4570:4569"	
				restart:	always	
		memcached:	
				image:	memcached:alpine	
				ports:	
						-	"11211:11211"	
				restart:	always	
		cloudsearch:	
				image:	['ECR image ']	
				links:	
						-	mongo:mongo_for_cs_1	
						-	elasticsearch:elasticsearch_for_cs_1	
				ports:	
						-	"15808:15808"	
				restart:	always	
		mongo:	
				image:	mongo	
				ports:	
						-	"27017:27017"	
				restart:	always	
		postgres:	
				image:	postgres:alpine	
				ports:	
						-	"5432:5432"	
				restart:	always
AWS Service Fake
Docker Hub

Image
Aurora Mysql5.6
Redshift Postgres
DynamoDB DynamoDB Local ✕
SQS ElasticMQ ✕
S3 FakeS3 ✕
Elasticsearch Service Elasticsearch
ElastiCache Memcached & Redis
CloudSearch nozama-cloudsearch ✕
RSpec for AWSフルマネージドサービス
😍
RSpec for AWSフルマネージドサービス


RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
RSpec for AWSフルマネージドサービス
Eight
Your business network

More Related Content

PDF
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
PDF
HDInsight Informative articles
PDF
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
PDF
AWS Analytics Immersion Day - Build BI System from Scratch (Day1, Day2 Full V...
PDF
Big Data on AWS
PDF
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
PDF
클라우드 기반 데이터 분석 및 인공 지능을 위한 비지니스 혁신 - 윤석찬 (AWS 테크에반젤리스트)
PDF
Working with Terraform on Azure
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
HDInsight Informative articles
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
AWS Analytics Immersion Day - Build BI System from Scratch (Day1, Day2 Full V...
Big Data on AWS
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
클라우드 기반 데이터 분석 및 인공 지능을 위한 비지니스 혁신 - 윤석찬 (AWS 테크에반젤리스트)
Working with Terraform on Azure

What's hot (11)

PDF
AWS DevDay Seoul 2017 - Keynote
PPTX
AWS Webinar 23 - Getting Started with AWS - Understanding total cost of owner...
PPTX
Concevoir une application scalable dans le Cloud
PPTX
Getting Started with IaC in Azure using ARM Template
PDF
Em tempo real: Ingestão, processamento e analise de dados
PPTX
Beyond EC2 and S3
PDF
Introducing Elastic MapReduce
PDF
Deep Dive on Amazon RDS (May 2016)
PDF
2017 AWS DB Day | AWS 데이터베이스 개요 - 나의 업무에 적합한 데이터베이스는?
PDF
메가존과 AWS가 공개하는 AWS 비용 최적화 전략-메가존 김성용 매니저 및 AWS 이우상 매니저:: AWS Cloud Track 3 Ga...
PDF
Databases & Analytics AWS re:invent 2019 Recap
AWS DevDay Seoul 2017 - Keynote
AWS Webinar 23 - Getting Started with AWS - Understanding total cost of owner...
Concevoir une application scalable dans le Cloud
Getting Started with IaC in Azure using ARM Template
Em tempo real: Ingestão, processamento e analise de dados
Beyond EC2 and S3
Introducing Elastic MapReduce
Deep Dive on Amazon RDS (May 2016)
2017 AWS DB Day | AWS 데이터베이스 개요 - 나의 업무에 적합한 데이터베이스는?
메가존과 AWS가 공개하는 AWS 비용 최적화 전략-메가존 김성용 매니저 및 AWS 이우상 매니저:: AWS Cloud Track 3 Ga...
Databases & Analytics AWS re:invent 2019 Recap
Ad

More from Yotaro Fujii (6)

PDF
レガシーと正しく向き合う
PDF
Sansan ~ ハッカーズチャンプルー2017 スポンサーセッション ~
PDF
名刺アプリEightのサーバーレスアーキテクチャーへの挑戦
PDF
JAWS DAYS 2017「サーバーレスが切り拓く Eightのリアルタイム大規模データ分析」
PDF
つながりを加速させる、Eightのリアルタイムリコメンデーション技術
PDF
名刺アプリEightの紙の名刺をなくす技術
レガシーと正しく向き合う
Sansan ~ ハッカーズチャンプルー2017 スポンサーセッション ~
名刺アプリEightのサーバーレスアーキテクチャーへの挑戦
JAWS DAYS 2017「サーバーレスが切り拓く Eightのリアルタイム大規模データ分析」
つながりを加速させる、Eightのリアルタイムリコメンデーション技術
名刺アプリEightの紙の名刺をなくす技術
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
MYSQL Presentation for SQL database connectivity
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
cuic standard and advanced reporting.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Big Data Technologies - Introduction.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
MYSQL Presentation for SQL database connectivity
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
cuic standard and advanced reporting.pdf
Review of recent advances in non-invasive hemoglobin estimation
Programs and apps: productivity, graphics, security and other tools
Machine learning based COVID-19 study performance prediction
Big Data Technologies - Introduction.pptx
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
The AUB Centre for AI in Media Proposal.docx
Empathic Computing: Creating Shared Understanding
20250228 LYD VKU AI Blended-Learning.pptx

RSpec for AWSフルマネージドサービス