Instance meta deta explains lot of things related to the running or stopped EC2 instance which include ami-id which denotes the AMI used to provision the instance, instance-id which…