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 ECS volumes do not share any files
  • Can docker run additional libraries my OS doesnt support?
  • How to move Marathon to docker at AWS?
  • Issues with AWS Route53 setup for Multi Docker Container
  • Detect if my app runs in Azure
  • docker-machine with amazon ami HVM doesn't work
  • Restart a process inside a Docker container whenever the config file changes
  • Getting wordpress docker to run on local host
  • Docker build auth error
  • Multicast not being sent to all Docker containers
  • How to access Docker container from another machine on lan
  • Upgrade docker-compose version on windows 7
  • 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
    http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Scenarios.html

    (complexity increases from 1-3)

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