Lab 3 2 AWS EC2 with CLI Lab 2 - nicolas-tullio/Tech-Journal GitHub Wiki
Deliverables
Submit Screenshot: Use the describe-instances command to just output the instance-ids of running instances (Hint: "instance-id" (query) and "instance-state-name" (filter)
Submit Screenshot: Use the describe-instances command to just output the instance-ids and public IP address of running instances (add query for PublicIpAddress - may need to study reference or google for syntax)
Submit Screenshot: Use the describe-instances command to just output the instance-ids and public IP address of only Windows, running instances (Hint "platform")
Submit Screenshot: Connection to instance via RDP
Submit Screenshot showing that the Instances are terminated
Steps
Launch Instances from CLI
AMI IDs:
- Ubuntu: ami-080e1f13689e07408
- Win: ami-03cd80cfebcbb4481
Ubuntu Instance
aws ec2 run-instances --image-id ami-080e1f13689e07408 --count 1 --instance-type t2.micro --key-name nicolas --security-groups default --region us-east-1
Windows Instance
aws ec2 run-instances --image-id ami-03cd80cfebcbb4481 --count 1 --instance-type t2.micro --key-name nicolas --security-groups default --region us-east-1
Describe Instances
aws ec2 describe-instances
Query specific information on Instances from CLI
Use the describe-instances command to just output the instance-ids of running instances (Hint: "instance-id" (query) and "instance-state-name" (filter)
aws ec2 describe-instances --query "Reservations[*].Instances[*].[InstanceId]" --filters Name=instance-state-name,Values=running --output json
Use the describe-instances command to just output the instance-ids and public IP address of running instances (add query for PublicIpAddress - may need to study reference or google for syntax)
aws ec2 describe-instances --query "Reservations[*].Instances[*].[InstanceId, PublicIpAddress]" --filters Name=instance-state-name,Values=running --output json
Use the describe-instances command to just output the instance-ids and public IP address of only Windows, running instances (Hint "platform")
aws ec2 describe-instances --query "Reservations[*].Instances[*].[InstanceId, PublicIpAddress]" --filters Name=instance-state-name,Values=running Name=platform,Values=windows --output json
Use RDP to Connect to your Windows Instance
Allow RDP through security group via my IP
Use AWS to download the RDP file and get the Windows password
Username: Administrator
Password: epvMcSrS*8YO9&.ht1T.m3O&F!Qo4hYg
Connect via RDP using the gathered creds
Terminate Instances
aws ec2 terminate-instances --instance-ids i-034e71d012b038e81 i-00bbe601e37e92091