Launch a new instance using the CLI and userdata given the script you wrote in the last exercise.
aws ec2 run-instances --image-id "ami-0f9fc25dd2506cf6d" --instance-type "t2.micro" --user-data fileb://get-instance-info.sh --iam-instance-profile='{"Name": "EC2PowerUserRole"}' --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=adv_linux_ex_4.4}]' --key-name "dixonaws" --region us-east-1
Important! You will need to consider a few things before running this script:
--key-name "dixonaws"
with the one that you have in
your accountThe result should be two things: a new EC2 instance tagged as “adv_linux_ex_4.4” and a new file s written to your S3 bucket with some identifying metadata about the instance.