Professional Documents
Culture Documents
2. AWS CLI command for creating rules for security group devenv-sg earlier
aws ec2 authorize-security-group-ingress --group-name devenv-sg --protocol tcp --port 22 --cidr 0.0.0.0/0
3. Next, create a key pair, which allows you to connect to the instance.
aws ec2 create-key-pair --key-name MyKeyPair --query 'KeyMaterial' --output text | out-file -encoding ascii -filepath
MyKeyPair.pem
(Note:- MyKeyPair.pem will be saved into your current working directory)
5. The instance will take a few moments to launch. Once the instance is up and running, the following command will retrieve the
public IP address that you will use to connect to the instance.
aws ec2 describe-instances --instance-ids "i-044241315b800c7cd" --query 'Reservations[0].Instances[0].PublicIpAddress'