EC2

Now you need to upload your ssh public key and then launch the EC2 instance on both the public subnet and the private subnet:

  1. Upload your ssh public key (assume you have a public key that is located at ~/.ssh/id_rsa.pub):
$ aws ec2 import-key-pair --key-name=chap6-key --public-key-material "`cat ~/.ssh/id_rsa.pub`"
  1. Launch the first EC2 instance with the following parameters:
    • Use Amazon Linux image: ami-1853ac65 (Amazon Linux)
    • T2.nano instance type: t2.nano
    • Ssh key: chap6-key
    • Public Subnet: subnet-6296863f
    • Public Security Group: sg-dd8a3f94
$ aws ec2 run-instances --image-id ami-1853ac65 --instance-type t2.nano --key-name chap6-key --security-group-ids sg-dd8a3f94 --subnet-id subnet-6296863f
  1. Launch the second EC2 instance with ...

Get Getting Started with Containerization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.