1. Create a Commandhost instance, log in to Commandhost, and create a webserver instance from the AWS Cli.
1.1 Creating an IAM role for a commandhost instance
1.2 Creating an Commandhost instance
1.3 Creating a security group for webserver instances
1.4 Connecting to Commandhost instances
1.5 Configuring the AWS CLI
1.6 Creating an Webserver instance
1.6.1 Download UserData Script
(New-object net.webclient). DownloadFile (' Https://d2lrzjb0vjvpn5.cloudfront.net/sys-ops/v2.4/lab-1-compute-windows/static/UserData.txt ', ' C : \temp\userdata.txt ')
1.6.2 Creating a new instance
AWS EC2 Run-instances--image-id AMI-DF8767BF--user-data file://c:\temp\userdata.txt--key-name qwikLABS-L1033-414091 --security-group-ids sg-eebb3c89--instance-type t2.medium--subnet-id subnet-e2837a86--associate-public-ip-address --query ' instances[*]. InstanceId '
1.6.3 to tag new instances (Name=webserver)
AWS EC2 Create-tags--resources i-87e89b40--tags ' Key=name,value=webserver '
1.6.4 checking whether a new instance was created successfully
AWS EC2 Describe-instances--instance-ids I-87E89B40
1.6.5 Display new instance status information only
AWS EC2 Describe-instances--instance-ids I-87E89B40--query ' reservations[0]. Instances[0]. State.name '
1.6.6 Check for new instance DNS name
AWS EC2 Describe-instances--instance-ids I-87E89B40--query ' reservations[0]. Instances[0]. Publicdnsname '
1.6.7 access validation from a local browser
System Operations on Aws-lab 1w-creating EC2 (Windows)