Terraform deploy jenkins slave on aws eks fargate
run the slave behind ALB
access jenkins dashboard via ALB or using the url by adding the key-pair in the launch template during creation.
architecture diagram of the workflow
Use Terraform to provision AWS fargate, create eks cluster, nodegroup and deploy Jenkins on worker nodes. Terraform should be to use aws keypair to lunch the ec2 nodes, Terraform will create a vpc and its components and then use a variable to call those components to play.
Note: You can use aws Launch Template to install the required software e.g Java, and Jenkins, and just use the terraform to call the Template to run and install the tools during nodes launching. You can add the Launch Template details in the Terraform Script.