Scheduling an EC2 Windows-based task with Terraform
In Chapter 4, Deploying a Windows Container Instance, in the Deploying a Windows container instance with Terraform section, we covered and deployed an Amazon ECS cluster with container instances using a Launch Template and an Auto Scaling Group.
In this chapter, we will deploy an ECS service to host two EC2 Windows-based tasks and expose these tasks to the internet through an Application Load Balancer (ALB).
Important note
You will see code snippets for the remainder of this section. The full Terraform code for this chapter can be found at https://github.com/PacktPublishing/Running-Windows-Containers-on-AWS//tree/main/ecs-ec2-windows.
Deploying an EC2 Windows-based task definition
In this first step, we will create the EC2 Windows-based task definition, which hosts a default IIS Sample Application. You may notice I’m using many variables to make the code more dynamic. You can check out the values in the variables...