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

  • AWS EB deployment - where is my app?
  • EC2 with Docker and EBS volume, mount EBS volume inside container during init
  • How do I run an nginx reverse proxy container on ECS using arguments
  • How to identify whether my container is running on AWS ECS or not?
  • Docker swarm and ec2, how to advertise external ip address
  • How I can inject artifact from AWS S3 inside Docker image?
  • How can kubernetes dynamically expose my docker port?
  • How to manage docker swarm?
  • How to choose to which network doing port mapping
  • Strange state of docker on Windows
  • docker build giving unauthorized: authentication required
  • Boot2docker very slow on Windows without shared folders
  • 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)

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.