I started experimenting with AWS and as a first tiny project I deployed a fastAPI-based REST API to AWS Lambda, a serverless framework. Amazon API Gateway acts as a front-door to the Lambda instance. The architecture roughly looks like this:
Using AWS SAM, the deployment works like this:
sam validate sam build --use-container --debug sam package --s3-bucket <S3-BUCKET-NAME> --output-template-file out.yml --region eu-west-1 sam deploy --template-file out.yml --stack-name example-stack-name --region eu-west-1 --no-fail-on-empty-changeset --capabilities CAPABILITY_IAM
I found this post very helpful when working on my project. The post describes in a lot more detail which AWS accesses need to be created to make this work - check it out.
A great continuation of my tiny project would be setting up continuous deployment of the API using, for example, GitHub Actions.