Develop a virtual workspace platform for developers, similar to GitHub Codespaces, using AWS services. The platform should have the following features and functionalities:

Utilize AWS services such as CodeBuild for building NAME_1 images, ECR for storing NAME_1 images, and EC2 or Kubernetes for infrastructure management.
Project requirements:
Manage all operations through a Python API, utilizing the FastAPI framework and MongoDB for the database.
Users can provide templates, which include infrastructure configurations (e.g., EC2 instance types) and one or more NAME_1 configurations. This allows a single template to have multiple NAME_1 images.
Upon template creation, build the necessary NAME_1 images using CodeBuild, store them in ECR, and update the IDs and URLs in the database.
When a user requests to create a workspace, they will provide the template ID. The API should then spin up the infrastructure (Kubernetes or EC2), download and run the corresponding NAME_1 images, and update the running container ports, SHA, and other relevant information in the database. Do not include the following keywords: template, functionality, instance, utilize
user