Что нового
  • Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Sports API Management System

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
11,974
Баллы
155
Project Description


This project demonstrates building a containerized api management system for querying sports data. It uses Amazon ECS for running containers, Amazon API Gateway for exposing REST Endpoints and an external Sports API for real-time sports data. The project showcases advanced cloud computing practices, including API management, container orchestration, and secure AWS integrations.

Project Architecture



Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Project Setup

  • Clone the Repository

git clone

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.


cd containerized-sports-api

-Create an ECR Repository
aws ecr create-repository --repository-name sports-api --region us-east-1

  • Authenticate, Build, and Push Docker Image

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com

docker build --platform linux/amd64 -t sports-api .
docker tag sports-api:latest <AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/sports-api:sports-api-latest
docker push <AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/sports-api:sports-api-latest

  • Set Up an ECS Cluster with Fargate
    • Create an ECS Cluster:
    • Navigate to the ECS Console → Clusters → Create Cluster.
    • Name the cluster (e.g., sports-api-cluster).
    • Choose Fargate as the infrastructure type, then create the cluster.

  • Create a Task Definition:


  • Go to Task Definitions → Create New Task Definition.
    • Name the task definition (e.g., sports-api-task).
    • Choose Fargate as the infrastructure type.
    • Add the container:
    • Name: sports-api-container
    • Image URI: .dkr.ecr.us-east-1.amazonaws.com/sports-api:sports-api-latest
    • Container Port: 8080
    • Environment Variables:
      • Key: SPORTS_API_KEY
      • Value:
    • Save and create the task definition.

  • Deploy the Service with an Application Load Balancer (ALB):
    • Go to Clusters → Select Cluster → Service → Create Service.
    • Configuration:
    • Capacity Provider: Fargate
    • Task Definition: sports-api-task
    • Service Name: sports-api-service
    • Desired Tasks: 2
    • Networking:
      • Create a new security group allowing TCP traffic.
      • Type: All TCP, Source: Anywhere
    • Load Balancer:
      • Select Application Load Balancer (ALB).
      • ALB Configuration:
      • Create a new ALB named sports-api-alb.
      • Health Check Path: /sports
    • Create the service.

  • Test the ALB:

  • Configure API Gateway
    • Create a REST API:
    • Navigate to API Gateway Console → Create API → REST API.
    • Name the API (e.g., Sports API Gateway).
    • Set Up Integration:
    • Create a resource /sports.
    • Create a GET method and choose HTTP Proxy as the integration type.
    • Enter the ALB DNS name followed by /sports.
    • Deploy the API: -Deploy the API to a stage (e.g., prod) and note the endpoint URL.

  • Test the System
    • Use a browser or curl to test: curl https://<api-gateway-id>.execute-api.us-east-1.amazonaws.com/prod/sports
Conclusion


This project demonstrates how to build a scalable, containerized sports data API management system using modern AWS services such as ECS with Fargate, API Gateway, and CloudWatch. By integrating these services, we achieved a reliable and secure infrastructure for hosting and managing APIs, while also adhering to best practices like containerization and least privilege IAM policies. Future enhancements like caching with ElastiCache, user-specific data storage with DynamoDB, and implementing CI/CD pipelines can further optimize the system for performance and maintainability. This documentation serves as a comprehensive guide to replicate, deploy, and extend the system, empowering developers to leverage AWS for similar use cases.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх