0
0
AWScloud~30 mins

Resources and methods in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
AWS API Gateway: Resources and Methods Setup
📖 Scenario: You are building a simple API using AWS API Gateway. This API will have a resource path and a method to handle HTTP requests.Think of this like setting up a new phone line (resource) and deciding what kind of calls (methods) it can take.
🎯 Goal: Create an AWS API Gateway REST API with a resource path /products and add a GET method to it.
📋 What You'll Learn
Create a REST API named StoreAPI
Add a resource with path part products
Add a GET method to the /products resource
💡 Why This Matters
🌍 Real World
APIs are the backbone of modern applications. Setting up resources and methods in API Gateway allows you to create scalable and secure APIs for your services.
💼 Career
Cloud engineers and developers often need to configure API Gateway resources and methods to expose backend services securely and efficiently.
Progress0 / 4 steps
1
Create the REST API
Create a REST API named StoreAPI using AWS SDK or AWS CLI syntax. Assign it to a variable called api.
AWS
Need a hint?

Use create_rest_api method with name='StoreAPI'.

2
Add the /products resource
Add a resource with path part products to the REST API stored in api. Assign the new resource to a variable called products_resource.
AWS
Need a hint?

Use create_resource with restApiId=api['id'], parentId=api['rootResourceId'], and pathPart='products'.

3
Add GET method to /products
Add a GET method to the products_resource. Use authorizationType='NONE' and assign the method response to a variable called get_method.
AWS
Need a hint?

Use put_method with restApiId=api['id'], resourceId=products_resource['id'], httpMethod='GET', and authorizationType='NONE'.

4
Add integration for GET method
Add a MOCK integration to the GET method on products_resource. Use type='MOCK' and assign the integration response to a variable called get_integration.
AWS
Need a hint?

Use put_integration with restApiId=api['id'], resourceId=products_resource['id'], httpMethod='GET', type='MOCK', and integrationHttpMethod='GET'.