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

  • Amazon EC2 boot time
  • Authorization error with AWS
  • AWS EB, Play Framework and Docker: Application Already running
  • Kubernetes creation in AWS - ap-northeast-2 region throws error “Please specify AWS_IMAGE directly (region not recognized)”
  • Docker swarm and published port not available
  • Docker containers seem to 'inherit' the instance profile of the host ec2. How?
  • Docker - `top` like real time metrics in command line
  • Docker - where are the src files for ADD and COPY?
  • Mesos-Marathon docker
  • Gitlab Pipelines Stages take hours or days to show result (passed, failed) - docker, node app
  • npm install with a docker-compose project
  • How to solve “Rather than invoking init scripts…” on Ubuntu 14
  • 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.