AWS Fargate
AWS Fargate is a serverless compute engine for containers. It allows users to run containers without managing the underlying infrastructure. With Fargate, you specify your container requirements (CPU, memory, networking), and AWS handles the provisioning and scaling of the infrastructure to run your containers. Users only pay for the resources consumed by their containers, making it a convenient and cost-effective way to deploy and manage containerized applications.
Fargate works with Amazon ECS and Amazon EKS. Each task or pod runs in its own isolated environment, with its own network interface in a subnet of your VPC, and is billed per second for the vCPU, memory and storage that it requests. Images are pulled from ECR or other registries. Unlike EC2 instances, there is no operating system to patch and no cluster capacity to plan.
In Terraform, Fargate is selected with launch_type = "FARGATE" (or a capacity provider) in an aws_ecs_service, or with an aws_eks_fargate_profile for EKS.
See tutorials: