My machine image requires 2 network interfaces. I want to avoid having to manually do that after the instance is brought up. Is there a way to add the 2nd network interface during Launch? either in the AWS GUI or scripted way, I am open to both.
I know how to add the second interface to an instance after it has been created. I would like to minimize the amount of work I have to do after the fact. I want to streamline this part of the process to make it easier for the users to consume this image.
2
Answers
Yes you can add ENIs to an EC2 during configuration via the Console. To do this, start launching an instance and go to Network Settings > Advanced Network Configuration > Add Network Interface.
Just know the number of ENIs you can add is dependent on your instance type. This info can be found here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI
If you want this automated, use Infrastructure as Code or the create a script that uses the AWS CLI
If you don’t want to manually add another network interface, you can try add this script at the user data of EC2 instances