SlideShare a Scribd company logo
1 of 51
Download to read offline
•
•
•
•
•
•
•
•
•
•
see@	http://www.restapitutorial.com/lessons/whatisrest.html
REST	API
Client
Mobile client
REST	API
GET /users HTTP/1.1
{"users": […]}
REST	API
Amazon
DynamoDB
Amazon	S3
Amazon	
CloudWatch
Auto Scaling group
Security group
Elastic Load
Balancing
Instance
REST API
Amazon
DynamoDB
Amazon	
CloudWatch
Amazon	S3
Amazon
DynamoDB
Amazon	
CloudWatch
Amazon API Gateway
AWS Lambda
Amazon	S3
Lambda.GetFunction(params: {'body': '', 'url': u'https://lambda.us-west-2.amazonaws.com/2015-03-31
IAM.GetRole(params: {'body': {'Action': u'GetRole', 'RoleName': u'helloworld7', 'Version': u'2010-
IAM.CreateRole(params: {'body': {'Action': u'CreateRole', 'RoleName': u'helloworld7', 'Version': u
IAM.PutRolePolicy(params: {'body': {'Action': u'PutRolePolicy', 'RoleName': u'helloworld7', 'Polic
Lambda.CreateFunction(params: (... omitted from logs due to size ...)
APIGateway.GetRestApis(params: {'body': '', 'url': u'https://apigateway.us-west-2.amazonaws.com/re
APIGateway.CreateRestApi(params: {'body': '{"name": "helloworld7"}', 'url': u'https://apigateway.u
APIGateway.GetResources(params: {'body': '', 'url': u'https://apigateway.us-west-2.amazonaws.com/r
APIGateway.PutMethod(params: {'body': '{"authorizationType": "NONE"}', 'url': u'https://apigateway
APIGateway.PutIntegration(params: {'body': '{"httpMethod": "POST", "requestTemplates": {"applicati
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"responseTemplates": {"application/json": ""}
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "ChaliceViewError.*", "re
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "BadRequestError.*", "res
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "NotFoundError.*", "respo
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "UnauthorizedError.*", "r
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "ForbiddenError.*", "resp
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "ConflictError.*", "respo
APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}',
APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "TooManyRequestsError.*",
Lambda.GetPolicy(params: {'body': '', 'url': u'https://lambda.us-west-2.amazonaws.com/2015-03-31/f
Lambda.AddPermission(params: {'body': '{"Action": "lambda:InvokeFunction", "StatementId": "1e96468
APIGatewayCreateDeployment(params: {'body': '{"stageName": "dev"}', 'url': u'https://apigateway.us
API
# AWS SAM
https://github.com/aws/chalice
•
•
•
•
•
•
•
$ pip install chalice
$ chalice new-project helloworld && cd helloworld
$ cat app.py
from chalice import Chalice
app = Chalice(app_name="helloworld")
@app.route("/")
def index():
return {"hello": "world"}
$ chalice deploy
...
https://endpoint/api
$ curl https://endpoint/api
{"hello": "world"}
$ git diff
from chalice import Chalice
+import boto3
app = Chalice(app_name='chalice-sample')
+S3 = boto3.client('s3', region_name='us-east-1')
@app.route('/')
def index():
+ S3.get_object(Bucket = BUCKET, Key = key)
return {'hello': 'world'}
$ chalice deploy
Creating role: chalice-sample-dev
The following execution policy will be used:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": ["*"],
"Sid": "40e10c45a..."
},
...
}
Would you like to continue? [Y/n]:
$ chalice local
Serving on localhost:8000
$ npm install -g nodemon
$ nodemon --exec "chalice local" --watch *.py
[nodemon] 1.12.5
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: app.py
[nodemon] starting `chalice local`
Serving on localhost:8000
see@	https://qiita.com/TakenoriHirao/items/69f2af5aaf64db77124b
•
•
•
# Basic Definition
@app.route('/')
def index():
return {"GET": "/"}
# Specify Methods
@app.route('/', methods=['PUT'])
def index_put():
return {"PUT": "/"}
@app.route('/res', methods=['GET', 'POST'])
def my_resource():
request = app.current_request
if request.method == 'GET':
return {"GET": "/res"}
elif request.method == 'POST':
return {"POST": "/res"}
# Path Params
@app.route('/myresources/{object_name}')
def my_resource_key(object_name):
try:
response = S3.get_object(
Bucket = BUCKET, Key = object_name)
return response['Body'].read()
except ClientError as e:
raise e
@app.route('/s3/{bucket_name}/objects')
def objects_of(bucket_name):
try:
response =
S3.list_objects_v2(Bucket=bucket_name,
Prefix = S3_PREFIX)
objects = list(map(lambda x: x["Key"],
response["Contents"]))
return {"objects": objects}
except ClientError as e:
raise ...
@app.route('/')
def index():
return Response(
body = 'hello world!',
status_code = 200,
headers = {'Content-Type': 'text/plain'}
)
@app.route('/',
cors=True,
api_key_required=True,
authorizer=IAMAuthorizer())
def index():
return "yey"
@app.schedule(Rate(1,	unit=Rate.HOURS))
def every_hour(event):
print(event.to_dict())
•
•
•
•
•
class Chalice(object):
def route(self, path, **kwargs): #
def _register_view(view_func):
self._add_route(path, view_func, **kwargs)
return view_func
return _register_view
def _add_route(self, path, view_func, **kwargs):
methods = kwargs.pop('methods', ['GET'])
...
for method in methods:
...
entry = RouteEntry(view_func, name,
path, method, api_key_required, content_types, cors,
authorizer)
self.routes[path][method] = entry
class Chalice(object):
def __call__(self, event, context): #
resource_path = event.get('requestContext',
{}).get('resourcePath')
http_method = event['requestContext']['httpMethod']
route_entry = self.routes[resource_path][http_method]
view_function = route_entry.view_function
function_args = {name: event['pathParameters'][name]
for name in route_entry.view_args}
...
response = self._get_view_function_response(view_function,
function_args)
response_headers = CaseInsensitiveMapping(response.headers)
...
response = response.to_dict(self.api.binary_types)
return response
class Chalice(object):
def _get_view_function_response(self, view_function, function_args):
try:
response = view_function(**function_args)
if not isinstance(response, Response):
response = Response(body=response)
self._validate_response(response)
except ChaliceViewError as e:
response = Response(...)
except Exception as e:
headers = {}
if self.debug:
...
else:
response = Response(..., status_code=500)
return response
https://speakerdeck.com/akitsukada/sabaresudewang-dao-webhuremuwakuwoshi-ufang-fa
https://www.slideshare.net/shimy_net/aws-79149218
https://www.slideshare.net/shimy_net/cloud-roadshow-2017-osaka
•
•
•
https://github.com/kislyuk/domovoi
@app.sns_topic_subscriber("bartender")
def tend(event, context):
message = json.loads(event["Records"][0]["Sns"]["Message"])
context.log(dict(beer="Quadrupel", quantity=message["beer"]))
@app.cloudwatch_event_handler(source=["aws.ecs"])
def monitor_ecs_events(event, context):
message = json.loads(event["Records"][0]["Sns"]["Message"])
context.log("Got an event from ECS: {}".format(message))
@app.s3_event_handler(bucket="myS3bucket",
events=["s3:ObjectCreated:*"], prefix="foo", suffix=".bar")
def monitor_s3(event, context):
message = json.loads(event["Records"][0]["Sns"]["Message"])
context.log("Got an event from S3: {}".format(message))
•
•
•
•
•
•
•
AWS REST API Tutorial
AWS REST API Tutorial

More Related Content

What's hot

A Crash Course on Serverless Applications in Python
A Crash Course on Serverless Applications in PythonA Crash Course on Serverless Applications in Python
A Crash Course on Serverless Applications in PythonJames Saryerwinnie
 
Building Global Serverless Backends
Building Global Serverless BackendsBuilding Global Serverless Backends
Building Global Serverless BackendsAmazon Web Services
 
Why your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSyncWhy your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSyncYan Cui
 
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013Amazon Web Services
 
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...Amazon Web Services
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersAmazon Web Services
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural PatternsAmazon Web Services
 
Serverless in production, an experience report (London DevOps)
Serverless in production, an experience report (London DevOps)Serverless in production, an experience report (London DevOps)
Serverless in production, an experience report (London DevOps)Yan Cui
 
DevOps for the Enterprise: Automating Deployments
DevOps for the Enterprise: Automating DeploymentsDevOps for the Enterprise: Automating Deployments
DevOps for the Enterprise: Automating DeploymentsAmazon Web Services
 
CON307_Building Effective Container Images
CON307_Building Effective Container ImagesCON307_Building Effective Container Images
CON307_Building Effective Container ImagesAmazon Web Services
 
NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017
NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017
NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017Amazon Web Services
 
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Amazon Web Services
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Atlassian
 
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013Amazon Web Services
 

What's hot (19)

A Crash Course on Serverless Applications in Python
A Crash Course on Serverless Applications in PythonA Crash Course on Serverless Applications in Python
A Crash Course on Serverless Applications in Python
 
Deep Dive into AWS Fargate
Deep Dive into AWS FargateDeep Dive into AWS Fargate
Deep Dive into AWS Fargate
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
 
Serverless Developer Experience
Serverless Developer ExperienceServerless Developer Experience
Serverless Developer Experience
 
Building Global Serverless Backends
Building Global Serverless BackendsBuilding Global Serverless Backends
Building Global Serverless Backends
 
Why your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSyncWhy your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSync
 
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
 
Serverless - State Of the Union
Serverless - State Of the UnionServerless - State Of the Union
Serverless - State Of the Union
 
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...
Stop Worrying about Prodweb001 and Start Loving i-98fb9856 (ARC201) | AWS re:...
 
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million UsersScaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
 
Serverless in production, an experience report (London DevOps)
Serverless in production, an experience report (London DevOps)Serverless in production, an experience report (London DevOps)
Serverless in production, an experience report (London DevOps)
 
DevOps for the Enterprise: Automating Deployments
DevOps for the Enterprise: Automating DeploymentsDevOps for the Enterprise: Automating Deployments
DevOps for the Enterprise: Automating Deployments
 
CON307_Building Effective Container Images
CON307_Building Effective Container ImagesCON307_Building Effective Container Images
CON307_Building Effective Container Images
 
NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017
NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017
NEW LAUNCH! Introducing AWS Fargate - CON214 - re:Invent 2017
 
Development Workflows on AWS
Development Workflows on AWSDevelopment Workflows on AWS
Development Workflows on AWS
 
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
 
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
 
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
Zero to Sixty: AWS CloudFormation (DMG201) | AWS re:Invent 2013
 

Similar to AWS REST API Tutorial

【AWS Developers Meetup】RESTful APIをChaliceで紐解く
【AWS Developers Meetup】RESTful APIをChaliceで紐解く【AWS Developers Meetup】RESTful APIをChaliceで紐解く
【AWS Developers Meetup】RESTful APIをChaliceで紐解くAmazon Web Services Japan
 
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyUsing Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyLaunchAny
 
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)Amazon Web Services
 
Building Serverless Applications with AWS Chalice
Building Serverless Applications with AWS ChaliceBuilding Serverless Applications with AWS Chalice
Building Serverless Applications with AWS ChaliceAmazon Web Services
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5Darren Craig
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Effectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby ConfEffectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby Confneal_kemp
 
Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
Amazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersAmazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersJeremy Lindblom
 
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbsAWS Chicago
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesLindsay Holmwood
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js frameworkBen Lin
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsDylan Jay
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
Easy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp NomadEasy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp NomadBram Vogelaar
 
QConSP 2015 - Dicas de Performance para Aplicações Web
QConSP 2015 - Dicas de Performance para Aplicações WebQConSP 2015 - Dicas de Performance para Aplicações Web
QConSP 2015 - Dicas de Performance para Aplicações WebFabio Akita
 
Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Robin Fernandes
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
Gigigo Rails Workshop
Gigigo Rails WorkshopGigigo Rails Workshop
Gigigo Rails WorkshopAlex Rupérez
 

Similar to AWS REST API Tutorial (20)

【AWS Developers Meetup】RESTful APIをChaliceで紐解く
【AWS Developers Meetup】RESTful APIをChaliceで紐解く【AWS Developers Meetup】RESTful APIをChaliceで紐解く
【AWS Developers Meetup】RESTful APIをChaliceで紐解く
 
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyUsing Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
 
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)
AWS re:Invent 2016: Chalice: A Serverless Microframework for Python (DEV308)
 
Building Serverless Applications with AWS Chalice
Building Serverless Applications with AWS ChaliceBuilding Serverless Applications with AWS Chalice
Building Serverless Applications with AWS Chalice
 
What's New In Laravel 5
What's New In Laravel 5What's New In Laravel 5
What's New In Laravel 5
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Effectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby ConfEffectively Testing Services - Burlington Ruby Conf
Effectively Testing Services - Burlington Ruby Conf
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
REST API for your WP7 App
REST API for your WP7 AppREST API for your WP7 App
REST API for your WP7 App
 
Amazon Web Services for PHP Developers
Amazon Web Services for PHP DevelopersAmazon Web Services for PHP Developers
Amazon Web Services for PHP Developers
 
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
Pyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web appsPyramid Lighter/Faster/Better web apps
Pyramid Lighter/Faster/Better web apps
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
Easy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp NomadEasy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp Nomad
 
QConSP 2015 - Dicas de Performance para Aplicações Web
QConSP 2015 - Dicas de Performance para Aplicações WebQConSP 2015 - Dicas de Performance para Aplicações Web
QConSP 2015 - Dicas de Performance para Aplicações Web
 
Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605Summit2011 satellites-robinf-20110605
Summit2011 satellites-robinf-20110605
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Gigigo Rails Workshop
Gigigo Rails WorkshopGigigo Rails Workshop
Gigigo Rails Workshop
 

More from 崇之 清水

知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス
知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス
知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス崇之 清水
 
マイクロサービスを AWS サーバレス&コンテナで実装する方法
マイクロサービスを AWS サーバレス&コンテナで実装する方法マイクロサービスを AWS サーバレス&コンテナで実装する方法
マイクロサービスを AWS サーバレス&コンテナで実装する方法崇之 清水
 
クラウドを活用したセンシング/モニタリングなどデータ分析の実現
クラウドを活用したセンシング/モニタリングなどデータ分析の実現クラウドを活用したセンシング/モニタリングなどデータ分析の実現
クラウドを活用したセンシング/モニタリングなどデータ分析の実現崇之 清水
 
AWS 主要なサービスアップデート 6/3-11/28
AWS 主要なサービスアップデート 6/3-11/28AWS 主要なサービスアップデート 6/3-11/28
AWS 主要なサービスアップデート 6/3-11/28崇之 清水
 
5分でサーバーレスの環境構築から本番デプロイまでやったろやないか! - Serverless Meetup Osaka #4 LT
5分でサーバーレスの環境構築から本番デプロイまでやったろやないか! - Serverless Meetup Osaka #4 LT5分でサーバーレスの環境構築から本番デプロイまでやったろやないか! - Serverless Meetup Osaka #4 LT
5分でサーバーレスの環境構築から本番デプロイまでやったろやないか! - Serverless Meetup Osaka #4 LT崇之 清水
 
サーバレスアプリケーションの入門と実践 - AWS Cloud Roadshow 2017 Osaka
サーバレスアプリケーションの入門と実践 - AWS Cloud Roadshow 2017 Osakaサーバレスアプリケーションの入門と実践 - AWS Cloud Roadshow 2017 Osaka
サーバレスアプリケーションの入門と実践 - AWS Cloud Roadshow 2017 Osaka崇之 清水
 
データ分析 on AWS
データ分析 on AWSデータ分析 on AWS
データ分析 on AWS崇之 清水
 
日本語でおk AI スピーカーを作ってみた
日本語でおk AI スピーカーを作ってみた日本語でおk AI スピーカーを作ってみた
日本語でおk AI スピーカーを作ってみた崇之 清水
 
Amazon Web Services (AWS) のご紹介
Amazon Web Services (AWS) のご紹介Amazon Web Services (AWS) のご紹介
Amazon Web Services (AWS) のご紹介崇之 清水
 
Amazon AI のスゴいデモ(仮) - Serverless Meetup Osaka
Amazon AI のスゴいデモ(仮) - Serverless Meetup OsakaAmazon AI のスゴいデモ(仮) - Serverless Meetup Osaka
Amazon AI のスゴいデモ(仮) - Serverless Meetup Osaka崇之 清水
 
Amazon Pinpoint - re:Invent Serverless Follow Up - 20161207
Amazon Pinpoint - re:Invent Serverless Follow Up - 20161207Amazon Pinpoint - re:Invent Serverless Follow Up - 20161207
Amazon Pinpoint - re:Invent Serverless Follow Up - 20161207崇之 清水
 
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜 AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜 崇之 清水
 
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016崇之 清水
 
Amazon API Gateway を活用したゲームサーバー構築
Amazon API Gateway を活用したゲームサーバー構築Amazon API Gateway を活用したゲームサーバー構築
Amazon API Gateway を活用したゲームサーバー構築崇之 清水
 
関西スタートアップAWS勉強会 スタートアップ最新事例
関西スタートアップAWS勉強会 スタートアップ最新事例関西スタートアップAWS勉強会 スタートアップ最新事例
関西スタートアップAWS勉強会 スタートアップ最新事例崇之 清水
 
スタートアップ向け構成例とAWS活用事例(福岡市スタートアップカフェ)
スタートアップ向け構成例とAWS活用事例(福岡市スタートアップカフェ)スタートアップ向け構成例とAWS活用事例(福岡市スタートアップカフェ)
スタートアップ向け構成例とAWS活用事例(福岡市スタートアップカフェ)崇之 清水
 
Amazon Aurora の活用 - Developers.IO in OSAKA
Amazon Aurora の活用 - Developers.IO in OSAKAAmazon Aurora の活用 - Developers.IO in OSAKA
Amazon Aurora の活用 - Developers.IO in OSAKA崇之 清水
 
SA プライムなう! - AWS IoT とロボットアームでお絵かき
SA プライムなう! - AWS IoT とロボットアームでお絵かきSA プライムなう! - AWS IoT とロボットアームでお絵かき
SA プライムなう! - AWS IoT とロボットアームでお絵かき崇之 清水
 
Amazon Aurora の活用
Amazon Aurora の活用Amazon Aurora の活用
Amazon Aurora の活用崇之 清水
 
CTO Night & Days 2015 Winter - AWS Mobile Testing
CTO Night & Days 2015 Winter - AWS Mobile TestingCTO Night & Days 2015 Winter - AWS Mobile Testing
CTO Night & Days 2015 Winter - AWS Mobile Testing崇之 清水
 

More from 崇之 清水 (20)

知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス
知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス
知らなきゃ損なアップデートを振り返り(2020年分)- いにしえのサービスから勝手にチョイス
 
マイクロサービスを AWS サーバレス&コンテナで実装する方法
マイクロサービスを AWS サーバレス&コンテナで実装する方法マイクロサービスを AWS サーバレス&コンテナで実装する方法
マイクロサービスを AWS サーバレス&コンテナで実装する方法
 
クラウドを活用したセンシング/モニタリングなどデータ分析の実現
クラウドを活用したセンシング/モニタリングなどデータ分析の実現クラウドを活用したセンシング/モニタリングなどデータ分析の実現
クラウドを活用したセンシング/モニタリングなどデータ分析の実現
 
AWS 主要なサービスアップデート 6/3-11/28
AWS 主要なサービスアップデート 6/3-11/28AWS 主要なサービスアップデート 6/3-11/28
AWS 主要なサービスアップデート 6/3-11/28
 
5分でサーバーレスの環境構築から本番デプロイまでやったろやないか! - Serverless Meetup Osaka #4 LT
5分でサーバーレスの環境構築から本番デプロイまでやったろやないか! - Serverless Meetup Osaka #4 LT5分でサーバーレスの環境構築から本番デプロイまでやったろやないか! - Serverless Meetup Osaka #4 LT
5分でサーバーレスの環境構築から本番デプロイまでやったろやないか! - Serverless Meetup Osaka #4 LT
 
サーバレスアプリケーションの入門と実践 - AWS Cloud Roadshow 2017 Osaka
サーバレスアプリケーションの入門と実践 - AWS Cloud Roadshow 2017 Osakaサーバレスアプリケーションの入門と実践 - AWS Cloud Roadshow 2017 Osaka
サーバレスアプリケーションの入門と実践 - AWS Cloud Roadshow 2017 Osaka
 
データ分析 on AWS
データ分析 on AWSデータ分析 on AWS
データ分析 on AWS
 
日本語でおk AI スピーカーを作ってみた
日本語でおk AI スピーカーを作ってみた日本語でおk AI スピーカーを作ってみた
日本語でおk AI スピーカーを作ってみた
 
Amazon Web Services (AWS) のご紹介
Amazon Web Services (AWS) のご紹介Amazon Web Services (AWS) のご紹介
Amazon Web Services (AWS) のご紹介
 
Amazon AI のスゴいデモ(仮) - Serverless Meetup Osaka
Amazon AI のスゴいデモ(仮) - Serverless Meetup OsakaAmazon AI のスゴいデモ(仮) - Serverless Meetup Osaka
Amazon AI のスゴいデモ(仮) - Serverless Meetup Osaka
 
Amazon Pinpoint - re:Invent Serverless Follow Up - 20161207
Amazon Pinpoint - re:Invent Serverless Follow Up - 20161207Amazon Pinpoint - re:Invent Serverless Follow Up - 20161207
Amazon Pinpoint - re:Invent Serverless Follow Up - 20161207
 
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜 AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
AWS SDK for PHP のインストールから 始めるクラウドマスターへの道 〜 Promise による非同期オペレーション 〜
 
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
WordPress RESTful API & Amazon API Gateway - WordCamp Kansai 2016
 
Amazon API Gateway を活用したゲームサーバー構築
Amazon API Gateway を活用したゲームサーバー構築Amazon API Gateway を活用したゲームサーバー構築
Amazon API Gateway を活用したゲームサーバー構築
 
関西スタートアップAWS勉強会 スタートアップ最新事例
関西スタートアップAWS勉強会 スタートアップ最新事例関西スタートアップAWS勉強会 スタートアップ最新事例
関西スタートアップAWS勉強会 スタートアップ最新事例
 
スタートアップ向け構成例とAWS活用事例(福岡市スタートアップカフェ)
スタートアップ向け構成例とAWS活用事例(福岡市スタートアップカフェ)スタートアップ向け構成例とAWS活用事例(福岡市スタートアップカフェ)
スタートアップ向け構成例とAWS活用事例(福岡市スタートアップカフェ)
 
Amazon Aurora の活用 - Developers.IO in OSAKA
Amazon Aurora の活用 - Developers.IO in OSAKAAmazon Aurora の活用 - Developers.IO in OSAKA
Amazon Aurora の活用 - Developers.IO in OSAKA
 
SA プライムなう! - AWS IoT とロボットアームでお絵かき
SA プライムなう! - AWS IoT とロボットアームでお絵かきSA プライムなう! - AWS IoT とロボットアームでお絵かき
SA プライムなう! - AWS IoT とロボットアームでお絵かき
 
Amazon Aurora の活用
Amazon Aurora の活用Amazon Aurora の活用
Amazon Aurora の活用
 
CTO Night & Days 2015 Winter - AWS Mobile Testing
CTO Night & Days 2015 Winter - AWS Mobile TestingCTO Night & Days 2015 Winter - AWS Mobile Testing
CTO Night & Days 2015 Winter - AWS Mobile Testing
 

Recently uploaded

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 

Recently uploaded (20)

Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 

AWS REST API Tutorial

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 8.
  • 9.
  • 10.
  • 13.
  • 15. Auto Scaling group Security group Elastic Load Balancing Instance REST API Amazon DynamoDB Amazon CloudWatch Amazon S3
  • 17.
  • 18. Lambda.GetFunction(params: {'body': '', 'url': u'https://lambda.us-west-2.amazonaws.com/2015-03-31 IAM.GetRole(params: {'body': {'Action': u'GetRole', 'RoleName': u'helloworld7', 'Version': u'2010- IAM.CreateRole(params: {'body': {'Action': u'CreateRole', 'RoleName': u'helloworld7', 'Version': u IAM.PutRolePolicy(params: {'body': {'Action': u'PutRolePolicy', 'RoleName': u'helloworld7', 'Polic Lambda.CreateFunction(params: (... omitted from logs due to size ...) APIGateway.GetRestApis(params: {'body': '', 'url': u'https://apigateway.us-west-2.amazonaws.com/re APIGateway.CreateRestApi(params: {'body': '{"name": "helloworld7"}', 'url': u'https://apigateway.u APIGateway.GetResources(params: {'body': '', 'url': u'https://apigateway.us-west-2.amazonaws.com/r APIGateway.PutMethod(params: {'body': '{"authorizationType": "NONE"}', 'url': u'https://apigateway APIGateway.PutIntegration(params: {'body': '{"httpMethod": "POST", "requestTemplates": {"applicati APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}', APIGateway.PutIntegrationResponse(params: {'body': '{"responseTemplates": {"application/json": ""} APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}', APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "ChaliceViewError.*", "re APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}', APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "BadRequestError.*", "res APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}', APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "NotFoundError.*", "respo APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}', APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "UnauthorizedError.*", "r APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}', APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "ForbiddenError.*", "resp APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}', APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "ConflictError.*", "respo APIGateway.PutMethodResponse(params: {'body': '{"responseModels": {"application/json": "Empty"}}', APIGateway.PutIntegrationResponse(params: {'body': '{"selectionPattern": "TooManyRequestsError.*", Lambda.GetPolicy(params: {'body': '', 'url': u'https://lambda.us-west-2.amazonaws.com/2015-03-31/f Lambda.AddPermission(params: {'body': '{"Action": "lambda:InvokeFunction", "StatementId": "1e96468 APIGatewayCreateDeployment(params: {'body': '{"stageName": "dev"}', 'url': u'https://apigateway.us API # AWS SAM
  • 19.
  • 22. $ pip install chalice $ chalice new-project helloworld && cd helloworld $ cat app.py from chalice import Chalice app = Chalice(app_name="helloworld") @app.route("/") def index(): return {"hello": "world"}
  • 23. $ chalice deploy ... https://endpoint/api $ curl https://endpoint/api {"hello": "world"}
  • 24. $ git diff from chalice import Chalice +import boto3 app = Chalice(app_name='chalice-sample') +S3 = boto3.client('s3', region_name='us-east-1') @app.route('/') def index(): + S3.get_object(Bucket = BUCKET, Key = key) return {'hello': 'world'}
  • 25. $ chalice deploy Creating role: chalice-sample-dev The following execution policy will be used: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject" ], "Resource": ["*"], "Sid": "40e10c45a..." }, ... } Would you like to continue? [Y/n]:
  • 26. $ chalice local Serving on localhost:8000 $ npm install -g nodemon $ nodemon --exec "chalice local" --watch *.py [nodemon] 1.12.5 [nodemon] to restart at any time, enter `rs` [nodemon] watching: app.py [nodemon] starting `chalice local` Serving on localhost:8000 see@ https://qiita.com/TakenoriHirao/items/69f2af5aaf64db77124b
  • 28.
  • 29. # Basic Definition @app.route('/') def index(): return {"GET": "/"}
  • 30. # Specify Methods @app.route('/', methods=['PUT']) def index_put(): return {"PUT": "/"}
  • 31. @app.route('/res', methods=['GET', 'POST']) def my_resource(): request = app.current_request if request.method == 'GET': return {"GET": "/res"} elif request.method == 'POST': return {"POST": "/res"}
  • 32. # Path Params @app.route('/myresources/{object_name}') def my_resource_key(object_name): try: response = S3.get_object( Bucket = BUCKET, Key = object_name) return response['Body'].read() except ClientError as e: raise e
  • 33. @app.route('/s3/{bucket_name}/objects') def objects_of(bucket_name): try: response = S3.list_objects_v2(Bucket=bucket_name, Prefix = S3_PREFIX) objects = list(map(lambda x: x["Key"], response["Contents"])) return {"objects": objects} except ClientError as e: raise ...
  • 34. @app.route('/') def index(): return Response( body = 'hello world!', status_code = 200, headers = {'Content-Type': 'text/plain'} )
  • 35.
  • 37.
  • 39. class Chalice(object): def route(self, path, **kwargs): # def _register_view(view_func): self._add_route(path, view_func, **kwargs) return view_func return _register_view def _add_route(self, path, view_func, **kwargs): methods = kwargs.pop('methods', ['GET']) ... for method in methods: ... entry = RouteEntry(view_func, name, path, method, api_key_required, content_types, cors, authorizer) self.routes[path][method] = entry
  • 40. class Chalice(object): def __call__(self, event, context): # resource_path = event.get('requestContext', {}).get('resourcePath') http_method = event['requestContext']['httpMethod'] route_entry = self.routes[resource_path][http_method] view_function = route_entry.view_function function_args = {name: event['pathParameters'][name] for name in route_entry.view_args} ... response = self._get_view_function_response(view_function, function_args) response_headers = CaseInsensitiveMapping(response.headers) ... response = response.to_dict(self.api.binary_types) return response
  • 41. class Chalice(object): def _get_view_function_response(self, view_function, function_args): try: response = view_function(**function_args) if not isinstance(response, Response): response = Response(body=response) self._validate_response(response) except ChaliceViewError as e: response = Response(...) except Exception as e: headers = {} if self.debug: ... else: response = Response(..., status_code=500) return response
  • 42.
  • 47. @app.sns_topic_subscriber("bartender") def tend(event, context): message = json.loads(event["Records"][0]["Sns"]["Message"]) context.log(dict(beer="Quadrupel", quantity=message["beer"])) @app.cloudwatch_event_handler(source=["aws.ecs"]) def monitor_ecs_events(event, context): message = json.loads(event["Records"][0]["Sns"]["Message"]) context.log("Got an event from ECS: {}".format(message)) @app.s3_event_handler(bucket="myS3bucket", events=["s3:ObjectCreated:*"], prefix="foo", suffix=".bar") def monitor_s3(event, context): message = json.loads(event["Records"][0]["Sns"]["Message"]) context.log("Got an event from S3: {}".format(message))
  • 48.