Looking at the documentation for configuring an Elastic IP, I can see I can assign it to an EC2 Instance or a Network Interface. But, using an Autoscaling Group with EC2 Launch Templates means there won’t be one Instance to assign the EIP to, meaning I HAVE to use a Network Interface?
I’ve done the core that would work with one EC2 Instance, although it’s the rest that confuses me.
With this configuration, how would I structure a VPC, Internet Gateway, EIP, Network Interface, Load Balancer, Autoscaling Group and everything in-between (Routing Tables, Subnets, Security Groups, IAM Policies / Users / Access Keys, etc.)?
I know most of this will depend on the scenario, and there are other services I will be integrating into this, such as a VPC Endpoint to an S3 Bucket, VPC Peering, and possibly KMS to secure environment variables for scaled instances.
Regardless of that, does anyone have a general example of making a scalable AWS service using Terraform and these general services, which retains an IP address (EIP / VPC / ASG)? (without EKS / ECS / Lambda).