How to limit aws instance ip range generated by ec2-instance create cli script?
In my jenkins environment, i have configured the AWS cli, which generates the AWS instance on the run using “ec2-run-instances” command. On this i create docker and run it. However, occassionally i need to debug the generated instance manually. Now the issue is that i am working in a secured environment, where access to unknown instances is blocked by default as per corporate security policies. So i could not login to generated aws linux instance.
I want to know, what can be the best way to handle this situation? Is there an option, using which i can specify aws instance would pickup from particular ip range?
Thanks in advance
One Solution collect form web for “How to limit aws instance ip range generated by ec2-instance create cli script?”
What you are looking here requires configuration of a VPC – and run all your EC2 instances in it. A VPC can consist of one or more subnets – and be configured to how an IP range.
During the launch of an EC2 instance (manually or through CLI) – you can specify a subnet. The new EC2 instance will only come up in that IP range.
Depending on what you need, you can pick the VPC scenario
(complexity increases from 1-3)