Skip to content

Instantly share code, notes, and snippets.

@li0nel
Last active January 1, 2019 05:57
Show Gist options
  • Save li0nel/513410d1114b84c32822702e5cb20bb6 to your computer and use it in GitHub Desktop.
Save li0nel/513410d1114b84c32822702e5cb20bb6 to your computer and use it in GitHub Desktop.
Create a bastion to access your instances in private subnets
aws ec2 run-instances
--image-id ami-c1a6bda2
--key-name laravelaws # the SSH key pair we created earlier
--security-group-ids sg-xxxxxxxx # our previous SG allowing access to the DB
--subnet-id subnet-xxxxxxxx # one of our public subnets
--count 1
--instance-type t2.micro # the smallest instance type allowed
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=bastion}]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment