Objective: Create a new REST API in AWS API Gateway with the name
student
and the Edge-optimized endpoint type, to integrate with Lambda functions (getStudentData
,insertStudentData
,BackupDynamoDBAndSendEmail
) and the web interface (running on CloudFront). This API will provide endpoints to access, store, and back up student data, while being secured with an API Key and supporting CORS.
student
API will include the following endpoints:
getStudentData
function to fetch the student list from the DynamoDB studentData
table.insertStudentData
function to store student information and send a confirmation email via SES.BackupDynamoDBAndSendEmail
function to back up data to S3 and send an email notification.You need to complete the steps in section 3 (create Lambda functions getStudentData
, insertStudentData
, BackupDynamoDBAndSendEmail
, DynamoDB table studentData
, S3 bucket student-backup-20250706
, SES email verification). Ensure your AWS account is set up, and the AWS region is us-east-1
.
Access the AWS Management Console
Open your browser and log in to the AWS Management Console with your AWS account.
In the search bar at the top, type API Gateway and select the Amazon API Gateway service to go to the management interface.
Check the AWS region: Make sure you are working in the primary AWS region (e.g., us-east-1
), and check the region at the top right corner of the AWS Console. This region should match with the Lambda functions (getStudentData
, insertStudentData
, BackupDynamoDBAndSendEmail
), DynamoDB table studentData
, S3 bucket student-backup-20250706
, and SES.
Figure 1: AWS Console Interface with API Gateway Search Bar.
Navigate to the APIs Section
In the main Amazon API Gateway interface, look at the left navigation menu.
Select APIs to view the list of existing APIs. If you haven’t created any API, the list will be empty.
The interface will show options to create or manage APIs.
Figure 2: Navigation Menu with APIs Option.
Initiate the API Creation Process
In the APIs interface, click the Create API button at the top right to start creating a new API.
If you immediately see the REST API option, move to step 4. If not, the interface will list types of APIs (REST API, HTTP API, WebSocket API).
Figure 3: Create API Button in the APIs Interface.
Choose REST API and Build
In the Create API interface, find the REST API option (not REST API Private or HTTP API).
Click Build under REST API to begin creating a RESTful API.
REST API Notes:
Figure 4: Choose REST API and Click Build.
Configure the API Details
student
(different from StudentManagementAPI
in section 4 earlier, I will use student
as requested).
Figure 5: API Configuration Interface.
Click Create API to create the API.
Figure 6: Click Create API Button.
Check API Creation Status
student
API.apigateway:POST
to create APIs.
Figure 7: API Management Page for student API after creation.
Element | Details |
---|---|
API Name | The name student must be entered exactly as it will appear in the Invoke URL (e.g., https://api-id.execute-api.us-east-1.amazonaws.com/prod ). |
Edge-optimized vs Regional | Edge-optimized is suitable for this system because the web interface uses CloudFront. The Invoke URL will have the format using CloudFront edge locations. If you need to integrate with a custom domain (e.g., api.system.edu.vn ), ensure you configure the domain in API Gateway and CloudFront after the API is created. |
AWS Region | Ensure the region us-east-1 matches with the Lambda functions, DynamoDB studentData table, S3 bucket student-backup-20250706 , and SES. If you’re using a different region (e.g., us-west-2 ), you will need to adjust when configuring Lambda integration (steps 4.4, 4.5, 4.6). |
Error Handling | If you encounter an “AccessDenied” error, check your AWS account IAM permissions. If the API is not showing up, refresh the page or check the AWS region again. |
Optimization | After creating the API, you can add more detailed descriptions in Settings (left menu) or enable API Gateway logging for monitoring: - Go to Settings > CloudWatch Logs > Select Enable CloudWatch Logs and set the log level (e.g., INFO). - This helps debug when integrating with Lambda or the web interface. |
Early Testing | After creating the API, verify that the student API appears in the APIs list and check the Invoke URL after deployment (step 4.8) to ensure the API is ready for integration. |
Practical Tip: Verify that the
student
API appears in the APIs list and check the Invoke URL after deployment (step 4.8) to ensure the API is ready for integration.
The student
REST API has been successfully created in AWS API Gateway with the Edge-optimized endpoint type, ready to configure resources and methods in the next steps.
Next step: Go to Create API Key to Secure Access to continue!